1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -global-isel-abort=0 -verify-machineinstrs %s -o - | FileCheck %s
6 name: scalar_nofpexcept
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: scalar_nofpexcept
14 ; CHECK: %val:_(s16) = COPY $h0
15 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
16 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C]](s32)
17 ; CHECK: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %val(s16)
18 ; CHECK: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[FPTRUNC]](s16)
19 ; CHECK: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(uno), [[FPEXT]](s32), [[FPEXT1]]
20 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
21 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
22 ; CHECK: %ext:_(s32) = G_AND [[COPY]], [[C1]]
23 ; CHECK: $w0 = COPY %ext(s32)
24 ; CHECK: RET_ReallyLR implicit $w0
25 %val:_(s16) = COPY $h0
26 %isnan:_(s1) = nofpexcept G_ISNAN %val(s16)
27 %ext:_(s32) = G_ZEXT %isnan(s1)
29 RET_ReallyLR implicit $w0
33 name: vector_nofpexcept
34 tracksRegLiveness: true
39 ; CHECK-LABEL: name: vector_nofpexcept
41 ; CHECK: %val:_(<4 x s16>) = COPY $d0
42 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
43 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C]](s32)
44 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[FPTRUNC]](s16), [[FPTRUNC]](s16), [[FPTRUNC]](s16), [[FPTRUNC]](s16)
45 ; CHECK: [[FCMP:%[0-9]+]]:_(<4 x s16>) = G_FCMP floatpred(uno), %val(<4 x s16>), [[BUILD_VECTOR]]
46 ; CHECK: %ext:_(<4 x s16>) = COPY [[FCMP]](<4 x s16>)
47 ; CHECK: $d0 = COPY %ext(<4 x s16>)
48 ; CHECK: RET_ReallyLR implicit $d0
49 %val:_(<4 x s16>) = COPY $d0
50 %isnan:_(<4 x s1>) = nofpexcept G_ISNAN %val(<4 x s16>)
51 %ext:_(<4 x s16>) = G_ANYEXT %isnan(<4 x s1>)
52 $d0 = COPY %ext(<4 x s16>)
53 RET_ReallyLR implicit $d0
58 tracksRegLiveness: true
63 ; CHECK-LABEL: name: scalar_no_flags
65 ; CHECK: %val:_(s16) = COPY $h0
66 ; CHECK: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %val(s16)
67 ; CHECK: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[FPEXT]](s32)
68 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
69 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32767
70 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
71 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 31744
72 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
73 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY1]], 16
74 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[C1]](s32), [[SEXT_INREG]]
75 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
76 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
77 ; CHECK: %ext:_(s32) = G_AND [[COPY2]], [[C2]]
78 ; CHECK: $w0 = COPY %ext(s32)
79 ; CHECK: RET_ReallyLR implicit $w0
80 %val:_(s16) = COPY $h0
81 %isnan:_(s1) = G_ISNAN %val(s16)
82 %ext:_(s32) = G_ZEXT %isnan(s1)
84 RET_ReallyLR implicit $w0
89 tracksRegLiveness: true
94 ; CHECK-LABEL: name: vector_no_flags
96 ; CHECK: %val:_(<4 x s16>) = COPY $d0
97 ; CHECK: [[FPTOSI:%[0-9]+]]:_(<4 x s16>) = G_FPTOSI %val(<4 x s16>)
98 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 32767
99 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16)
100 ; CHECK: [[AND:%[0-9]+]]:_(<4 x s16>) = G_AND [[FPTOSI]], [[BUILD_VECTOR]]
101 ; CHECK: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 31744
102 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[C1]](s16), [[C1]](s16), [[C1]](s16), [[C1]](s16)
103 ; CHECK: [[ICMP:%[0-9]+]]:_(<4 x s16>) = G_ICMP intpred(slt), [[BUILD_VECTOR1]](<4 x s16>), [[AND]]
104 ; CHECK: %isnan:_(<4 x s1>) = G_TRUNC [[ICMP]](<4 x s16>)
105 ; CHECK: %ext:_(<4 x s16>) = G_ANYEXT %isnan(<4 x s1>)
106 ; CHECK: $d0 = COPY %ext(<4 x s16>)
107 ; CHECK: RET_ReallyLR implicit $d0
108 %val:_(<4 x s16>) = COPY $d0
109 %isnan:_(<4 x s1>) = G_ISNAN %val(<4 x s16>)
110 %ext:_(<4 x s16>) = G_ANYEXT %isnan(<4 x s1>)
111 $d0 = COPY %ext(<4 x s16>)
112 RET_ReallyLR implicit $d0