1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -verify-machineinstrs -run-pass=legalizer %s -o - | FileCheck %s
7 ; CHECK-LABEL: name: test_udivrem_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 [[UDIV]](s64)
14 ; CHECK: $x1 = COPY [[SUB]](s64)
17 %2:_(s64), %3:_(s64) = G_UDIVREM %0, %1
26 ; CHECK-LABEL: name: test_sdivrem_32
27 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
28 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
29 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
30 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
31 ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[TRUNC]], [[TRUNC1]]
32 ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SDIV]], [[TRUNC1]]
33 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[TRUNC]], [[MUL]]
34 ; CHECK: $w0 = COPY [[SDIV]](s32)
35 ; CHECK: $w1 = COPY [[SUB]](s32)
38 %2:_(s32) = G_TRUNC %0(s64)
39 %3:_(s32) = G_TRUNC %1(s64)
40 %4:_(s32), %5:_(s32) = G_SDIVREM %2, %3
49 ; CHECK-LABEL: name: test_sdivrem_8
50 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
51 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
52 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
53 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
54 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
55 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
56 ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[SEXT_INREG]], [[SEXT_INREG1]]
57 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[TRUNC1]](s32)
58 ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SDIV]], [[COPY2]]
59 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[TRUNC]](s32)
60 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY3]], [[MUL]]
61 ; CHECK: $w0 = COPY [[SDIV]](s32)
62 ; CHECK: $w1 = COPY [[SUB]](s32)
65 %2:_(s8) = G_TRUNC %0(s64)
66 %3:_(s8) = G_TRUNC %1(s64)
67 %4:_(s8), %5:_(s8) = G_SDIVREM %2, %3
68 %6:_(s32) = G_ANYEXT %4(s8)
69 %7:_(s32) = G_ANYEXT %5(s8)