1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=m68k -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
4 name: test_scalar_small
6 - { id: 0, type: default, offset: 4, size: 1, alignment: 4, stack-id: default,
7 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
8 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
9 - { id: 1, type: default, offset: 0, size: 1, alignment: 8, stack-id: default,
10 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
11 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
14 ; CHECK-LABEL: name: test_scalar_small
15 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
16 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (load (s8) from %fixed-stack.0, align 8)
17 ; CHECK-NEXT: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
18 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX1]](p0) :: (load (s8) from %fixed-stack.1, align 4)
19 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[LOAD]](s32)
20 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
21 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32)
22 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s8) = G_AND [[TRUNC]], [[TRUNC1]]
23 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[LOAD1]](s32)
24 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
25 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[C1]](s32)
26 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s8) = G_AND [[TRUNC2]], [[TRUNC3]]
27 ; CHECK-NEXT: [[UDIV:%[0-9]+]]:_(s8) = G_UDIV [[AND]], [[AND1]]
28 ; CHECK-NEXT: $bd0 = COPY [[UDIV]](s8)
29 ; CHECK-NEXT: RTS implicit $bd0
30 %3:_(p0) = G_FRAME_INDEX %fixed-stack.1
31 %2:_(s32) = G_LOAD %3(p0) :: (load (s8) from %fixed-stack.1, align 8)
32 %0:_(s2) = G_TRUNC %2(s32)
33 %5:_(p0) = G_FRAME_INDEX %fixed-stack.0
34 %4:_(s32) = G_LOAD %5(p0) :: (load (s8) from %fixed-stack.0, align 4)
35 %1:_(s2) = G_TRUNC %4(s32)
36 %6:_(s2) = G_UDIV %0, %1
37 %7:_(s8) = G_ANYEXT %6(s2)
43 name: test_scalar_nonpow2
45 - { id: 0, type: default, offset: 4, size: 4, alignment: 4, stack-id: default,
46 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
47 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
48 - { id: 1, type: default, offset: 0, size: 4, alignment: 8, stack-id: default,
49 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
50 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
53 ; CHECK-LABEL: name: test_scalar_nonpow2
54 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
55 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (load (s32) from %fixed-stack.0, align 8)
56 ; CHECK-NEXT: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
57 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX1]](p0) :: (load (s32) from %fixed-stack.1)
58 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 131071
59 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[LOAD]], [[C]]
60 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 131071
61 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LOAD1]], [[C1]]
62 ; CHECK-NEXT: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[AND]], [[AND1]]
63 ; CHECK-NEXT: $d0 = COPY [[UDIV]](s32)
64 ; CHECK-NEXT: RTS implicit $d0
65 %3:_(p0) = G_FRAME_INDEX %fixed-stack.1
66 %2:_(s32) = G_LOAD %3(p0) :: (load (s32) from %fixed-stack.1, align 8)
67 %0:_(s17) = G_TRUNC %2(s32)
68 %5:_(p0) = G_FRAME_INDEX %fixed-stack.0
69 %4:_(s32) = G_LOAD %5(p0) :: (load (s32) from %fixed-stack.0)
70 %1:_(s17) = G_TRUNC %4(s32)
71 %6:_(s17) = G_UDIV %0, %1
72 %7:_(s32) = G_ANYEXT %6(s17)