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: %x:_(s16) = COPY $h0
16 ; NO-FP16: %y:_(s16) = COPY $h1
17 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
18 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
19 ; NO-FP16: [[FADD:%[0-9]+]]:_(s32) = G_FADD [[FPEXT]], [[FPEXT1]]
20 ; NO-FP16: %op:_(s16) = G_FPTRUNC [[FADD]](s32)
21 ; NO-FP16: $h0 = COPY %op(s16)
22 ; NO-FP16: RET_ReallyLR implicit $h0
23 ; FP16-LABEL: name: fadd
24 ; FP16: liveins: $h0, $h1
25 ; FP16: %x:_(s16) = COPY $h0
26 ; FP16: %y:_(s16) = COPY $h1
27 ; FP16: %op:_(s16) = G_FADD %x, %y
28 ; FP16: $h0 = COPY %op(s16)
29 ; FP16: RET_ReallyLR implicit $h0
32 %op:_(s16) = G_FADD %x, %y
34 RET_ReallyLR implicit $h0
39 tracksRegLiveness: true
44 ; NO-FP16-LABEL: name: fsub
45 ; NO-FP16: liveins: $h0, $h1
46 ; NO-FP16: %x:_(s16) = COPY $h0
47 ; NO-FP16: %y:_(s16) = COPY $h1
48 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
49 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
50 ; NO-FP16: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[FPEXT]], [[FPEXT1]]
51 ; NO-FP16: %op:_(s16) = G_FPTRUNC [[FSUB]](s32)
52 ; NO-FP16: $h0 = COPY %op(s16)
53 ; NO-FP16: RET_ReallyLR implicit $h0
54 ; FP16-LABEL: name: fsub
55 ; FP16: liveins: $h0, $h1
56 ; FP16: %x:_(s16) = COPY $h0
57 ; FP16: %y:_(s16) = COPY $h1
58 ; FP16: %op:_(s16) = G_FSUB %x, %y
59 ; FP16: $h0 = COPY %op(s16)
60 ; FP16: RET_ReallyLR implicit $h0
63 %op:_(s16) = G_FSUB %x, %y
65 RET_ReallyLR implicit $h0
70 tracksRegLiveness: true
75 ; NO-FP16-LABEL: name: fmul
76 ; NO-FP16: liveins: $h0, $h1
77 ; NO-FP16: %x:_(s16) = COPY $h0
78 ; NO-FP16: %y:_(s16) = COPY $h1
79 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
80 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
81 ; NO-FP16: [[FMUL:%[0-9]+]]:_(s32) = G_FMUL [[FPEXT]], [[FPEXT1]]
82 ; NO-FP16: %op:_(s16) = G_FPTRUNC [[FMUL]](s32)
83 ; NO-FP16: $h0 = COPY %op(s16)
84 ; NO-FP16: RET_ReallyLR implicit $h0
85 ; FP16-LABEL: name: fmul
86 ; FP16: liveins: $h0, $h1
87 ; FP16: %x:_(s16) = COPY $h0
88 ; FP16: %y:_(s16) = COPY $h1
89 ; FP16: %op:_(s16) = G_FMUL %x, %y
90 ; FP16: $h0 = COPY %op(s16)
91 ; FP16: RET_ReallyLR implicit $h0
94 %op:_(s16) = G_FMUL %x, %y
96 RET_ReallyLR implicit $h0
101 tracksRegLiveness: true
106 ; NO-FP16-LABEL: name: fdiv
107 ; NO-FP16: liveins: $h0, $h1
108 ; NO-FP16: %x:_(s16) = COPY $h0
109 ; NO-FP16: %y:_(s16) = COPY $h1
110 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
111 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %y(s16)
112 ; NO-FP16: [[FDIV:%[0-9]+]]:_(s32) = G_FDIV [[FPEXT]], [[FPEXT1]]
113 ; NO-FP16: %op:_(s16) = G_FPTRUNC [[FDIV]](s32)
114 ; NO-FP16: $h0 = COPY %op(s16)
115 ; NO-FP16: RET_ReallyLR implicit $h0
116 ; FP16-LABEL: name: fdiv
117 ; FP16: liveins: $h0, $h1
118 ; FP16: %x:_(s16) = COPY $h0
119 ; FP16: %y:_(s16) = COPY $h1
120 ; FP16: %op:_(s16) = G_FDIV %x, %y
121 ; FP16: $h0 = COPY %op(s16)
122 ; FP16: RET_ReallyLR implicit $h0
125 %op:_(s16) = G_FDIV %x, %y
127 RET_ReallyLR implicit $h0
132 tracksRegLiveness: true
137 ; NO-FP16-LABEL: name: fneg
138 ; NO-FP16: liveins: $h0
139 ; NO-FP16: %x:_(s16) = COPY $h0
140 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %x(s16)
141 ; NO-FP16: [[FNEG:%[0-9]+]]:_(s32) = G_FNEG [[FPEXT]]
142 ; NO-FP16: %op:_(s16) = G_FPTRUNC [[FNEG]](s32)
143 ; NO-FP16: $h0 = COPY %op(s16)
144 ; NO-FP16: RET_ReallyLR implicit $h0
145 ; FP16-LABEL: name: fneg
147 ; FP16: %x:_(s16) = COPY $h0
148 ; FP16: %op:_(s16) = G_FNEG %x
149 ; FP16: $h0 = COPY %op(s16)
150 ; FP16: RET_ReallyLR implicit $h0
152 %op:_(s16) = G_FNEG %x
154 RET_ReallyLR implicit $h0