1 /* Test fisttpl and fisttpll instructions. */
8 struct { uint64_t sig
; uint16_t sign_exp
; } s
;
12 volatile union u ld_invalid_1
= { .s
= { 1, 1234 } };
19 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (0x1p
100L) : "st");
20 if (res_32
!= INT32_MIN
) {
21 printf("FAIL: fisttpl 0x1p100\n");
24 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (-0x1p
100L) : "st");
25 if (res_32
!= INT32_MIN
) {
26 printf("FAIL: fisttpl -0x1p100\n");
29 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (__builtin_infl()) :
31 if (res_32
!= INT32_MIN
) {
32 printf("FAIL: fisttpl inf\n");
35 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (-__builtin_infl()) :
37 if (res_32
!= INT32_MIN
) {
38 printf("FAIL: fisttpl -inf\n");
41 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (__builtin_nanl("")) :
43 if (res_32
!= INT32_MIN
) {
44 printf("FAIL: fisttpl nan\n");
47 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) :
48 "t" (-__builtin_nanl("")) : "st");
49 if (res_32
!= INT32_MIN
) {
50 printf("FAIL: fisttpl -nan\n");
53 __asm__
volatile ("fisttpl %0" : "=m" (res_32
) : "t" (ld_invalid_1
.ld
) :
55 if (res_32
!= INT32_MIN
) {
56 printf("FAIL: fisttpl invalid\n");
59 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) : "t" (0x1p
100L) : "st");
60 if (res_64
!= INT64_MIN
) {
61 printf("FAIL: fisttpll 0x1p100\n");
64 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) : "t" (-0x1p
100L) : "st");
65 if (res_64
!= INT64_MIN
) {
66 printf("FAIL: fisttpll -0x1p100\n");
69 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) : "t" (__builtin_infl()) :
71 if (res_64
!= INT64_MIN
) {
72 printf("FAIL: fisttpll inf\n");
75 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) : "t" (-__builtin_infl()) :
77 if (res_64
!= INT64_MIN
) {
78 printf("FAIL: fisttpll -inf\n");
81 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) :
82 "t" (__builtin_nanl("")) : "st");
83 if (res_64
!= INT64_MIN
) {
84 printf("FAIL: fisttpll nan\n");
87 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) :
88 "t" (-__builtin_nanl("")) : "st");
89 if (res_64
!= INT64_MIN
) {
90 printf("FAIL: fisttpll -nan\n");
93 __asm__
volatile ("fisttpll %0" : "=m" (res_64
) : "t" (ld_invalid_1
.ld
) :
95 if (res_64
!= INT64_MIN
) {
96 printf("FAIL: fisttpll invalid\n");