1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=FP16
3 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=NO-FP16
6 name: s16_legal_with_full_fp16
11 ; FP16-LABEL: name: s16_legal_with_full_fp16
12 ; FP16: %a:_(s16) = COPY $h0
13 ; FP16: %b:_(s16) = COPY $h1
14 ; FP16: %maxnum:_(s16) = G_FMAXNUM %a, %b
15 ; FP16: $h0 = COPY %maxnum(s16)
16 ; FP16: RET_ReallyLR implicit $h0
17 ; NO-FP16-LABEL: name: s16_legal_with_full_fp16
18 ; NO-FP16: %a:_(s16) = COPY $h0
19 ; NO-FP16: %b:_(s16) = COPY $h1
20 ; NO-FP16: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %a(s16)
21 ; NO-FP16: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %b(s16)
22 ; NO-FP16: [[FMAXNUM:%[0-9]+]]:_(s32) = G_FMAXNUM [[FPEXT]], [[FPEXT1]]
23 ; NO-FP16: %maxnum:_(s16) = G_FPTRUNC [[FMAXNUM]](s32)
24 ; NO-FP16: $h0 = COPY %maxnum(s16)
25 ; NO-FP16: RET_ReallyLR implicit $h0
28 %maxnum:_(s16) = G_FMAXNUM %a, %b
29 $h0 = COPY %maxnum(s16)
30 RET_ReallyLR implicit $h0
39 ; FP16-LABEL: name: s32_legal
40 ; FP16: %a:_(s32) = COPY $s0
41 ; FP16: %b:_(s32) = COPY $s1
42 ; FP16: %maxnum:_(s32) = G_FMAXNUM %a, %b
43 ; FP16: $s0 = COPY %maxnum(s32)
44 ; FP16: RET_ReallyLR implicit $s0
45 ; NO-FP16-LABEL: name: s32_legal
46 ; NO-FP16: %a:_(s32) = COPY $s0
47 ; NO-FP16: %b:_(s32) = COPY $s1
48 ; NO-FP16: %maxnum:_(s32) = G_FMAXNUM %a, %b
49 ; NO-FP16: $s0 = COPY %maxnum(s32)
50 ; NO-FP16: RET_ReallyLR implicit $s0
53 %maxnum:_(s32) = G_FMAXNUM %a, %b
54 $s0 = COPY %maxnum(s32)
55 RET_ReallyLR implicit $s0
64 ; FP16-LABEL: name: s64_legal
65 ; FP16: %a:_(s64) = COPY $d0
66 ; FP16: %b:_(s64) = COPY $d1
67 ; FP16: %maxnum:_(s64) = G_FMAXNUM %a, %b
68 ; FP16: $d0 = COPY %maxnum(s64)
69 ; FP16: RET_ReallyLR implicit $d0
70 ; NO-FP16-LABEL: name: s64_legal
71 ; NO-FP16: %a:_(s64) = COPY $d0
72 ; NO-FP16: %b:_(s64) = COPY $d1
73 ; NO-FP16: %maxnum:_(s64) = G_FMAXNUM %a, %b
74 ; NO-FP16: $d0 = COPY %maxnum(s64)
75 ; NO-FP16: RET_ReallyLR implicit $d0
78 %maxnum:_(s64) = G_FMAXNUM %a, %b
79 $d0 = COPY %maxnum(s64)
80 RET_ReallyLR implicit $d0
89 ; FP16-LABEL: name: s128_libcall
90 ; FP16: %a:_(s128) = COPY $q0
91 ; FP16: %b:_(s128) = COPY $q1
92 ; FP16: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
93 ; FP16: $q0 = COPY %a(s128)
94 ; FP16: $q1 = COPY %b(s128)
95 ; FP16: BL &fmaxl, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $q0, implicit $q1, implicit-def $q0
96 ; FP16: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
97 ; FP16: %maxnum:_(s128) = COPY $q0
98 ; FP16: $q0 = COPY %maxnum(s128)
99 ; FP16: RET_ReallyLR implicit $q0
100 ; NO-FP16-LABEL: name: s128_libcall
101 ; NO-FP16: %a:_(s128) = COPY $q0
102 ; NO-FP16: %b:_(s128) = COPY $q1
103 ; NO-FP16: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
104 ; NO-FP16: $q0 = COPY %a(s128)
105 ; NO-FP16: $q1 = COPY %b(s128)
106 ; NO-FP16: BL &fmaxl, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $q0, implicit $q1, implicit-def $q0
107 ; NO-FP16: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
108 ; NO-FP16: %maxnum:_(s128) = COPY $q0
109 ; NO-FP16: $q0 = COPY %maxnum(s128)
110 ; NO-FP16: RET_ReallyLR implicit $q0
111 %a:_(s128) = COPY $q0
112 %b:_(s128) = COPY $q1
113 %maxnum:_(s128) = G_FMAXNUM %a, %b
114 $q0 = COPY %maxnum(s128)
115 RET_ReallyLR implicit $q0