| 1 |
*** orig/LIBRARY/float128/dpml_exception.c 2016-05-28 12:12:14.000000000 -0400 |
| 2 |
--- LIBRARY/float128/dpml_exception.c 2016-05-28 12:12:40.000000000 -0400 |
| 3 |
*************** |
| 4 |
*** 131,137 **** |
| 5 |
#if !defined(DPML_SIGNAL) && !defined(MINIMAL_SILENT_MODE_EXCEPTION_HANDLER) && \ |
| 6 |
!defined(wnt) |
| 7 |
|
| 8 |
! # include <sys/signal.h> |
| 9 |
# define DPML_SIGNAL(p) raise(SIGFPE) |
| 10 |
|
| 11 |
#else |
| 12 |
--- 131,137 ---- |
| 13 |
#if !defined(DPML_SIGNAL) && !defined(MINIMAL_SILENT_MODE_EXCEPTION_HANDLER) && \ |
| 14 |
!defined(wnt) |
| 15 |
|
| 16 |
! # include <signal.h> |
| 17 |
# define DPML_SIGNAL(p) raise(SIGFPE) |
| 18 |
|
| 19 |
#else |
| 20 |
*** orig/TESTS/readtest.c 2016-05-21 10:44:20.000000000 -0400 |
| 21 |
--- TESTS/readtest.c 2016-05-21 11:58:37.000000000 -0400 |
| 22 |
*************** |
| 23 |
*** 1,3 **** |
| 24 |
--- 1,4 ---- |
| 25 |
+ #ifdef FREE42_FPTEST |
| 26 |
/* |
| 27 |
Copyright (c) 2007-2011, Intel Corp. |
| 28 |
All rights reserved. |
| 29 |
*************** |
| 30 |
*** 52,57 **** |
| 31 |
--- 53,59 ---- |
| 32 |
#if !defined _MSC_VER && !defined __INTEL_COMPILER |
| 33 |
#include <fenv.h> |
| 34 |
#endif |
| 35 |
+ #include <setjmp.h> |
| 36 |
|
| 37 |
#include "test_bid_conf.h" |
| 38 |
#include "test_bid_functions.h" |
| 39 |
*************** |
| 40 |
*** 120,125 **** |
| 41 |
--- 122,132 ---- |
| 42 |
int check_restore_binary_status(); |
| 43 |
int check_pollution_workaround(void); |
| 44 |
|
| 45 |
+ jmp_buf env; |
| 46 |
+ int testlogprintf(const char *fmt, ...); |
| 47 |
+ int tests_eof(); |
| 48 |
+ void tests_readline(char *buf, int bufsize); |
| 49 |
+ |
| 50 |
#ifndef HPUX_OS |
| 51 |
#ifndef FE_UNNORMAL |
| 52 |
#define FE_UNNORMAL 2 |
| 53 |
*************** |
| 54 |
*** 143,150 **** |
| 55 |
dpd = bid; \ |
| 56 |
BIDECIMAL_CALL1_NORND_RESREF(bid128_to_string, str, bid); \ |
| 57 |
} else { \ |
| 58 |
! printf("Internal error - can't read number form string %s\n", op+1); \ |
| 59 |
! exit(1); \ |
| 60 |
} \ |
| 61 |
} else { \ |
| 62 |
BIDECIMAL_CALL1_RESARG(bid128_from_string, (bid), (op)); \ |
| 63 |
--- 150,157 ---- |
| 64 |
dpd = bid; \ |
| 65 |
BIDECIMAL_CALL1_NORND_RESREF(bid128_to_string, str, bid); \ |
| 66 |
} else { \ |
| 67 |
! testlogprintf("Internal error - can't read number form string %s\n", op+1); \ |
| 68 |
! longjmp(env, 1); \ |
| 69 |
} \ |
| 70 |
} else { \ |
| 71 |
BIDECIMAL_CALL1_RESARG(bid128_from_string, (bid), (op)); \ |
| 72 |
*************** |
| 73 |
*** 162,169 **** |
| 74 |
dpd = (bid); \ |
| 75 |
BIDECIMAL_CALL1_NORND_RESREF(bid32_to_string, str, bid); \ |
| 76 |
} else { \ |
| 77 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 78 |
! exit(1); \ |
| 79 |
} \ |
| 80 |
} else { \ |
| 81 |
BIDECIMAL_CALL1_RESARG(bid32_from_string, bid, op); \ |
| 82 |
--- 169,176 ---- |
| 83 |
dpd = (bid); \ |
| 84 |
BIDECIMAL_CALL1_NORND_RESREF(bid32_to_string, str, bid); \ |
| 85 |
} else { \ |
| 86 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 87 |
! longjmp(env, 1); \ |
| 88 |
} \ |
| 89 |
} else { \ |
| 90 |
BIDECIMAL_CALL1_RESARG(bid32_from_string, bid, op); \ |
| 91 |
*************** |
| 92 |
*** 182,189 **** |
| 93 |
dpd = bid; \ |
| 94 |
BIDECIMAL_CALL1_NORND_RESREF(bid64_to_string, str, bid); \ |
| 95 |
} else { \ |
| 96 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 97 |
! exit(1); \ |
| 98 |
} \ |
| 99 |
} else { \ |
| 100 |
BIDECIMAL_CALL1_RESARG(bid64_from_string, bid, op); \ |
| 101 |
--- 189,196 ---- |
| 102 |
dpd = bid; \ |
| 103 |
BIDECIMAL_CALL1_NORND_RESREF(bid64_to_string, str, bid); \ |
| 104 |
} else { \ |
| 105 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 106 |
! longjmp(env, 1); \ |
| 107 |
} \ |
| 108 |
} else { \ |
| 109 |
BIDECIMAL_CALL1_RESARG(bid64_from_string, bid, op); \ |
| 110 |
*************** |
| 111 |
*** 198,210 **** |
| 112 |
#define getop32i(bid, op, str) \ |
| 113 |
if (*op == '[') { \ |
| 114 |
if (!sscanf(op+1, "%08x", &bid)) { \ |
| 115 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 116 |
! exit(1); \ |
| 117 |
} \ |
| 118 |
} else { \ |
| 119 |
if (!sscanf(op, "%d", &bid)) { \ |
| 120 |
! printf("Internal error - can't read number form string %s\n", op); \ |
| 121 |
! exit(1); \ |
| 122 |
} \ |
| 123 |
} \ |
| 124 |
sprintf(str, "%d", bid); |
| 125 |
--- 205,217 ---- |
| 126 |
#define getop32i(bid, op, str) \ |
| 127 |
if (*op == '[') { \ |
| 128 |
if (!sscanf(op+1, "%08x", &bid)) { \ |
| 129 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 130 |
! longjmp(env, 1); \ |
| 131 |
} \ |
| 132 |
} else { \ |
| 133 |
if (!sscanf(op, "%d", &bid)) { \ |
| 134 |
! testlogprintf("Internal error - can't read number form string %s\n", op); \ |
| 135 |
! longjmp(env, 1); \ |
| 136 |
} \ |
| 137 |
} \ |
| 138 |
sprintf(str, "%d", bid); |
| 139 |
*************** |
| 140 |
*** 212,224 **** |
| 141 |
#define getop16i(bid, op, str) \ |
| 142 |
if (*op == '[') { \ |
| 143 |
if (!sscanf(op+1, "%04x", &bid)) { \ |
| 144 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 145 |
! exit(1); \ |
| 146 |
} \ |
| 147 |
} else { \ |
| 148 |
if (!sscanf(op, "%d", &bid)) { \ |
| 149 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 150 |
! exit(1); \ |
| 151 |
} \ |
| 152 |
} \ |
| 153 |
sprintf(str, "%d", bid); |
| 154 |
--- 219,231 ---- |
| 155 |
#define getop16i(bid, op, str) \ |
| 156 |
if (*op == '[') { \ |
| 157 |
if (!sscanf(op+1, "%04x", &bid)) { \ |
| 158 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 159 |
! longjmp(env, 1); \ |
| 160 |
} \ |
| 161 |
} else { \ |
| 162 |
if (!sscanf(op, "%d", &bid)) { \ |
| 163 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 164 |
! longjmp(env, 1); \ |
| 165 |
} \ |
| 166 |
} \ |
| 167 |
sprintf(str, "%d", bid); |
| 168 |
*************** |
| 169 |
*** 227,239 **** |
| 170 |
if (*op == '[') { \ |
| 171 |
if (!sscanf(op+1, "%02x", &bid)) { \ |
| 172 |
} else { \ |
| 173 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 174 |
! exit(1); \ |
| 175 |
} \ |
| 176 |
} else { \ |
| 177 |
if (!sscanf(op, "%d", &bid)) { \ |
| 178 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 179 |
! exit(1); \ |
| 180 |
} \ |
| 181 |
} \ |
| 182 |
sprintf(str, "%d", bid); |
| 183 |
--- 234,246 ---- |
| 184 |
if (*op == '[') { \ |
| 185 |
if (!sscanf(op+1, "%02x", &bid)) { \ |
| 186 |
} else { \ |
| 187 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 188 |
! longjmp(env, 1); \ |
| 189 |
} \ |
| 190 |
} else { \ |
| 191 |
if (!sscanf(op, "%d", &bid)) { \ |
| 192 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 193 |
! longjmp(env, 1); \ |
| 194 |
} \ |
| 195 |
} \ |
| 196 |
sprintf(str, "%d", bid); |
| 197 |
*************** |
| 198 |
*** 241,253 **** |
| 199 |
#define getop32u(bid, op, str) \ |
| 200 |
if (*op == '[') { \ |
| 201 |
if (!sscanf(op+1, "%08x", &bid)) { \ |
| 202 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 203 |
! exit(1); \ |
| 204 |
} \ |
| 205 |
} else { \ |
| 206 |
if (!sscanf(op, "%u", &bid)) { \ |
| 207 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 208 |
! exit(1); \ |
| 209 |
} \ |
| 210 |
} \ |
| 211 |
sprintf(str, "%u", bid); |
| 212 |
--- 248,260 ---- |
| 213 |
#define getop32u(bid, op, str) \ |
| 214 |
if (*op == '[') { \ |
| 215 |
if (!sscanf(op+1, "%08x", &bid)) { \ |
| 216 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 217 |
! longjmp(env, 1); \ |
| 218 |
} \ |
| 219 |
} else { \ |
| 220 |
if (!sscanf(op, "%u", &bid)) { \ |
| 221 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 222 |
! longjmp(env, 1); \ |
| 223 |
} \ |
| 224 |
} \ |
| 225 |
sprintf(str, "%u", bid); |
| 226 |
*************** |
| 227 |
*** 255,267 **** |
| 228 |
#define getop16u(bid, op, str) \ |
| 229 |
if (*op == '[') { \ |
| 230 |
if (!sscanf(op+1, "%04x", &bid)) { \ |
| 231 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 232 |
! exit(1); \ |
| 233 |
} \ |
| 234 |
} else { \ |
| 235 |
if (!sscanf(op, "%u", &bid)) { \ |
| 236 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 237 |
! exit(1); \ |
| 238 |
} \ |
| 239 |
} \ |
| 240 |
sprintf(str, "%u", bid); |
| 241 |
--- 262,274 ---- |
| 242 |
#define getop16u(bid, op, str) \ |
| 243 |
if (*op == '[') { \ |
| 244 |
if (!sscanf(op+1, "%04x", &bid)) { \ |
| 245 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 246 |
! longjmp(env, 1); \ |
| 247 |
} \ |
| 248 |
} else { \ |
| 249 |
if (!sscanf(op, "%u", &bid)) { \ |
| 250 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 251 |
! longjmp(env, 1); \ |
| 252 |
} \ |
| 253 |
} \ |
| 254 |
sprintf(str, "%u", bid); |
| 255 |
*************** |
| 256 |
*** 269,281 **** |
| 257 |
#define getop8u(bid, op, str) \ |
| 258 |
if (*op == '[') { \ |
| 259 |
if (!sscanf(op+1, "%02x", &bid)) { \ |
| 260 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 261 |
! exit(1); \ |
| 262 |
} \ |
| 263 |
} else { \ |
| 264 |
if (!sscanf(op, "%u", &bid)) { \ |
| 265 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 266 |
! exit(1); \ |
| 267 |
} \ |
| 268 |
} \ |
| 269 |
sprintf(str, "%u", bid); |
| 270 |
--- 276,288 ---- |
| 271 |
#define getop8u(bid, op, str) \ |
| 272 |
if (*op == '[') { \ |
| 273 |
if (!sscanf(op+1, "%02x", &bid)) { \ |
| 274 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 275 |
! longjmp(env, 1); \ |
| 276 |
} \ |
| 277 |
} else { \ |
| 278 |
if (!sscanf(op, "%u", &bid)) { \ |
| 279 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 280 |
! longjmp(env, 1); \ |
| 281 |
} \ |
| 282 |
} \ |
| 283 |
sprintf(str, "%u", bid); |
| 284 |
*************** |
| 285 |
*** 283,295 **** |
| 286 |
#define getop64i(bid, op, str) \ |
| 287 |
if (*op == '[') { \ |
| 288 |
if (!sscanf(op+1, BID_FMT_LLX16, &bid)) { \ |
| 289 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 290 |
! exit(1); \ |
| 291 |
} \ |
| 292 |
} else { \ |
| 293 |
if (!sscanf(op, BID_FMT_LLD, &bid)) { \ |
| 294 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 295 |
! exit(1); \ |
| 296 |
} \ |
| 297 |
} \ |
| 298 |
sprintf(str, BID_FMT_LLD, bid); |
| 299 |
--- 290,302 ---- |
| 300 |
#define getop64i(bid, op, str) \ |
| 301 |
if (*op == '[') { \ |
| 302 |
if (!sscanf(op+1, BID_FMT_LLX16, &bid)) { \ |
| 303 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 304 |
! longjmp(env, 1); \ |
| 305 |
} \ |
| 306 |
} else { \ |
| 307 |
if (!sscanf(op, BID_FMT_LLD, &bid)) { \ |
| 308 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 309 |
! longjmp(env, 1); \ |
| 310 |
} \ |
| 311 |
} \ |
| 312 |
sprintf(str, BID_FMT_LLD, bid); |
| 313 |
*************** |
| 314 |
*** 297,309 **** |
| 315 |
#define getop64u(bid, op, str) \ |
| 316 |
if (*op == '[') { \ |
| 317 |
if (!sscanf(op+1, BID_FMT_LLX16, &bid)) { \ |
| 318 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 319 |
! exit(1); \ |
| 320 |
} \ |
| 321 |
} else { \ |
| 322 |
if (!sscanf(op, BID_FMT_LLU, &bid)) { \ |
| 323 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 324 |
! exit(1); \ |
| 325 |
} \ |
| 326 |
} \ |
| 327 |
sprintf(str, BID_FMT_LLU, bid); |
| 328 |
--- 304,316 ---- |
| 329 |
#define getop64u(bid, op, str) \ |
| 330 |
if (*op == '[') { \ |
| 331 |
if (!sscanf(op+1, BID_FMT_LLX16, &bid)) { \ |
| 332 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 333 |
! longjmp(env, 1); \ |
| 334 |
} \ |
| 335 |
} else { \ |
| 336 |
if (!sscanf(op, BID_FMT_LLU, &bid)) { \ |
| 337 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 338 |
! longjmp(env, 1); \ |
| 339 |
} \ |
| 340 |
} \ |
| 341 |
sprintf(str, BID_FMT_LLU, bid); |
| 342 |
*************** |
| 343 |
*** 311,318 **** |
| 344 |
#define getopquad(quad1, quad2, op, str) \ |
| 345 |
if (*op == '[') { \ |
| 346 |
if (sscanf(op+1, BID_FMT_LLX16""BID_FMT_LLX16, ((BID_UINT64*)&quad1+BID_HIGH_128W), (BID_UINT64*)&quad1+BID_LOW_128W) != 2) { \ |
| 347 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 348 |
! exit(1); \ |
| 349 |
} \ |
| 350 |
} \ |
| 351 |
strcpy(str, "unavalable"); |
| 352 |
--- 318,325 ---- |
| 353 |
#define getopquad(quad1, quad2, op, str) \ |
| 354 |
if (*op == '[') { \ |
| 355 |
if (sscanf(op+1, BID_FMT_LLX16""BID_FMT_LLX16, ((BID_UINT64*)&quad1+BID_HIGH_128W), (BID_UINT64*)&quad1+BID_LOW_128W) != 2) { \ |
| 356 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 357 |
! longjmp(env, 1); \ |
| 358 |
} \ |
| 359 |
} \ |
| 360 |
strcpy(str, "unavalable"); |
| 361 |
*************** |
| 362 |
*** 324,339 **** |
| 363 |
arg80_den = arg80_snan = 0; \ |
| 364 |
if (*op == '[') { \ |
| 365 |
if (sscanf(op+1, BID_FMT_LLX16""BID_FMT_X4, (BID_UINT64*)&ldbl1, &tmpi) != 2) { \ |
| 366 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 367 |
! exit(1); \ |
| 368 |
} else {\ |
| 369 |
*((unsigned short*)((BID_UINT64*)&ldbl1+1)) = tmpi & 0xffff; \ |
| 370 |
} \ |
| 371 |
} else { \ |
| 372 |
double dtmp; \ |
| 373 |
if (!sscanf (op, "%lf", &dtmp)) { \ |
| 374 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 375 |
! exit(1); \ |
| 376 |
} \ |
| 377 |
ldbl1 = (BINARY80)dtmp; \ |
| 378 |
} \ |
| 379 |
--- 331,346 ---- |
| 380 |
arg80_den = arg80_snan = 0; \ |
| 381 |
if (*op == '[') { \ |
| 382 |
if (sscanf(op+1, BID_FMT_LLX16""BID_FMT_X4, (BID_UINT64*)&ldbl1, &tmpi) != 2) { \ |
| 383 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 384 |
! longjmp(env, 1); \ |
| 385 |
} else {\ |
| 386 |
*((unsigned short*)((BID_UINT64*)&ldbl1+1)) = tmpi & 0xffff; \ |
| 387 |
} \ |
| 388 |
} else { \ |
| 389 |
double dtmp; \ |
| 390 |
if (!sscanf (op, "%lf", &dtmp)) { \ |
| 391 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 392 |
! longjmp(env, 1); \ |
| 393 |
} \ |
| 394 |
ldbl1 = (BINARY80)dtmp; \ |
| 395 |
} \ |
| 396 |
*************** |
| 397 |
*** 348,361 **** |
| 398 |
arg80_den = arg80_snan = 0; \ |
| 399 |
if (*op == '[') { \ |
| 400 |
if (sscanf(op+1, BID_FMT_X4""BID_FMT_LLX16, (unsigned short*)((BID_UINT64*)&ldbl1+1), (BID_UINT64*)&ldbl1) != 2) { \ |
| 401 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 402 |
! exit(1); \ |
| 403 |
} \ |
| 404 |
} else { \ |
| 405 |
double dtmp; \ |
| 406 |
if (!sscanf (op, "%lf", &dtmp)) { \ |
| 407 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 408 |
! exit(1); \ |
| 409 |
} \ |
| 410 |
ldbl1 = (BINARY80)dtmp; \ |
| 411 |
} \ |
| 412 |
--- 355,368 ---- |
| 413 |
arg80_den = arg80_snan = 0; \ |
| 414 |
if (*op == '[') { \ |
| 415 |
if (sscanf(op+1, BID_FMT_X4""BID_FMT_LLX16, (unsigned short*)((BID_UINT64*)&ldbl1+1), (BID_UINT64*)&ldbl1) != 2) { \ |
| 416 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 417 |
! longjmp(env, 1); \ |
| 418 |
} \ |
| 419 |
} else { \ |
| 420 |
double dtmp; \ |
| 421 |
if (!sscanf (op, "%lf", &dtmp)) { \ |
| 422 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 423 |
! longjmp(env, 1); \ |
| 424 |
} \ |
| 425 |
ldbl1 = (BINARY80)dtmp; \ |
| 426 |
} \ |
| 427 |
*************** |
| 428 |
*** 370,382 **** |
| 429 |
arg64_den = arg64_snan = 0; \ |
| 430 |
if (*op == '[') { \ |
| 431 |
if (!sscanf(op+1, BID_FMT_LLX16, (BID_UINT64*)&dbl1)) { \ |
| 432 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 433 |
! exit(1); \ |
| 434 |
} \ |
| 435 |
} else { \ |
| 436 |
if (!sscanf (op, "%lf", &dbl1)) { \ |
| 437 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 438 |
! exit(1); \ |
| 439 |
} \ |
| 440 |
} \ |
| 441 |
{ int *px = (int*)&dbl1; \ |
| 442 |
--- 377,389 ---- |
| 443 |
arg64_den = arg64_snan = 0; \ |
| 444 |
if (*op == '[') { \ |
| 445 |
if (!sscanf(op+1, BID_FMT_LLX16, (BID_UINT64*)&dbl1)) { \ |
| 446 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 447 |
! longjmp(env, 1); \ |
| 448 |
} \ |
| 449 |
} else { \ |
| 450 |
if (!sscanf (op, "%lf", &dbl1)) { \ |
| 451 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 452 |
! longjmp(env, 1); \ |
| 453 |
} \ |
| 454 |
} \ |
| 455 |
{ int *px = (int*)&dbl1; \ |
| 456 |
*************** |
| 457 |
*** 389,401 **** |
| 458 |
arg32_den = arg32_snan = 0; \ |
| 459 |
if (*op == '[') { \ |
| 460 |
if (!sscanf(op+1, BID_FMT_X8, (BID_UINT32*)&flt1)) { \ |
| 461 |
! printf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 462 |
! exit(1); \ |
| 463 |
} \ |
| 464 |
} else { \ |
| 465 |
if (!sscanf (op, "%f", &flt1)) { \ |
| 466 |
! printf("Internal error - can't read number form string %s\n", (op)); \ |
| 467 |
! exit(1); \ |
| 468 |
} \ |
| 469 |
} \ |
| 470 |
{ int *px = (int*)&flt1; \ |
| 471 |
--- 396,408 ---- |
| 472 |
arg32_den = arg32_snan = 0; \ |
| 473 |
if (*op == '[') { \ |
| 474 |
if (!sscanf(op+1, BID_FMT_X8, (BID_UINT32*)&flt1)) { \ |
| 475 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)+1); \ |
| 476 |
! longjmp(env, 1); \ |
| 477 |
} \ |
| 478 |
} else { \ |
| 479 |
if (!sscanf (op, "%f", &flt1)) { \ |
| 480 |
! testlogprintf("Internal error - can't read number form string %s\n", (op)); \ |
| 481 |
! longjmp(env, 1); \ |
| 482 |
} \ |
| 483 |
} \ |
| 484 |
{ int *px = (int*)&flt1; \ |
| 485 |
*************** |
| 486 |
*** 550,556 **** |
| 487 |
rnd = rnd_mode = BID_ROUNDING_TO_ZERO; |
| 488 |
strcpy (rounding, roundstr[4]); |
| 489 |
} else { |
| 490 |
! printf |
| 491 |
("setrounding: unknown rounding mode string!!! Mode unchanged.\n"); |
| 492 |
} |
| 493 |
return 1; |
| 494 |
--- 557,563 ---- |
| 495 |
rnd = rnd_mode = BID_ROUNDING_TO_ZERO; |
| 496 |
strcpy (rounding, roundstr[4]); |
| 497 |
} else { |
| 498 |
! testlogprintf |
| 499 |
("setrounding: unknown rounding mode string!!! Mode unchanged.\n"); |
| 500 |
} |
| 501 |
return 1; |
| 502 |
*************** |
| 503 |
*** 741,748 **** |
| 504 |
} |
| 505 |
|
| 506 |
if (e1 != e2) { |
| 507 |
! printf("ERROR a, b "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16"\n", a.w[BID_HIGH_128W], a.w[BID_LOW_128W], b.w[BID_HIGH_128W], b.w[BID_LOW_128W]); |
| 508 |
! printf("ERROR r1, r2 "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16"\n", r1.w[BID_HIGH_128W], r1.w[BID_LOW_128W], r2.w[BID_HIGH_128W], r2.w[BID_LOW_128W]); |
| 509 |
return 1; |
| 510 |
} |
| 511 |
|
| 512 |
--- 748,755 ---- |
| 513 |
} |
| 514 |
|
| 515 |
if (e1 != e2) { |
| 516 |
! testlogprintf("ERROR a, b "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16"\n", a.w[BID_HIGH_128W], a.w[BID_LOW_128W], b.w[BID_HIGH_128W], b.w[BID_LOW_128W]); |
| 517 |
! testlogprintf("ERROR r1, r2 "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16" "BID_FMT_LLX16"\n", r1.w[BID_HIGH_128W], r1.w[BID_LOW_128W], r2.w[BID_HIGH_128W], r2.w[BID_LOW_128W]); |
| 518 |
return 1; |
| 519 |
} |
| 520 |
|
| 521 |
*************** |
| 522 |
*** 751,757 **** |
| 523 |
//TODO HIGH part difference |
| 524 |
BIDECIMAL_CALL2_NORND (bid128_quiet_less, less, a, b); |
| 525 |
if (less) ulp *= -1.0; |
| 526 |
! //printf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 527 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 528 |
return 1; |
| 529 |
} |
| 530 |
--- 758,764 ---- |
| 531 |
//TODO HIGH part difference |
| 532 |
BIDECIMAL_CALL2_NORND (bid128_quiet_less, less, a, b); |
| 533 |
if (less) ulp *= -1.0; |
| 534 |
! //testlogprintf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 535 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 536 |
return 1; |
| 537 |
} |
| 538 |
*************** |
| 539 |
*** 808,822 **** |
| 540 |
} |
| 541 |
|
| 542 |
if (e1 != e2) { |
| 543 |
! printf("ERROR a, b "BID_FMT_LLX16" "BID_FMT_LLX16"\n", a, b); |
| 544 |
! printf("ERROR r1, r2 "BID_FMT_LLX16" "BID_FMT_LLX16"\n", r1, r2); |
| 545 |
return 1; |
| 546 |
} |
| 547 |
|
| 548 |
ulp = m1 > m2 ? m1 - m2 : m2 - m1; |
| 549 |
BIDECIMAL_CALL2_NORND (bid64_quiet_less, less, a, b); |
| 550 |
if (less) ulp *= -1.0; |
| 551 |
! //printf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 552 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 553 |
return 1; |
| 554 |
} |
| 555 |
--- 815,829 ---- |
| 556 |
} |
| 557 |
|
| 558 |
if (e1 != e2) { |
| 559 |
! testlogprintf("ERROR a, b "BID_FMT_LLX16" "BID_FMT_LLX16"\n", a, b); |
| 560 |
! testlogprintf("ERROR r1, r2 "BID_FMT_LLX16" "BID_FMT_LLX16"\n", r1, r2); |
| 561 |
return 1; |
| 562 |
} |
| 563 |
|
| 564 |
ulp = m1 > m2 ? m1 - m2 : m2 - m1; |
| 565 |
BIDECIMAL_CALL2_NORND (bid64_quiet_less, less, a, b); |
| 566 |
if (less) ulp *= -1.0; |
| 567 |
! //testlogprintf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 568 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 569 |
return 1; |
| 570 |
} |
| 571 |
*************** |
| 572 |
*** 876,890 **** |
| 573 |
} |
| 574 |
|
| 575 |
if (e1 != e2) { |
| 576 |
! printf("ERROR a, b %08x %08x\n", a32, b32); |
| 577 |
! printf("ERROR r1, r2 %08x %08x\n", r1, r2); |
| 578 |
return 1; |
| 579 |
} |
| 580 |
|
| 581 |
ulp = m1 > m2 ? m1 - m2 : m2 - m1; |
| 582 |
BIDECIMAL_CALL2_NORND (bid32_quiet_less, less, a32, b32); |
| 583 |
if (less) ulp *= -1.0; |
| 584 |
! //printf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 585 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 586 |
return 1; |
| 587 |
} |
| 588 |
--- 883,897 ---- |
| 589 |
} |
| 590 |
|
| 591 |
if (e1 != e2) { |
| 592 |
! testlogprintf("ERROR a, b %08x %08x\n", a32, b32); |
| 593 |
! testlogprintf("ERROR r1, r2 %08x %08x\n", r1, r2); |
| 594 |
return 1; |
| 595 |
} |
| 596 |
|
| 597 |
ulp = m1 > m2 ? m1 - m2 : m2 - m1; |
| 598 |
BIDECIMAL_CALL2_NORND (bid32_quiet_less, less, a32, b32); |
| 599 |
if (less) ulp *= -1.0; |
| 600 |
! //testlogprintf("ulp %f +add %f max %f\n", ulp, ulp+ulp_add, mre_max[rnd_mode]); |
| 601 |
if (fabs(ulp+ulp_add) > mre_max[rnd_mode]) { |
| 602 |
return 1; |
| 603 |
} |
| 604 |
*************** |
| 605 |
*** 960,966 **** |
| 606 |
case OP_NONE: |
| 607 |
break; |
| 608 |
default: |
| 609 |
! printf ("Error: getops unexpected operand 1 type, %d\n", op1type); |
| 610 |
} |
| 611 |
|
| 612 |
switch (op2type) { |
| 613 |
--- 967,973 ---- |
| 614 |
case OP_NONE: |
| 615 |
break; |
| 616 |
default: |
| 617 |
! testlogprintf ("Error: getops unexpected operand 1 type, %d\n", op1type); |
| 618 |
} |
| 619 |
|
| 620 |
switch (op2type) { |
| 621 |
*************** |
| 622 |
*** 993,999 **** |
| 623 |
case OP_NONE: |
| 624 |
break; |
| 625 |
default: |
| 626 |
! printf ("Error: getops unexpected operand 2 type, %d\n", op2type); |
| 627 |
} |
| 628 |
|
| 629 |
switch (op3type) { |
| 630 |
--- 1000,1006 ---- |
| 631 |
case OP_NONE: |
| 632 |
break; |
| 633 |
default: |
| 634 |
! testlogprintf ("Error: getops unexpected operand 2 type, %d\n", op2type); |
| 635 |
} |
| 636 |
|
| 637 |
switch (op3type) { |
| 638 |
*************** |
| 639 |
*** 1012,1019 **** |
| 640 |
case OP_NONE: |
| 641 |
break; |
| 642 |
default: |
| 643 |
! printf ("Error: getops unexpected operand 3 type, %d\n", op3type); |
| 644 |
! exit (-1); |
| 645 |
} |
| 646 |
rnd = rnd_mode = save_rnd; |
| 647 |
|
| 648 |
--- 1019,1026 ---- |
| 649 |
case OP_NONE: |
| 650 |
break; |
| 651 |
default: |
| 652 |
! testlogprintf ("Error: getops unexpected operand 3 type, %d\n", op3type); |
| 653 |
! longjmp (env, -1); |
| 654 |
} |
| 655 |
rnd = rnd_mode = save_rnd; |
| 656 |
|
| 657 |
*************** |
| 658 |
*** 1100,1106 **** |
| 659 |
case OP_NONE: |
| 660 |
break; |
| 661 |
default: |
| 662 |
! printf ("Error: get_test unexpected result type, %d\n", restype); |
| 663 |
} |
| 664 |
} |
| 665 |
|
| 666 |
--- 1107,1113 ---- |
| 667 |
case OP_NONE: |
| 668 |
break; |
| 669 |
default: |
| 670 |
! testlogprintf ("Error: get_test unexpected result type, %d\n", restype); |
| 671 |
} |
| 672 |
} |
| 673 |
|
| 674 |
*************** |
| 675 |
*** 1111,1196 **** |
| 676 |
|
| 677 |
if (answer_opt) { |
| 678 |
if (*op3) |
| 679 |
! printf ("test%d %s %s %s %s ", tests, func, op1, op2, op3); |
| 680 |
else if (*op2) |
| 681 |
! printf ("test%d %s %s %s ", tests, func, op1, op2); |
| 682 |
else |
| 683 |
! printf ("test%d %s %s ", tests, func, op1); |
| 684 |
switch (restype) { |
| 685 |
|
| 686 |
case OP_STRING: |
| 687 |
! printf("STRING result is not implemented\n"); |
| 688 |
break; |
| 689 |
case OP_DEC128: |
| 690 |
case OP_DPD128: |
| 691 |
! printf ("[" BID_FMT_LLX16 "" BID_FMT_LLX16 "] %02x\n", Q.w[BID_HIGH_128W], |
| 692 |
Q.w[BID_LOW_128W], *pfpsf); |
| 693 |
break; |
| 694 |
|
| 695 |
case OP_DEC64: |
| 696 |
case OP_DPD64: |
| 697 |
! printf ("[" BID_FMT_LLX16 "] %02x\n", Q64, *pfpsf); |
| 698 |
break; |
| 699 |
|
| 700 |
case OP_DEC32: |
| 701 |
case OP_DPD32: |
| 702 |
! printf ("[" BID_FMT_X8 "] %02x\n", Q32, *pfpsf); |
| 703 |
break; |
| 704 |
|
| 705 |
case OP_INT8: |
| 706 |
case OP_INT16: |
| 707 |
case OP_INT32: |
| 708 |
! printf ("%d %02x\n", i2, *pfpsf); |
| 709 |
break; |
| 710 |
|
| 711 |
case OP_BID_UINT8: |
| 712 |
case OP_BID_UINT16: |
| 713 |
case OP_BID_UINT32: |
| 714 |
! printf ("%u %02x\n", i2, *pfpsf); |
| 715 |
break; |
| 716 |
|
| 717 |
case OP_INT64: |
| 718 |
! printf (BID_FMT_LLD16 " %02x\n", Qi64, *pfpsf); |
| 719 |
break; |
| 720 |
|
| 721 |
case OP_LINT: |
| 722 |
if (li_size_run == 64) |
| 723 |
! printf (BID_FMT_LLD16 " %02x\n", *(BID_SINT64*)&li2, *pfpsf); |
| 724 |
else |
| 725 |
! printf ("%d %02x\n", *(BID_SINT32*)&li2, *pfpsf); |
| 726 |
break; |
| 727 |
|
| 728 |
case OP_BID_UINT64: |
| 729 |
! printf (BID_FMT_LLU16 " %02x\n", Qi64, *pfpsf); |
| 730 |
break; |
| 731 |
|
| 732 |
case OP_BIN128: |
| 733 |
! printf ("[" BID_FMT_LLX16 " " BID_FMT_LLX16 "] %02x\n", |
| 734 |
*((BID_UINT64 *) & Rquad + BID_HIGH_128W), |
| 735 |
*((BID_UINT64 *) & Rquad + BID_LOW_128W), *pfpsf); |
| 736 |
break; |
| 737 |
|
| 738 |
case OP_BIN80: |
| 739 |
#if BID_BIG_ENDIAN |
| 740 |
! printf ("[" BID_FMT_LLX16 "" BID_FMT_X4 "] %02x\n", *((BID_UINT64 *) & Rldbl), |
| 741 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, *pfpsf); |
| 742 |
#else |
| 743 |
! printf ("[" BID_FMT_X4 "" BID_FMT_LLX16 "] %02x\n", |
| 744 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 745 |
*((BID_UINT64 *) & Rldbl), *pfpsf); |
| 746 |
#endif |
| 747 |
break; |
| 748 |
|
| 749 |
case OP_BIN64: |
| 750 |
! printf ("[" BID_FMT_LLX16 "] %02x\n", *((BID_UINT64 *) & Rdbl), *pfpsf); |
| 751 |
break; |
| 752 |
|
| 753 |
case OP_BIN32: |
| 754 |
! printf ("[" BID_FMT_X8 "] %02x\n", *((BID_UINT32 *) & Rflt), *pfpsf); |
| 755 |
break; |
| 756 |
|
| 757 |
default: |
| 758 |
! printf ("print_mismatch: unknown result type %d\n", restype); |
| 759 |
} |
| 760 |
return; |
| 761 |
} |
| 762 |
--- 1118,1203 ---- |
| 763 |
|
| 764 |
if (answer_opt) { |
| 765 |
if (*op3) |
| 766 |
! testlogprintf ("test%d %s %s %s %s ", tests, func, op1, op2, op3); |
| 767 |
else if (*op2) |
| 768 |
! testlogprintf ("test%d %s %s %s ", tests, func, op1, op2); |
| 769 |
else |
| 770 |
! testlogprintf ("test%d %s %s ", tests, func, op1); |
| 771 |
switch (restype) { |
| 772 |
|
| 773 |
case OP_STRING: |
| 774 |
! testlogprintf("STRING result is not implemented\n"); |
| 775 |
break; |
| 776 |
case OP_DEC128: |
| 777 |
case OP_DPD128: |
| 778 |
! testlogprintf ("[" BID_FMT_LLX16 "" BID_FMT_LLX16 "] %02x\n", Q.w[BID_HIGH_128W], |
| 779 |
Q.w[BID_LOW_128W], *pfpsf); |
| 780 |
break; |
| 781 |
|
| 782 |
case OP_DEC64: |
| 783 |
case OP_DPD64: |
| 784 |
! testlogprintf ("[" BID_FMT_LLX16 "] %02x\n", Q64, *pfpsf); |
| 785 |
break; |
| 786 |
|
| 787 |
case OP_DEC32: |
| 788 |
case OP_DPD32: |
| 789 |
! testlogprintf ("[" BID_FMT_X8 "] %02x\n", Q32, *pfpsf); |
| 790 |
break; |
| 791 |
|
| 792 |
case OP_INT8: |
| 793 |
case OP_INT16: |
| 794 |
case OP_INT32: |
| 795 |
! testlogprintf ("%d %02x\n", i2, *pfpsf); |
| 796 |
break; |
| 797 |
|
| 798 |
case OP_BID_UINT8: |
| 799 |
case OP_BID_UINT16: |
| 800 |
case OP_BID_UINT32: |
| 801 |
! testlogprintf ("%u %02x\n", i2, *pfpsf); |
| 802 |
break; |
| 803 |
|
| 804 |
case OP_INT64: |
| 805 |
! testlogprintf (BID_FMT_LLD16 " %02x\n", Qi64, *pfpsf); |
| 806 |
break; |
| 807 |
|
| 808 |
case OP_LINT: |
| 809 |
if (li_size_run == 64) |
| 810 |
! testlogprintf (BID_FMT_LLD16 " %02x\n", *(BID_SINT64*)&li2, *pfpsf); |
| 811 |
else |
| 812 |
! testlogprintf ("%d %02x\n", *(BID_SINT32*)&li2, *pfpsf); |
| 813 |
break; |
| 814 |
|
| 815 |
case OP_BID_UINT64: |
| 816 |
! testlogprintf (BID_FMT_LLU16 " %02x\n", Qi64, *pfpsf); |
| 817 |
break; |
| 818 |
|
| 819 |
case OP_BIN128: |
| 820 |
! testlogprintf ("[" BID_FMT_LLX16 " " BID_FMT_LLX16 "] %02x\n", |
| 821 |
*((BID_UINT64 *) & Rquad + BID_HIGH_128W), |
| 822 |
*((BID_UINT64 *) & Rquad + BID_LOW_128W), *pfpsf); |
| 823 |
break; |
| 824 |
|
| 825 |
case OP_BIN80: |
| 826 |
#if BID_BIG_ENDIAN |
| 827 |
! testlogprintf ("[" BID_FMT_LLX16 "" BID_FMT_X4 "] %02x\n", *((BID_UINT64 *) & Rldbl), |
| 828 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, *pfpsf); |
| 829 |
#else |
| 830 |
! testlogprintf ("[" BID_FMT_X4 "" BID_FMT_LLX16 "] %02x\n", |
| 831 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 832 |
*((BID_UINT64 *) & Rldbl), *pfpsf); |
| 833 |
#endif |
| 834 |
break; |
| 835 |
|
| 836 |
case OP_BIN64: |
| 837 |
! testlogprintf ("[" BID_FMT_LLX16 "] %02x\n", *((BID_UINT64 *) & Rdbl), *pfpsf); |
| 838 |
break; |
| 839 |
|
| 840 |
case OP_BIN32: |
| 841 |
! testlogprintf ("[" BID_FMT_X8 "] %02x\n", *((BID_UINT32 *) & Rflt), *pfpsf); |
| 842 |
break; |
| 843 |
|
| 844 |
default: |
| 845 |
! testlogprintf ("print_mismatch: unknown result type %d\n", restype); |
| 846 |
} |
| 847 |
return; |
| 848 |
} |
| 849 |
*************** |
| 850 |
*** 1199,1210 **** |
| 851 |
switch (restype) { |
| 852 |
case OP_DEC128: |
| 853 |
case OP_DPD128: |
| 854 |
! printf ("// BID result: " BID_FMT_LLX16 "" BID_FMT_LLX16 |
| 855 |
", Expected results: " BID_FMT_LLX16 "" BID_FMT_LLX16 "\n", |
| 856 |
Q.w[BID_HIGH_128W], Q.w[BID_LOW_128W], R.w[BID_HIGH_128W], |
| 857 |
R.w[BID_LOW_128W]); |
| 858 |
if (!strcmp(func, "bid128_modf")) { |
| 859 |
! printf ("// BID second result: " BID_FMT_LLX16 "" BID_FMT_LLX16 |
| 860 |
", Expected results: " BID_FMT_LLX16 "" BID_FMT_LLX16 "\n", |
| 861 |
B.w[BID_HIGH_128W], B.w[BID_LOW_128W], R_1.w[BID_HIGH_128W], |
| 862 |
R_1.w[BID_LOW_128W]); |
| 863 |
--- 1206,1217 ---- |
| 864 |
switch (restype) { |
| 865 |
case OP_DEC128: |
| 866 |
case OP_DPD128: |
| 867 |
! testlogprintf ("// BID result: " BID_FMT_LLX16 "" BID_FMT_LLX16 |
| 868 |
", Expected results: " BID_FMT_LLX16 "" BID_FMT_LLX16 "\n", |
| 869 |
Q.w[BID_HIGH_128W], Q.w[BID_LOW_128W], R.w[BID_HIGH_128W], |
| 870 |
R.w[BID_LOW_128W]); |
| 871 |
if (!strcmp(func, "bid128_modf")) { |
| 872 |
! testlogprintf ("// BID second result: " BID_FMT_LLX16 "" BID_FMT_LLX16 |
| 873 |
", Expected results: " BID_FMT_LLX16 "" BID_FMT_LLX16 "\n", |
| 874 |
B.w[BID_HIGH_128W], B.w[BID_LOW_128W], R_1.w[BID_HIGH_128W], |
| 875 |
R_1.w[BID_LOW_128W]); |
| 876 |
*************** |
| 877 |
*** 1212,1260 **** |
| 878 |
break; |
| 879 |
case OP_DEC64: |
| 880 |
case OP_DPD64: |
| 881 |
! printf ("// BID result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 882 |
"\n", Q64, R64); |
| 883 |
if (!strcmp(func, "bid64_modf")) { |
| 884 |
! printf ("// BID second result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 885 |
"\n", B64, R64_1); |
| 886 |
} |
| 887 |
break; |
| 888 |
case OP_DEC32: |
| 889 |
case OP_DPD32: |
| 890 |
! printf ("// BID result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 891 |
Q32, R32); |
| 892 |
if (!strcmp(func, "bid32_modf")) { |
| 893 |
! printf ("// BID second result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 894 |
B32, R32_1); |
| 895 |
} |
| 896 |
break; |
| 897 |
case OP_INT8: |
| 898 |
case OP_INT16: |
| 899 |
case OP_INT32: |
| 900 |
! printf ("// BID result: %d, Expected result: %d\n", i2, i1); |
| 901 |
break; |
| 902 |
case OP_BID_UINT8: |
| 903 |
case OP_BID_UINT16: |
| 904 |
case OP_BID_UINT32: |
| 905 |
! printf ("// BID result: %u, Expected result: %u\n", i2, i1); |
| 906 |
break; |
| 907 |
case OP_INT64: |
| 908 |
! printf ("// BID result: " BID_FMT_LLD16 ", Expected result: " BID_FMT_LLD16 |
| 909 |
"\n", Qi64, qi64); |
| 910 |
break; |
| 911 |
case OP_LINT: |
| 912 |
if (li_size_run == 64) |
| 913 |
! printf ("// BID result: " BID_FMT_LLD16 ", Expected result: " BID_FMT_LLD16 |
| 914 |
"\n",*(BID_SINT64*)&li2, *(BID_SINT64*)&li1); |
| 915 |
else |
| 916 |
! printf ("// BID result: %d, Expected result: %d \n",*(BID_SINT32*)&li2, *(BID_SINT32*)&li1); |
| 917 |
break; |
| 918 |
case OP_BID_UINT64: |
| 919 |
! printf ("// BID result: " BID_FMT_LLU16 ", Expected result: " BID_FMT_LLU16 |
| 920 |
"\n", Qi64, qi64); |
| 921 |
break; |
| 922 |
case OP_BIN128: |
| 923 |
! printf ("// BID result: " BID_FMT_LLX16 " " BID_FMT_LLX16 |
| 924 |
", Expected result: " BID_FMT_LLX16 " " BID_FMT_LLX16 "\n", |
| 925 |
*((BID_UINT64 *) & Rquad + BID_HIGH_128W), |
| 926 |
*((BID_UINT64 *) & Rquad + BID_LOW_128W), |
| 927 |
--- 1219,1267 ---- |
| 928 |
break; |
| 929 |
case OP_DEC64: |
| 930 |
case OP_DPD64: |
| 931 |
! testlogprintf ("// BID result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 932 |
"\n", Q64, R64); |
| 933 |
if (!strcmp(func, "bid64_modf")) { |
| 934 |
! testlogprintf ("// BID second result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 935 |
"\n", B64, R64_1); |
| 936 |
} |
| 937 |
break; |
| 938 |
case OP_DEC32: |
| 939 |
case OP_DPD32: |
| 940 |
! testlogprintf ("// BID result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 941 |
Q32, R32); |
| 942 |
if (!strcmp(func, "bid32_modf")) { |
| 943 |
! testlogprintf ("// BID second result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 944 |
B32, R32_1); |
| 945 |
} |
| 946 |
break; |
| 947 |
case OP_INT8: |
| 948 |
case OP_INT16: |
| 949 |
case OP_INT32: |
| 950 |
! testlogprintf ("// BID result: %d, Expected result: %d\n", i2, i1); |
| 951 |
break; |
| 952 |
case OP_BID_UINT8: |
| 953 |
case OP_BID_UINT16: |
| 954 |
case OP_BID_UINT32: |
| 955 |
! testlogprintf ("// BID result: %u, Expected result: %u\n", i2, i1); |
| 956 |
break; |
| 957 |
case OP_INT64: |
| 958 |
! testlogprintf ("// BID result: " BID_FMT_LLD16 ", Expected result: " BID_FMT_LLD16 |
| 959 |
"\n", Qi64, qi64); |
| 960 |
break; |
| 961 |
case OP_LINT: |
| 962 |
if (li_size_run == 64) |
| 963 |
! testlogprintf ("// BID result: " BID_FMT_LLD16 ", Expected result: " BID_FMT_LLD16 |
| 964 |
"\n",*(BID_SINT64*)&li2, *(BID_SINT64*)&li1); |
| 965 |
else |
| 966 |
! testlogprintf ("// BID result: %d, Expected result: %d \n",*(BID_SINT32*)&li2, *(BID_SINT32*)&li1); |
| 967 |
break; |
| 968 |
case OP_BID_UINT64: |
| 969 |
! testlogprintf ("// BID result: " BID_FMT_LLU16 ", Expected result: " BID_FMT_LLU16 |
| 970 |
"\n", Qi64, qi64); |
| 971 |
break; |
| 972 |
case OP_BIN128: |
| 973 |
! testlogprintf ("// BID result: " BID_FMT_LLX16 " " BID_FMT_LLX16 |
| 974 |
", Expected result: " BID_FMT_LLX16 " " BID_FMT_LLX16 "\n", |
| 975 |
*((BID_UINT64 *) & Rquad + BID_HIGH_128W), |
| 976 |
*((BID_UINT64 *) & Rquad + BID_LOW_128W), |
| 977 |
*************** |
| 978 |
*** 1263,1275 **** |
| 979 |
break; |
| 980 |
case OP_BIN80: |
| 981 |
#if BID_BIG_ENDIAN |
| 982 |
! printf ("// BID result: " BID_FMT_LLX16 "" BID_FMT_X4 ", Expected result: " |
| 983 |
BID_FMT_LLX16 "" BID_FMT_X4 " \n", *((BID_UINT64 *) & Rldbl + 0), |
| 984 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 985 |
*((BID_UINT64 *) & Rtldbl + 0), |
| 986 |
((BID_UINT32) (*((BID_UINT64 *) & Rtldbl + 1))) & 0xffff); |
| 987 |
#else |
| 988 |
! printf ("// BID result: " BID_FMT_X4 "" BID_FMT_LLX16 ", Expected result: " |
| 989 |
BID_FMT_X4 "" BID_FMT_LLX16 " \n", |
| 990 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 991 |
*((BID_UINT64 *) & Rldbl + 0), |
| 992 |
--- 1270,1282 ---- |
| 993 |
break; |
| 994 |
case OP_BIN80: |
| 995 |
#if BID_BIG_ENDIAN |
| 996 |
! testlogprintf ("// BID result: " BID_FMT_LLX16 "" BID_FMT_X4 ", Expected result: " |
| 997 |
BID_FMT_LLX16 "" BID_FMT_X4 " \n", *((BID_UINT64 *) & Rldbl + 0), |
| 998 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 999 |
*((BID_UINT64 *) & Rtldbl + 0), |
| 1000 |
((BID_UINT32) (*((BID_UINT64 *) & Rtldbl + 1))) & 0xffff); |
| 1001 |
#else |
| 1002 |
! testlogprintf ("// BID result: " BID_FMT_X4 "" BID_FMT_LLX16 ", Expected result: " |
| 1003 |
BID_FMT_X4 "" BID_FMT_LLX16 " \n", |
| 1004 |
((BID_UINT32) (*((BID_UINT64 *) & Rldbl + 1))) & 0xffff, |
| 1005 |
*((BID_UINT64 *) & Rldbl + 0), |
| 1006 |
*************** |
| 1007 |
*** 1278,1321 **** |
| 1008 |
#endif |
| 1009 |
break; |
| 1010 |
case OP_BIN64: |
| 1011 |
! printf ("// BID result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 1012 |
"\n", *((BID_UINT64 *) & Rdbl), *((BID_UINT64 *) & Rtdbl)); |
| 1013 |
break; |
| 1014 |
case OP_BIN32: |
| 1015 |
! printf ("// BID result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 1016 |
*((BID_UINT32 *) & Rflt), *((BID_UINT32 *) & Rtflt)); |
| 1017 |
break; |
| 1018 |
default: |
| 1019 |
! printf ("print_mismatch: unknown result type %d\n", restype); |
| 1020 |
! exit (-1); |
| 1021 |
} |
| 1022 |
|
| 1023 |
if (!strcmp(func, "bid32_frexp") || !strcmp(func, "bid64_frexp") || !strcmp(func, "bid128_frexp") ) { |
| 1024 |
! printf ("// BID second result: %d, Expected result: %d\n", i2, i1); |
| 1025 |
} |
| 1026 |
|
| 1027 |
// Print statuses |
| 1028 |
! printf ("// BID status : %03x, Expected status: %03x (PUOZDI Bits)\n", |
| 1029 |
*pfpsf, expected_status); |
| 1030 |
|
| 1031 |
switch (restype) { |
| 1032 |
case OP_DEC128: |
| 1033 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str1, Q); |
| 1034 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, R); |
| 1035 |
! printf ("// Result BID128 String: %s\n", str1); |
| 1036 |
! printf ("// Expected BID128 String: %s\n", str2); |
| 1037 |
break; |
| 1038 |
case OP_DEC64: |
| 1039 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str1, Q64); |
| 1040 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str2, R64); |
| 1041 |
! printf ("// Result BID64 String: %s\n", str1); |
| 1042 |
! printf ("// Expected BID64 String: %s\n", str2); |
| 1043 |
break; |
| 1044 |
case OP_DEC32: |
| 1045 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str1, Q32); |
| 1046 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str2, R32); |
| 1047 |
! printf ("// Result BID32 String: %s\n", str1); |
| 1048 |
! printf ("// Expected BID32 String: %s\n", str2); |
| 1049 |
break; |
| 1050 |
case OP_DPD128: |
| 1051 |
{ |
| 1052 |
--- 1285,1328 ---- |
| 1053 |
#endif |
| 1054 |
break; |
| 1055 |
case OP_BIN64: |
| 1056 |
! testlogprintf ("// BID result: " BID_FMT_LLX16 ", Expected result: " BID_FMT_LLX16 |
| 1057 |
"\n", *((BID_UINT64 *) & Rdbl), *((BID_UINT64 *) & Rtdbl)); |
| 1058 |
break; |
| 1059 |
case OP_BIN32: |
| 1060 |
! testlogprintf ("// BID result: " BID_FMT_X8 ", Expected result: " BID_FMT_X8 "\n", |
| 1061 |
*((BID_UINT32 *) & Rflt), *((BID_UINT32 *) & Rtflt)); |
| 1062 |
break; |
| 1063 |
default: |
| 1064 |
! testlogprintf ("print_mismatch: unknown result type %d\n", restype); |
| 1065 |
! longjmp (env, -1); |
| 1066 |
} |
| 1067 |
|
| 1068 |
if (!strcmp(func, "bid32_frexp") || !strcmp(func, "bid64_frexp") || !strcmp(func, "bid128_frexp") ) { |
| 1069 |
! testlogprintf ("// BID second result: %d, Expected result: %d\n", i2, i1); |
| 1070 |
} |
| 1071 |
|
| 1072 |
// Print statuses |
| 1073 |
! testlogprintf ("// BID status : %03x, Expected status: %03x (PUOZDI Bits)\n", |
| 1074 |
*pfpsf, expected_status); |
| 1075 |
|
| 1076 |
switch (restype) { |
| 1077 |
case OP_DEC128: |
| 1078 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str1, Q); |
| 1079 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, R); |
| 1080 |
! testlogprintf ("// Result BID128 String: %s\n", str1); |
| 1081 |
! testlogprintf ("// Expected BID128 String: %s\n", str2); |
| 1082 |
break; |
| 1083 |
case OP_DEC64: |
| 1084 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str1, Q64); |
| 1085 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str2, R64); |
| 1086 |
! testlogprintf ("// Result BID64 String: %s\n", str1); |
| 1087 |
! testlogprintf ("// Expected BID64 String: %s\n", str2); |
| 1088 |
break; |
| 1089 |
case OP_DEC32: |
| 1090 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str1, Q32); |
| 1091 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str2, R32); |
| 1092 |
! testlogprintf ("// Result BID32 String: %s\n", str1); |
| 1093 |
! testlogprintf ("// Expected BID32 String: %s\n", str2); |
| 1094 |
break; |
| 1095 |
case OP_DPD128: |
| 1096 |
{ |
| 1097 |
*************** |
| 1098 |
*** 1324,1331 **** |
| 1099 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid128, Rbid, R); |
| 1100 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, Qbid); |
| 1101 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, Rbid); |
| 1102 |
! printf ("// Result BID128 String: %s\n", str1); |
| 1103 |
! printf ("// Expected BID128 String: %s\n", str2); |
| 1104 |
} |
| 1105 |
break; |
| 1106 |
case OP_DPD64: |
| 1107 |
--- 1331,1338 ---- |
| 1108 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid128, Rbid, R); |
| 1109 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, Qbid); |
| 1110 |
BIDECIMAL_CALL1_NORND_RESREF (bid128_to_string, str2, Rbid); |
| 1111 |
! testlogprintf ("// Result BID128 String: %s\n", str1); |
| 1112 |
! testlogprintf ("// Expected BID128 String: %s\n", str2); |
| 1113 |
} |
| 1114 |
break; |
| 1115 |
case OP_DPD64: |
| 1116 |
*************** |
| 1117 |
*** 1335,1342 **** |
| 1118 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid64, Rbid, R64); |
| 1119 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str1, Qbid); |
| 1120 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str2, Rbid); |
| 1121 |
! printf ("// Result BID64 String: %s\n", str1); |
| 1122 |
! printf ("// Expected BID64 String: %s\n", str2); |
| 1123 |
} |
| 1124 |
break; |
| 1125 |
case OP_DPD32: |
| 1126 |
--- 1342,1349 ---- |
| 1127 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid64, Rbid, R64); |
| 1128 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str1, Qbid); |
| 1129 |
BIDECIMAL_CALL1_NORND_RESREF (bid64_to_string, str2, Rbid); |
| 1130 |
! testlogprintf ("// Result BID64 String: %s\n", str1); |
| 1131 |
! testlogprintf ("// Expected BID64 String: %s\n", str2); |
| 1132 |
} |
| 1133 |
break; |
| 1134 |
case OP_DPD32: |
| 1135 |
*************** |
| 1136 |
*** 1346,1353 **** |
| 1137 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid32, Rbid, R32); |
| 1138 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str1, Qbid); |
| 1139 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str2, Rbid); |
| 1140 |
! printf ("// Result BID32 String: %s\n", str1); |
| 1141 |
! printf ("// Expected BID32 String: %s\n", str2); |
| 1142 |
} |
| 1143 |
break; |
| 1144 |
case OP_INT8: |
| 1145 |
--- 1353,1360 ---- |
| 1146 |
BIDECIMAL_CALL1_NORND_NOSTAT (bid_dpd_to_bid32, Rbid, R32); |
| 1147 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str1, Qbid); |
| 1148 |
BIDECIMAL_CALL1_NORND_RESREF (bid32_to_string, str2, Rbid); |
| 1149 |
! testlogprintf ("// Result BID32 String: %s\n", str1); |
| 1150 |
! testlogprintf ("// Expected BID32 String: %s\n", str2); |
| 1151 |
} |
| 1152 |
break; |
| 1153 |
case OP_INT8: |
| 1154 |
*************** |
| 1155 |
*** 1366,1404 **** |
| 1156 |
|
| 1157 |
strcpy (str1, "unavailable"); |
| 1158 |
strcpy (str2, "unavailable"); |
| 1159 |
! printf ("// BID128 quad res: %s\n", str1); |
| 1160 |
! printf ("// Expected quad res : %s\n", str2); |
| 1161 |
break; |
| 1162 |
case OP_BIN80: |
| 1163 |
sprintf (str1, "%.17le", (double) Rldbl); |
| 1164 |
sprintf (str2, "%.17le", (double) Rtldbl); |
| 1165 |
! printf ("// BID80 double res (cast to double): %s\n", str1); |
| 1166 |
! printf ("// Expected double res (cast to double): %s\n", str2); |
| 1167 |
break; |
| 1168 |
case OP_BIN64: |
| 1169 |
sprintf (str1, "%.17le", Rdbl); |
| 1170 |
sprintf (str2, "%.17le", Rtdbl); |
| 1171 |
! printf ("// BID64 double res: %s\n", str1); |
| 1172 |
! printf ("// Expected double res : %s\n", str2); |
| 1173 |
break; |
| 1174 |
case OP_BIN32: |
| 1175 |
sprintf (str1, "%.9e", Rflt); |
| 1176 |
sprintf (str2, "%.9e", Rtflt); |
| 1177 |
! printf ("// BID32 double res: %s\n", str1); |
| 1178 |
! printf ("// decimal32 double res : %s\n", str2); |
| 1179 |
break; |
| 1180 |
default: |
| 1181 |
! printf ("print_mismatch unknown result type %d\n", restype); |
| 1182 |
! exit (-1); |
| 1183 |
} |
| 1184 |
|
| 1185 |
! printf ("// Input operand strings: %s %s %s\n", istr1, istr2, istr3); |
| 1186 |
fail_res++; |
| 1187 |
sprintf (line, "%s %s %s %s\n", func, op1, op2, op3); |
| 1188 |
! printf ("// Ulp error: %e\n", ulp+ulp_add); |
| 1189 |
! printf ("// Full input string: %s\n", full_line); |
| 1190 |
! printf ("// Input string number: %d\n", line_counter); |
| 1191 |
! printf ("// FAILED(%s)\n\n", rounding); |
| 1192 |
} |
| 1193 |
|
| 1194 |
void |
| 1195 |
--- 1373,1411 ---- |
| 1196 |
|
| 1197 |
strcpy (str1, "unavailable"); |
| 1198 |
strcpy (str2, "unavailable"); |
| 1199 |
! testlogprintf ("// BID128 quad res: %s\n", str1); |
| 1200 |
! testlogprintf ("// Expected quad res : %s\n", str2); |
| 1201 |
break; |
| 1202 |
case OP_BIN80: |
| 1203 |
sprintf (str1, "%.17le", (double) Rldbl); |
| 1204 |
sprintf (str2, "%.17le", (double) Rtldbl); |
| 1205 |
! testlogprintf ("// BID80 double res (cast to double): %s\n", str1); |
| 1206 |
! testlogprintf ("// Expected double res (cast to double): %s\n", str2); |
| 1207 |
break; |
| 1208 |
case OP_BIN64: |
| 1209 |
sprintf (str1, "%.17le", Rdbl); |
| 1210 |
sprintf (str2, "%.17le", Rtdbl); |
| 1211 |
! testlogprintf ("// BID64 double res: %s\n", str1); |
| 1212 |
! testlogprintf ("// Expected double res : %s\n", str2); |
| 1213 |
break; |
| 1214 |
case OP_BIN32: |
| 1215 |
sprintf (str1, "%.9e", Rflt); |
| 1216 |
sprintf (str2, "%.9e", Rtflt); |
| 1217 |
! testlogprintf ("// BID32 double res: %s\n", str1); |
| 1218 |
! testlogprintf ("// decimal32 double res : %s\n", str2); |
| 1219 |
break; |
| 1220 |
default: |
| 1221 |
! testlogprintf ("print_mismatch unknown result type %d\n", restype); |
| 1222 |
! longjmp (env, -1); |
| 1223 |
} |
| 1224 |
|
| 1225 |
! testlogprintf ("// Input operand strings: %s %s %s\n", istr1, istr2, istr3); |
| 1226 |
fail_res++; |
| 1227 |
sprintf (line, "%s %s %s %s\n", func, op1, op2, op3); |
| 1228 |
! testlogprintf ("// Ulp error: %e\n", ulp+ulp_add); |
| 1229 |
! testlogprintf ("// Full input string: %s\n", full_line); |
| 1230 |
! testlogprintf ("// Input string number: %d\n", line_counter); |
| 1231 |
! testlogprintf ("// FAILED(%s)\n\n", rounding); |
| 1232 |
} |
| 1233 |
|
| 1234 |
void |
| 1235 |
*************** |
| 1236 |
*** 1406,1420 **** |
| 1237 |
char *p; |
| 1238 |
tests++; |
| 1239 |
|
| 1240 |
! //printf("frexp i1 i2 %d %d \n", i1, i2); |
| 1241 |
|
| 1242 |
! //printf("arg dbl %08X \n", *((int*)&Adbl+BID_HIGH_128W)); |
| 1243 |
if (p = strstr (func, "binary64_to")) { |
| 1244 |
! //printf("check fo binary snan\n"); |
| 1245 |
if (SNaN_passed_incorrectly64 && ((*((int*)&Adbl+BID_HIGH_128W) & 0x7ff80000) == 0x7ff00000) && |
| 1246 |
((*((int*)&Adbl+BID_HIGH_128W) & 0x0007ffff) || (*((int*)&Adbl+BID_LOW_128W) & 0xffffffff)) |
| 1247 |
) { |
| 1248 |
! //printf("set invalid for 64\n"); |
| 1249 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1250 |
} |
| 1251 |
} |
| 1252 |
--- 1413,1427 ---- |
| 1253 |
char *p; |
| 1254 |
tests++; |
| 1255 |
|
| 1256 |
! //testlogprintf("frexp i1 i2 %d %d \n", i1, i2); |
| 1257 |
|
| 1258 |
! //testlogprintf("arg dbl %08X \n", *((int*)&Adbl+BID_HIGH_128W)); |
| 1259 |
if (p = strstr (func, "binary64_to")) { |
| 1260 |
! //testlogprintf("check fo binary snan\n"); |
| 1261 |
if (SNaN_passed_incorrectly64 && ((*((int*)&Adbl+BID_HIGH_128W) & 0x7ff80000) == 0x7ff00000) && |
| 1262 |
((*((int*)&Adbl+BID_HIGH_128W) & 0x0007ffff) || (*((int*)&Adbl+BID_LOW_128W) & 0xffffffff)) |
| 1263 |
) { |
| 1264 |
! //testlogprintf("set invalid for 64\n"); |
| 1265 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1266 |
} |
| 1267 |
} |
| 1268 |
*************** |
| 1269 |
*** 1422,1438 **** |
| 1270 |
if (SNaN_passed_incorrectly32 && ((*((int*)&Aflt) & 0x7fc00000) == 0x7f800000) && |
| 1271 |
((*((int*)&Aflt) & 0x003fffff)) |
| 1272 |
) { |
| 1273 |
! //printf("set invalid for 32\n"); |
| 1274 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1275 |
} |
| 1276 |
} |
| 1277 |
if (p = strstr (func, "binary80_to")) { |
| 1278 |
! //printf("check fo binary snan\n"); |
| 1279 |
if (SNaN_passed_incorrectly80 && ((*((int*)&Aldbl+2) & 0x7fff) == 0x7fff) && |
| 1280 |
((*((int*)&Aldbl+BID_HIGH_128W) & 0xc0000000) == 0x80000000) && |
| 1281 |
((*((int*)&Aldbl+BID_HIGH_128W) & 0x7fffffff) || (*((int*)&Aldbl+BID_LOW_128W) & 0xffffffff)) |
| 1282 |
) { |
| 1283 |
! //printf("set invalid for 80\n"); |
| 1284 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1285 |
} |
| 1286 |
} |
| 1287 |
--- 1429,1445 ---- |
| 1288 |
if (SNaN_passed_incorrectly32 && ((*((int*)&Aflt) & 0x7fc00000) == 0x7f800000) && |
| 1289 |
((*((int*)&Aflt) & 0x003fffff)) |
| 1290 |
) { |
| 1291 |
! //testlogprintf("set invalid for 32\n"); |
| 1292 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1293 |
} |
| 1294 |
} |
| 1295 |
if (p = strstr (func, "binary80_to")) { |
| 1296 |
! //testlogprintf("check fo binary snan\n"); |
| 1297 |
if (SNaN_passed_incorrectly80 && ((*((int*)&Aldbl+2) & 0x7fff) == 0x7fff) && |
| 1298 |
((*((int*)&Aldbl+BID_HIGH_128W) & 0xc0000000) == 0x80000000) && |
| 1299 |
((*((int*)&Aldbl+BID_HIGH_128W) & 0x7fffffff) || (*((int*)&Aldbl+BID_LOW_128W) & 0xffffffff)) |
| 1300 |
) { |
| 1301 |
! //testlogprintf("set invalid for 80\n"); |
| 1302 |
*pfpsf |= BID_INVALID_EXCEPTION; |
| 1303 |
} |
| 1304 |
} |
| 1305 |
*************** |
| 1306 |
*** 1562,1571 **** |
| 1307 |
|| R.w[BID_HIGH_128W] != Q.w[BID_HIGH_128W]) |
| 1308 |
print_mismatch (cmp); |
| 1309 |
} else { |
| 1310 |
! printf |
| 1311 |
("Unknown combination of result type (%d) and compare type (%d)\n", |
| 1312 |
restype, cmp); |
| 1313 |
! // exit (-1); |
| 1314 |
} |
| 1315 |
} |
| 1316 |
|
| 1317 |
--- 1569,1578 ---- |
| 1318 |
|| R.w[BID_HIGH_128W] != Q.w[BID_HIGH_128W]) |
| 1319 |
print_mismatch (cmp); |
| 1320 |
} else { |
| 1321 |
! testlogprintf |
| 1322 |
("Unknown combination of result type (%d) and compare type (%d)\n", |
| 1323 |
restype, cmp); |
| 1324 |
! // longjmp (env, -1); |
| 1325 |
} |
| 1326 |
} |
| 1327 |
|
| 1328 |
*************** |
| 1329 |
*** 1590,1599 **** |
| 1330 |
while (*p && *++p != ' '); |
| 1331 |
if (*p == ' ') { |
| 1332 |
*p = 0; |
| 1333 |
! // printf("Found 1: %s\n", wp1[wp1n-1]); |
| 1334 |
continue; |
| 1335 |
} else { |
| 1336 |
! // printf("Found 1: %s\n", wp1[wp1n-1]); |
| 1337 |
break; |
| 1338 |
} |
| 1339 |
} |
| 1340 |
--- 1597,1606 ---- |
| 1341 |
while (*p && *++p != ' '); |
| 1342 |
if (*p == ' ') { |
| 1343 |
*p = 0; |
| 1344 |
! // testlogprintf("Found 1: %s\n", wp1[wp1n-1]); |
| 1345 |
continue; |
| 1346 |
} else { |
| 1347 |
! // testlogprintf("Found 1: %s\n", wp1[wp1n-1]); |
| 1348 |
break; |
| 1349 |
} |
| 1350 |
} |
| 1351 |
*************** |
| 1352 |
*** 1602,1611 **** |
| 1353 |
while (*p && *++p != ' '); |
| 1354 |
if (*p == ' ') { |
| 1355 |
*p = 0; |
| 1356 |
! // printf("Found 2: %s\n", wp2[wp2n-1]); |
| 1357 |
continue; |
| 1358 |
} else { |
| 1359 |
! // printf("Found 2: %s\n", wp2[wp2n-1]); |
| 1360 |
break; |
| 1361 |
} |
| 1362 |
} |
| 1363 |
--- 1609,1618 ---- |
| 1364 |
while (*p && *++p != ' '); |
| 1365 |
if (*p == ' ') { |
| 1366 |
*p = 0; |
| 1367 |
! // testlogprintf("Found 2: %s\n", wp2[wp2n-1]); |
| 1368 |
continue; |
| 1369 |
} else { |
| 1370 |
! // testlogprintf("Found 2: %s\n", wp2[wp2n-1]); |
| 1371 |
break; |
| 1372 |
} |
| 1373 |
} |
| 1374 |
*************** |
| 1375 |
*** 1621,1627 **** |
| 1376 |
(int (__cdecl *) (const void *, const void *)) st_compare); |
| 1377 |
#endif |
| 1378 |
for (i = 0; i < wp1n; i++) { |
| 1379 |
! // printf("Comparing %s and %s\n", wp1[i], wp2[i]); |
| 1380 |
if (strcmp (wp1[i], wp2[i])) |
| 1381 |
return 1; |
| 1382 |
} |
| 1383 |
--- 1628,1634 ---- |
| 1384 |
(int (__cdecl *) (const void *, const void *)) st_compare); |
| 1385 |
#endif |
| 1386 |
for (i = 0; i < wp1n; i++) { |
| 1387 |
! // testlogprintf("Comparing %s and %s\n", wp1[i], wp2[i]); |
| 1388 |
if (strcmp (wp1[i], wp2[i])) |
| 1389 |
return 1; |
| 1390 |
} |
| 1391 |
*************** |
| 1392 |
*** 1707,1718 **** |
| 1393 |
|
| 1394 |
|
| 1395 |
int |
| 1396 |
! main (int argc, char *argv[]) { |
| 1397 |
int ch, digit_optind = 0; |
| 1398 |
int skip_test; |
| 1399 |
char **arg; |
| 1400 |
char *end_of_args = (char*)-1; |
| 1401 |
|
| 1402 |
strcpy (rounding, "half_even"); |
| 1403 |
|
| 1404 |
if (sizeof(long int) == 8) { |
| 1405 |
--- 1714,1729 ---- |
| 1406 |
|
| 1407 |
|
| 1408 |
int |
| 1409 |
! readtest_main (int argc, char *argv[]) { |
| 1410 |
int ch, digit_optind = 0; |
| 1411 |
int skip_test; |
| 1412 |
char **arg; |
| 1413 |
char *end_of_args = (char*)-1; |
| 1414 |
|
| 1415 |
+ int retval = setjmp(env); |
| 1416 |
+ if (retval != 0) |
| 1417 |
+ return retval; |
| 1418 |
+ |
| 1419 |
strcpy (rounding, "half_even"); |
| 1420 |
|
| 1421 |
if (sizeof(long int) == 8) { |
| 1422 |
*************** |
| 1423 |
*** 1732,1739 **** |
| 1424 |
if (strcmp (*arg, "-ua") == 0) |
| 1425 |
underflow_after_opt = 1; |
| 1426 |
if (strcmp (*arg, "-h") == 0) { |
| 1427 |
! printf ("Usage: runtests [-d]\n"); |
| 1428 |
! exit (0); |
| 1429 |
} |
| 1430 |
if (strcmp (*arg, "-ulp") == 0) { |
| 1431 |
arg++; |
| 1432 |
--- 1743,1750 ---- |
| 1433 |
if (strcmp (*arg, "-ua") == 0) |
| 1434 |
underflow_after_opt = 1; |
| 1435 |
if (strcmp (*arg, "-h") == 0) { |
| 1436 |
! testlogprintf ("Usage: runtests [-d]\n"); |
| 1437 |
! return (0); |
| 1438 |
} |
| 1439 |
if (strcmp (*arg, "-ulp") == 0) { |
| 1440 |
arg++; |
| 1441 |
*************** |
| 1442 |
*** 1757,1765 **** |
| 1443 |
} |
| 1444 |
|
| 1445 |
if (underflow_before_opt && underflow_after_opt) { |
| 1446 |
! printf("Both underflow before and after rounding checking mode set, please specify just one.\n"); |
| 1447 |
! printf ("Usage: runtests [-d]\n"); |
| 1448 |
! exit (0); |
| 1449 |
} else if (!underflow_before_opt && !underflow_after_opt) underflow_before_opt = 1; |
| 1450 |
|
| 1451 |
rnd_mode = 0; |
| 1452 |
--- 1768,1776 ---- |
| 1453 |
} |
| 1454 |
|
| 1455 |
if (underflow_before_opt && underflow_after_opt) { |
| 1456 |
! testlogprintf("Both underflow before and after rounding checking mode set, please specify just one.\n"); |
| 1457 |
! testlogprintf ("Usage: runtests [-d]\n"); |
| 1458 |
! return (0); |
| 1459 |
} else if (!underflow_before_opt && !underflow_after_opt) underflow_before_opt = 1; |
| 1460 |
|
| 1461 |
rnd_mode = 0; |
| 1462 |
*************** |
| 1463 |
*** 1804,1818 **** |
| 1464 |
check_den_passing80(snan_check80); |
| 1465 |
feclearexcept (FE_ALL_EXCEPT); |
| 1466 |
#endif |
| 1467 |
! //printf("snan32 passed incorr %d\n", SNaN_passed_incorrectly32); |
| 1468 |
! //printf("snan64 passed incorr %d\n", SNaN_passed_incorrectly64); |
| 1469 |
! //printf("snan80 passed incorr %d\n", SNaN_passed_incorrectly80); |
| 1470 |
! //printf("den32 passed incorr %d\n", Den_passed_incorrectly32); |
| 1471 |
! //printf("den64 passed incorr %d\n", Den_passed_incorrectly64); |
| 1472 |
! //printf("den80 passed incorr %d\n", Den_passed_incorrectly80); |
| 1473 |
|
| 1474 |
line_counter=0; |
| 1475 |
! while (!feof (stdin)) { |
| 1476 |
int st; |
| 1477 |
|
| 1478 |
op1type = OP_NONE; |
| 1479 |
--- 1815,1829 ---- |
| 1480 |
check_den_passing80(snan_check80); |
| 1481 |
feclearexcept (FE_ALL_EXCEPT); |
| 1482 |
#endif |
| 1483 |
! //testlogprintf("snan32 passed incorr %d\n", SNaN_passed_incorrectly32); |
| 1484 |
! //testlogprintf("snan64 passed incorr %d\n", SNaN_passed_incorrectly64); |
| 1485 |
! //testlogprintf("snan80 passed incorr %d\n", SNaN_passed_incorrectly80); |
| 1486 |
! //testlogprintf("den32 passed incorr %d\n", Den_passed_incorrectly32); |
| 1487 |
! //testlogprintf("den64 passed incorr %d\n", Den_passed_incorrectly64); |
| 1488 |
! //testlogprintf("den80 passed incorr %d\n", Den_passed_incorrectly80); |
| 1489 |
|
| 1490 |
line_counter=0; |
| 1491 |
! while (!tests_eof()) { |
| 1492 |
int st; |
| 1493 |
|
| 1494 |
op1type = OP_NONE; |
| 1495 |
*************** |
| 1496 |
*** 1820,1833 **** |
| 1497 |
op3type = OP_NONE; |
| 1498 |
restype = OP_NONE; |
| 1499 |
|
| 1500 |
! fgets (line, 1023, stdin); |
| 1501 |
line_counter++; |
| 1502 |
strRemove0D0A(line); |
| 1503 |
strcpy(full_line, line); |
| 1504 |
! if (feof (stdin)) |
| 1505 |
break; |
| 1506 |
|
| 1507 |
! // printf("Read line: %s", line); |
| 1508 |
if (p = strstr (line, "--")) *p = 0; // Remove comment |
| 1509 |
strRemoveTrailingSpaces(line); |
| 1510 |
|
| 1511 |
--- 1831,1844 ---- |
| 1512 |
op3type = OP_NONE; |
| 1513 |
restype = OP_NONE; |
| 1514 |
|
| 1515 |
! tests_readline(line, 1023); |
| 1516 |
line_counter++; |
| 1517 |
strRemove0D0A(line); |
| 1518 |
strcpy(full_line, line); |
| 1519 |
! if (tests_eof()) |
| 1520 |
break; |
| 1521 |
|
| 1522 |
! // testlogprintf("Read line: %s", line); |
| 1523 |
if (p = strstr (line, "--")) *p = 0; // Remove comment |
| 1524 |
strRemoveTrailingSpaces(line); |
| 1525 |
|
| 1526 |
*************** |
| 1527 |
*** 1874,1880 **** |
| 1528 |
li_size_test=li_size_run; |
| 1529 |
} |
| 1530 |
|
| 1531 |
! //printf(); |
| 1532 |
if (end_of_args != (char*)-1) { |
| 1533 |
*end_of_args = 0; |
| 1534 |
strRemoveTrailingSpaces(line); |
| 1535 |
--- 1885,1891 ---- |
| 1536 |
li_size_test=li_size_run; |
| 1537 |
} |
| 1538 |
|
| 1539 |
! //testlogprintf(); |
| 1540 |
if (end_of_args != (char*)-1) { |
| 1541 |
*end_of_args = 0; |
| 1542 |
strRemoveTrailingSpaces(line); |
| 1543 |
*************** |
| 1544 |
*** 1884,1903 **** |
| 1545 |
args_set = 0; |
| 1546 |
if (sscanf (line, "%s %d %s %s %s %s %x", funcstr, &rnd_mode, |
| 1547 |
op1, op2, op3, res, &expected_status) == 7) { |
| 1548 |
! //printf("read8 %d\n", rnd_mode); |
| 1549 |
args_set = 1; |
| 1550 |
} |
| 1551 |
if (!args_set) { |
| 1552 |
if (sscanf (line, "%s %d %s %s %s %x", funcstr, &rnd_mode, |
| 1553 |
op1, op2, res, &expected_status) == 6) { |
| 1554 |
! //printf("read7 %d\n", rnd_mode); |
| 1555 |
args_set = 1; |
| 1556 |
} |
| 1557 |
} |
| 1558 |
if (!args_set) { |
| 1559 |
if (sscanf(line, "%s %d %s %s %x", funcstr, &rnd_mode, op1, |
| 1560 |
res, &expected_status) == 5) { |
| 1561 |
! //printf("read6 %d\n", rnd_mode); |
| 1562 |
args_set = 1; |
| 1563 |
} |
| 1564 |
} |
| 1565 |
--- 1895,1914 ---- |
| 1566 |
args_set = 0; |
| 1567 |
if (sscanf (line, "%s %d %s %s %s %s %x", funcstr, &rnd_mode, |
| 1568 |
op1, op2, op3, res, &expected_status) == 7) { |
| 1569 |
! //testlogprintf("read8 %d\n", rnd_mode); |
| 1570 |
args_set = 1; |
| 1571 |
} |
| 1572 |
if (!args_set) { |
| 1573 |
if (sscanf (line, "%s %d %s %s %s %x", funcstr, &rnd_mode, |
| 1574 |
op1, op2, res, &expected_status) == 6) { |
| 1575 |
! //testlogprintf("read7 %d\n", rnd_mode); |
| 1576 |
args_set = 1; |
| 1577 |
} |
| 1578 |
} |
| 1579 |
if (!args_set) { |
| 1580 |
if (sscanf(line, "%s %d %s %s %x", funcstr, &rnd_mode, op1, |
| 1581 |
res, &expected_status) == 5) { |
| 1582 |
! //testlogprintf("read6 %d\n", rnd_mode); |
| 1583 |
args_set = 1; |
| 1584 |
} |
| 1585 |
} |
| 1586 |
*************** |
| 1587 |
*** 1906,1912 **** |
| 1588 |
pollution_workaround = check_pollution_workaround(); |
| 1589 |
|
| 1590 |
|
| 1591 |
! //printf("str %s op1 %s, skip %d\n", line, op1, skip_test); |
| 1592 |
if (args_set && !skip_test) { |
| 1593 |
rnd = rnd_mode; |
| 1594 |
// set ulp thresholds for transcendentals |
| 1595 |
--- 1917,1923 ---- |
| 1596 |
pollution_workaround = check_pollution_workaround(); |
| 1597 |
|
| 1598 |
|
| 1599 |
! //testlogprintf("str %s op1 %s, skip %d\n", line, op1, skip_test); |
| 1600 |
if (args_set && !skip_test) { |
| 1601 |
rnd = rnd_mode; |
| 1602 |
// set ulp thresholds for transcendentals |
| 1603 |
*************** |
| 1604 |
*** 1938,1948 **** |
| 1605 |
#include "readtest.h" |
| 1606 |
|
| 1607 |
} else { |
| 1608 |
! if (!skip_test) printf ("SKIPPED (line %d): %s\n", line_counter,line); |
| 1609 |
} |
| 1610 |
} |
| 1611 |
|
| 1612 |
! printf ("Total tests: %d, failed result: %d, failed status: %d\n", |
| 1613 |
tests, fail_res, fail_status); |
| 1614 |
return 0; |
| 1615 |
|
| 1616 |
--- 1949,1959 ---- |
| 1617 |
#include "readtest.h" |
| 1618 |
|
| 1619 |
} else { |
| 1620 |
! if (!skip_test) testlogprintf ("SKIPPED (line %d): %s\n", line_counter,line); |
| 1621 |
} |
| 1622 |
} |
| 1623 |
|
| 1624 |
! testlogprintf ("Total tests: %d, failed result: %d, failed status: %d\n", |
| 1625 |
tests, fail_res, fail_status); |
| 1626 |
return 0; |
| 1627 |
|
| 1628 |
*************** |
| 1629 |
*** 1975,1981 **** |
| 1630 |
int check_restore_binary_status() |
| 1631 |
{ |
| 1632 |
char *p; |
| 1633 |
! //printf("snan arg, passed incor %d %d\n", arg64_snan, SNaN_passed_incorrectly64); |
| 1634 |
if (check_binary_flags_opt || debug_opt) { |
| 1635 |
#if !defined _MSC_VER && !defined __INTEL_COMPILER |
| 1636 |
fegetexceptflag(&test_binary_flags, FE_ALL_EXCEPT); |
| 1637 |
--- 1986,1992 ---- |
| 1638 |
int check_restore_binary_status() |
| 1639 |
{ |
| 1640 |
char *p; |
| 1641 |
! //testlogprintf("snan arg, passed incor %d %d\n", arg64_snan, SNaN_passed_incorrectly64); |
| 1642 |
if (check_binary_flags_opt || debug_opt) { |
| 1643 |
#if !defined _MSC_VER && !defined __INTEL_COMPILER |
| 1644 |
fegetexceptflag(&test_binary_flags, FE_ALL_EXCEPT); |
| 1645 |
*************** |
| 1646 |
*** 1996,2003 **** |
| 1647 |
saved_binary_flags |= (test_binary_flags & FE_UNNORMAL); |
| 1648 |
// !!!! Workaround, do not favor non-standard denormal flag for now |
| 1649 |
if (test_binary_flags != saved_binary_flags && !pollution_workaround ) { |
| 1650 |
! printf("// ERROR: BINARY Exception flags polluted!\n"); |
| 1651 |
! printf("// Saved value %X, value after BID call %X\n", *(int*)&saved_binary_flags, *(int*)&test_binary_flags ); |
| 1652 |
return 1; |
| 1653 |
} |
| 1654 |
#endif |
| 1655 |
--- 2007,2014 ---- |
| 1656 |
saved_binary_flags |= (test_binary_flags & FE_UNNORMAL); |
| 1657 |
// !!!! Workaround, do not favor non-standard denormal flag for now |
| 1658 |
if (test_binary_flags != saved_binary_flags && !pollution_workaround ) { |
| 1659 |
! testlogprintf("// ERROR: BINARY Exception flags polluted!\n"); |
| 1660 |
! testlogprintf("// Saved value %X, value after BID call %X\n", *(int*)&saved_binary_flags, *(int*)&test_binary_flags ); |
| 1661 |
return 1; |
| 1662 |
} |
| 1663 |
#endif |
| 1664 |
*************** |
| 1665 |
*** 2026,2028 **** |
| 1666 |
--- 2037,2040 ---- |
| 1667 |
|
| 1668 |
} |
| 1669 |
|
| 1670 |
+ #endif /* FREE42_FPTEST */ |
| 1671 |
*** orig/LIBRARY/src/bid128_hypot.c 2011-06-29 14:33:00.000000000 -0400 |
| 1672 |
--- LIBRARY/src/bid128_hypot.c 2021-03-05 16:07:08.000000000 -0500 |
| 1673 |
*************** |
| 1674 |
*** 126,132 **** |
| 1675 |
x.w[BID_HIGH_128W] &= 0x7fffffffffffffffull; |
| 1676 |
y.w[BID_HIGH_128W] &= 0x7fffffffffffffffull; |
| 1677 |
|
| 1678 |
! if(exponent_x - exponent_y >= 35) |
| 1679 |
{ |
| 1680 |
res.w[BID_HIGH_128W] = x.w[BID_HIGH_128W]; |
| 1681 |
res.w[BID_LOW_128W] = x.w[BID_LOW_128W]; |
| 1682 |
--- 126,132 ---- |
| 1683 |
x.w[BID_HIGH_128W] &= 0x7fffffffffffffffull; |
| 1684 |
y.w[BID_HIGH_128W] &= 0x7fffffffffffffffull; |
| 1685 |
|
| 1686 |
! if(exponent_x - exponent_y >= 69) |
| 1687 |
{ |
| 1688 |
res.w[BID_HIGH_128W] = x.w[BID_HIGH_128W]; |
| 1689 |
res.w[BID_LOW_128W] = x.w[BID_LOW_128W]; |