1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: frem_f32
10 ; CHECK: liveins: $x10, $x11
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
13 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
14 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
15 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
16 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
17 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &fmodf, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
18 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
19 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
20 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
21 ; CHECK-NEXT: PseudoRET implicit $x10
24 %2:_(s32) = G_FREM %0, %1
26 PseudoRET implicit $x10
33 liveins: $x10, $x11, $x12, $x13
35 ; CHECK-LABEL: name: frem_f64
36 ; CHECK: liveins: $x10, $x11, $x12, $x13
38 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
39 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
40 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12
41 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13
42 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
43 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
44 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
45 ; CHECK-NEXT: $x12 = COPY [[COPY2]](s32)
46 ; CHECK-NEXT: $x13 = COPY [[COPY3]](s32)
47 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &fmod, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11
48 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
49 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10
50 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11
51 ; CHECK-NEXT: $x10 = COPY [[COPY4]](s32)
52 ; CHECK-NEXT: $x11 = COPY [[COPY5]](s32)
53 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
56 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
59 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
60 %6:_(s64) = G_FREM %0, %1
61 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
64 PseudoRET implicit $x10, implicit $x11
72 ; CHECK-LABEL: name: frem_f16
73 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
74 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
75 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
76 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
77 ; CHECK-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC]](s16)
78 ; CHECK-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT [[TRUNC1]](s16)
79 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
80 ; CHECK-NEXT: $x10 = COPY [[FPEXT]](s32)
81 ; CHECK-NEXT: $x11 = COPY [[FPEXT1]](s32)
82 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &fmodf, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
83 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
84 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
85 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY2]](s32)
86 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
87 ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s32)
88 ; CHECK-NEXT: PseudoRET implicit $x10
91 %2:_(s16) = G_TRUNC %0(s32)
92 %3:_(s16) = G_TRUNC %1(s32)
93 %4:_(s16) = G_FREM %2, %3
94 %5:_(s32) = G_ANYEXT %4(s16)
96 PseudoRET implicit $x10
104 ; CHECK-LABEL: name: frem_v2f32
105 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $v8
106 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $v9
107 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
108 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
109 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
110 ; CHECK-NEXT: $x10 = COPY [[UV]](s32)
111 ; CHECK-NEXT: $x11 = COPY [[UV2]](s32)
112 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &fmodf, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
113 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
114 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
115 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
116 ; CHECK-NEXT: $x10 = COPY [[UV1]](s32)
117 ; CHECK-NEXT: $x11 = COPY [[UV3]](s32)
118 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &fmodf, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
119 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
120 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x10
121 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[COPY2]](s32), [[COPY3]](s32)
122 ; CHECK-NEXT: $v8 = COPY [[BUILD_VECTOR]](<2 x s32>)
123 ; CHECK-NEXT: PseudoRET implicit $v8
124 %0:_(<2 x s32>) = COPY $v8
125 %1:_(<2 x s32>) = COPY $v9
126 %2:_(<2 x s32>) = G_FREM %0, %1
127 $v8 = COPY %2(<2 x s32>)
128 PseudoRET implicit $v8