1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
# mach: aarch64
# Check the FP convert to int round toward zero instructions: fcvtszs32,
# fcvtszs, fcvtszd32, fcvtszd, fcvtzu.
# For 32-bit signed convert, test values -1.5, INT_MAX, and INT_MIN.
# For 64-bit signed convert, test values -1.5, LONG_MAX, and LONG_MIN.
# For 32-bit unsigned convert, test values 1.5, INT_MAX, and UINT_MAX.
# For 64-bit unsigned convert, test values 1.5, LONG_MAX, and ULONG_MAX.
.data
.align 4
fm1p5:
.word 3217031168
fimax:
.word 1325400064
fimin:
.word 3472883712
flmax:
.word 1593835520
flmin:
.word 3741319168
f1p5:
.word 1069547520
fuimax:
.word 1333788672
fulmax:
.word 1602224128
dm1p5:
.word 0
.word -1074266112
dimax:
.word 4290772992
.word 1105199103
dimin:
.word 0
.word -1042284544
dlmax:
.word 0
.word 1138753536
dlmin:
.word 0
.word -1008730112
d1p5:
.word 0
.word 1073217536
duimax:
.word 4292870144
.word 1106247679
dulmax:
.word 0
.word 1139802112
.include "testutils.inc"
start
adrp x0, fm1p5
ldr s0, [x0, #:lo12:fm1p5]
fcvtzs w1, s0
cmp w1, #-1
bne .Lfailure
adrp x0, fimax
ldr s0, [x0, #:lo12:fimax]
fcvtzs w1, s0
mov w2, #0x7fffffff
cmp w1, w2
bne .Lfailure
adrp x0, fimin
ldr s0, [x0, #:lo12:fimin]
fcvtzs w1, s0
mov w2, #0x80000000
cmp w1, w2
bne .Lfailure
adrp x0, fm1p5
ldr s0, [x0, #:lo12:fm1p5]
fcvtzs x1, s0
cmp x1, #-1
bne .Lfailure
adrp x0, flmax
ldr s0, [x0, #:lo12:flmax]
fcvtzs x1, s0
mov x2, #0x7fffffffffffffff
cmp x1, x2
bne .Lfailure
adrp x0, flmin
ldr s0, [x0, #:lo12:flmin]
fcvtzs x1, s0
mov x2, #0x8000000000000000
cmp x1, x2
bne .Lfailure
adrp x0, dm1p5
ldr d0, [x0, #:lo12:dm1p5]
fcvtzs w1, d0
cmp w1, #-1
bne .Lfailure
adrp x0, dimax
ldr d0, [x0, #:lo12:dimax]
fcvtzs w1, d0
mov w2, #0x7fffffff
cmp w1, w2
bne .Lfailure
adrp x0, dimin
ldr d0, [x0, #:lo12:dimin]
fcvtzs w1, d0
mov w2, #0x80000000
cmp w1, w2
bne .Lfailure
adrp x0, dm1p5
ldr d0, [x0, #:lo12:dm1p5]
fcvtzs x1, d0
cmp x1, #-1
bne .Lfailure
adrp x0, dlmax
ldr d0, [x0, #:lo12:dlmax]
fcvtzs x1, d0
mov x2, #0x7fffffffffffffff
cmp x1, x2
bne .Lfailure
adrp x0, dlmin
ldr d0, [x0, #:lo12:dlmin]
fcvtzs x1, d0
mov x2, #0x8000000000000000
cmp x1, x2
bne .Lfailure
adrp x0, f1p5
ldr s0, [x0, #:lo12:f1p5]
fcvtzu w1, s0
cmp w1, #1
bne .Lfailure
adrp x0, fimax
ldr s0, [x0, #:lo12:fimax]
fcvtzu w1, s0
mov w2, #0x80000000
cmp w1, w2
bne .Lfailure
adrp x0, fuimax
ldr s0, [x0, #:lo12:fuimax]
fcvtzu w1, s0
mov w2, #0xffffffff
cmp w1, w2
bne .Lfailure
adrp x0, f1p5
ldr s0, [x0, #:lo12:f1p5]
fcvtzu x1, s0
cmp x1, #1
bne .Lfailure
adrp x0, flmax
ldr s0, [x0, #:lo12:flmax]
fcvtzu x1, s0
mov x2, #0x8000000000000000
cmp x1, x2
bne .Lfailure
adrp x0, fulmax
ldr s0, [x0, #:lo12:fulmax]
fcvtzu x1, s0
mov x2, #0xffffffffffffffff
cmp x1, x2
bne .Lfailure
adrp x0, d1p5
ldr d0, [x0, #:lo12:d1p5]
fcvtzu w1, d0
cmp w1, #1
bne .Lfailure
adrp x0, dimax
ldr d0, [x0, #:lo12:dimax]
fcvtzu w1, d0
mov w2, #0x7fffffff
cmp w1, w2
bne .Lfailure
adrp x0, duimax
ldr d0, [x0, #:lo12:duimax]
fcvtzu w1, d0
mov w2, #0xffffffff
cmp w1, w2
bne .Lfailure
adrp x0, d1p5
ldr d0, [x0, #:lo12:d1p5]
fcvtzu x1, d0
cmp x1, #1
bne .Lfailure
adrp x0, dlmax
ldr d0, [x0, #:lo12:dlmax]
fcvtzu x1, d0
mov x2, #0x8000000000000000
cmp x1, x2
bne .Lfailure
adrp x0, dulmax
ldr d0, [x0, #:lo12:dulmax]
fcvtzu x1, d0
mov x2, #0xffffffffffffffff
cmp x1, x2
bne .Lfailure
pass
.Lfailure:
fail
|