1 /* Test pseudo-denormal operations. */
7 struct { uint64_t sig
; uint16_t sign_exp
; } s
;
11 volatile union u ld_pseudo_m16382
= { .s
= { UINT64_C(1) << 63, 0 } };
13 volatile long double ld_res
;
19 ld_res
= ld_pseudo_m16382
.ld
+ ld_pseudo_m16382
.ld
;
20 if (ld_res
!= 0x1p
-16381L) {
21 printf("FAIL: pseudo-denormal add\n");
24 if (ld_pseudo_m16382
.ld
!= 0x1p
-16382L) {
25 printf("FAIL: pseudo-denormal compare\n");
28 /* Set round-upward. */
29 __asm__
volatile ("fnstcw %0" : "=m" (cw
));
30 cw
= (cw
& ~0xc00) | 0x800;
31 __asm__
volatile ("fldcw %0" : : "m" (cw
));
32 __asm__ ("frndint" : "=t" (ld_res
) : "0" (ld_pseudo_m16382
.ld
));
34 printf("FAIL: pseudo-denormal round-to-integer\n");