[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AArch64 / GlobalISel / legalize-rem.mir
blobb1348e51dc9b0310ed6f64e83b9746cd1fa22be8
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=aarch64-- -run-pass=legalizer %s -o - | FileCheck %s
3 ---
4 name:            test_urem_64
5 body:             |
6   bb.0.entry:
7     ; CHECK-LABEL: name: test_urem_64
8     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
9     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
10     ; CHECK: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV [[COPY]], [[COPY1]]
11     ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[UDIV]], [[COPY1]]
12     ; CHECK: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[MUL]]
13     ; CHECK: $x0 = COPY [[SUB]](s64)
14     %0:_(s64) = COPY $x0
15     %1:_(s64) = COPY $x1
16     %2:_(s64) = G_UREM %0, %1
17     $x0 = COPY %2(s64)
19 ...
20 ---
21 name:            test_srem_32
22 body:             |
23   bb.0.entry:
24     ; CHECK-LABEL: name: test_srem_32
25     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
26     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
27     ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
28     ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
29     ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[TRUNC]], [[TRUNC1]]
30     ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SDIV]], [[TRUNC1]]
31     ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[TRUNC]], [[MUL]]
32     ; CHECK: $w0 = COPY [[SUB]](s32)
33     %0:_(s64) = COPY $x0
34     %1:_(s64) = COPY $x1
35     %2:_(s32) = G_TRUNC %0(s64)
36     %3:_(s32) = G_TRUNC %1(s64)
37     %4:_(s32) = G_SREM %2, %3
38     $w0 = COPY %4(s32)
40 ...
41 ---
42 name:            test_srem_8
43 body:             |
44   bb.0.entry:
45     ; CHECK-LABEL: name: test_srem_8
46     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
47     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
48     ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
49     ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
50     ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
51     ; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
52     ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[SEXT_INREG]], [[SEXT_INREG1]]
53     ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SDIV]](s32)
54     ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
55     ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY2]], [[TRUNC2]]
56     ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
57     ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[MUL]](s32)
58     ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[TRUNC3]], [[COPY3]]
59     ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
60     ; CHECK: $w0 = COPY [[COPY4]](s32)
61     %0:_(s64) = COPY $x0
62     %1:_(s64) = COPY $x1
63     %2:_(s8) = G_TRUNC %0(s64)
64     %3:_(s8) = G_TRUNC %1(s64)
65     %4:_(s8) = G_SREM %2, %3
66     %5:_(s32) = G_ANYEXT %4(s8)
67     $w0 = COPY %5(s32)
69 ...
70 ---
71 name:            test_frem
72 body:             |
73   bb.0.entry:
74     ; CHECK-LABEL: name: test_frem
75     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
76     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
77     ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
78     ; CHECK: $d0 = COPY [[COPY]](s64)
79     ; CHECK: $d1 = COPY [[COPY1]](s64)
80     ; CHECK: BL &fmod, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $d0, implicit $d1, implicit-def $d0
81     ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $d0
82     ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
83     ; CHECK: $x0 = COPY [[COPY2]](s64)
84     ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
85     ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
86     ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
87     ; CHECK: $s0 = COPY [[TRUNC]](s32)
88     ; CHECK: $s1 = COPY [[TRUNC1]](s32)
89     ; CHECK: BL &fmodf, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $s0, implicit $s1, implicit-def $s0
90     ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY $s0
91     ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
92     ; CHECK: $w0 = COPY [[COPY3]](s32)
93     %0:_(s64) = COPY $x0
94     %1:_(s64) = COPY $x1
95     %2:_(s64) = G_FREM %0, %1
96     $x0 = COPY %2(s64)
97     %3:_(s32) = G_TRUNC %0(s64)
98     %4:_(s32) = G_TRUNC %1(s64)
99     %5:_(s32) = G_FREM %3, %4
100     $w0 = COPY %5(s32)