1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64-unknown-unknown -verify-machineinstrs -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=NO-FP16
3 # RUN: llc -mtriple aarch64-unknown-unknown -verify-machineinstrs -mattr=+fullfp16 -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=FP16
8 tracksRegLiveness: true
13 ; NO-FP16-LABEL: name: fadd
14 ; NO-FP16: liveins: $h0, $h1
15 ; NO-FP16-NEXT: {{ $}}
16 ; NO-FP16-NEXT: %x:_(s16) = COPY $h0
17 ; NO-FP16-NEXT: %y:_(s16) = COPY $h1
18 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
19 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
20 ; NO-FP16-NEXT: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[FPEXT]], [[FPEXT1]]
21 ; NO-FP16-NEXT: %op:_(s16) = G_FPTRUNC [[FADD]](s32)
22 ; NO-FP16-NEXT: $h0 = COPY %op(s16)
23 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
25 ; FP16-LABEL: name: fadd
26 ; FP16: liveins: $h0, $h1
28 ; FP16-NEXT: %x:_(s16) = COPY $h0
29 ; FP16-NEXT: %y:_(s16) = COPY $h1
30 ; FP16-NEXT: %op:_(s16) = G_FADD %x, %y
31 ; FP16-NEXT: $h0 = COPY %op(s16)
32 ; FP16-NEXT: RET_ReallyLR implicit $h0
35 %op:_(s16) = G_FADD %x, %y
37 RET_ReallyLR implicit $h0
42 tracksRegLiveness: true
47 ; NO-FP16-LABEL: name: fsub
48 ; NO-FP16: liveins: $h0, $h1
49 ; NO-FP16-NEXT: {{ $}}
50 ; NO-FP16-NEXT: %x:_(s16) = COPY $h0
51 ; NO-FP16-NEXT: %y:_(s16) = COPY $h1
52 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
53 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
54 ; NO-FP16-NEXT: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[FPEXT]], [[FPEXT1]]
55 ; NO-FP16-NEXT: %op:_(s16) = G_FPTRUNC [[FSUB]](s32)
56 ; NO-FP16-NEXT: $h0 = COPY %op(s16)
57 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
59 ; FP16-LABEL: name: fsub
60 ; FP16: liveins: $h0, $h1
62 ; FP16-NEXT: %x:_(s16) = COPY $h0
63 ; FP16-NEXT: %y:_(s16) = COPY $h1
64 ; FP16-NEXT: %op:_(s16) = G_FSUB %x, %y
65 ; FP16-NEXT: $h0 = COPY %op(s16)
66 ; FP16-NEXT: RET_ReallyLR implicit $h0
69 %op:_(s16) = G_FSUB %x, %y
71 RET_ReallyLR implicit $h0
76 tracksRegLiveness: true
81 ; NO-FP16-LABEL: name: fmul
82 ; NO-FP16: liveins: $h0, $h1
83 ; NO-FP16-NEXT: {{ $}}
84 ; NO-FP16-NEXT: %x:_(s16) = COPY $h0
85 ; NO-FP16-NEXT: %y:_(s16) = COPY $h1
86 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
87 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
88 ; NO-FP16-NEXT: [[FMUL:%[0-9]+]]:_(s32) = G_FMUL [[FPEXT]], [[FPEXT1]]
89 ; NO-FP16-NEXT: %op:_(s16) = G_FPTRUNC [[FMUL]](s32)
90 ; NO-FP16-NEXT: $h0 = COPY %op(s16)
91 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
93 ; FP16-LABEL: name: fmul
94 ; FP16: liveins: $h0, $h1
96 ; FP16-NEXT: %x:_(s16) = COPY $h0
97 ; FP16-NEXT: %y:_(s16) = COPY $h1
98 ; FP16-NEXT: %op:_(s16) = G_FMUL %x, %y
99 ; FP16-NEXT: $h0 = COPY %op(s16)
100 ; FP16-NEXT: RET_ReallyLR implicit $h0
103 %op:_(s16) = G_FMUL %x, %y
105 RET_ReallyLR implicit $h0
110 tracksRegLiveness: true
115 ; NO-FP16-LABEL: name: fdiv
116 ; NO-FP16: liveins: $h0, $h1
117 ; NO-FP16-NEXT: {{ $}}
118 ; NO-FP16-NEXT: %x:_(s16) = COPY $h0
119 ; NO-FP16-NEXT: %y:_(s16) = COPY $h1
120 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
121 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
122 ; NO-FP16-NEXT: [[FDIV:%[0-9]+]]:_(s32) = G_FDIV [[FPEXT]], [[FPEXT1]]
123 ; NO-FP16-NEXT: %op:_(s16) = G_FPTRUNC [[FDIV]](s32)
124 ; NO-FP16-NEXT: $h0 = COPY %op(s16)
125 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
127 ; FP16-LABEL: name: fdiv
128 ; FP16: liveins: $h0, $h1
130 ; FP16-NEXT: %x:_(s16) = COPY $h0
131 ; FP16-NEXT: %y:_(s16) = COPY $h1
132 ; FP16-NEXT: %op:_(s16) = G_FDIV %x, %y
133 ; FP16-NEXT: $h0 = COPY %op(s16)
134 ; FP16-NEXT: RET_ReallyLR implicit $h0
137 %op:_(s16) = G_FDIV %x, %y
139 RET_ReallyLR implicit $h0
144 tracksRegLiveness: true
149 ; NO-FP16-LABEL: name: fneg
150 ; NO-FP16: liveins: $h0
151 ; NO-FP16-NEXT: {{ $}}
152 ; NO-FP16-NEXT: %x:_(s16) = COPY $h0
153 ; NO-FP16-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %x(s16)
154 ; NO-FP16-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
155 ; NO-FP16-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[ANYEXT]], [[C]]
156 ; NO-FP16-NEXT: %op:_(s16) = G_TRUNC [[XOR]](s32)
157 ; NO-FP16-NEXT: $h0 = COPY %op(s16)
158 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
160 ; FP16-LABEL: name: fneg
163 ; FP16-NEXT: %x:_(s16) = COPY $h0
164 ; FP16-NEXT: %op:_(s16) = G_FNEG %x
165 ; FP16-NEXT: $h0 = COPY %op(s16)
166 ; FP16-NEXT: RET_ReallyLR implicit $h0
168 %op:_(s16) = G_FNEG %x
170 RET_ReallyLR implicit $h0