1 # RUN: llc -O0 -march=mips -mcpu=mips32r3 -mattr=+micromips,+eva -start-after=finalize-isel \
2 # RUN: -filetype obj %s -o - | llvm-objdump --no-print-imm-hex --mattr=+eva -d - | FileCheck %s
4 # Test that MIPS unaligned load/store instructions can be mapped to their
5 # corresponding microMIPS instructions.
7 define void @g(ptr %a, ptr %b) {
9 %0 = load i32, ptr %a, align 1
10 store i32 %0, ptr %b, align 1
14 define void @g2(ptr %a, ptr %b) {
16 %0 = load i32, ptr %a, align 1
17 store i32 %0, ptr %b, align 1
24 exposesReturnsTwice: false
26 regBankSelected: false
29 tracksRegLiveness: true
31 - { reg: '$a0', virtual-reg: '%0' }
32 - { reg: '$a1', virtual-reg: '%1' }
34 isFrameAddressTaken: false
35 isReturnAddressTaken: false
44 maxCallFrameSize: 4294967295
45 hasOpaqueSPAdjustment: false
47 hasMustTailInVarArgFunc: false
59 %3:gpr32 = IMPLICIT_DEF
60 %2:gpr32 = LWL %0, 0, %3 :: (load (s32) from %ir.a, align 1)
61 %4:gpr32 = LWR %0, 3, %2 :: (load (s32) from %ir.a, align 1)
62 SWL %4, %1, 0 :: (store (s32) into %ir.b, align 1)
63 SWR %4, %1, 3 :: (store (s32) into %ir.b, align 1)
70 exposesReturnsTwice: false
72 regBankSelected: false
75 tracksRegLiveness: true
77 - { reg: '$a0', virtual-reg: '%0' }
78 - { reg: '$a1', virtual-reg: '%1' }
80 isFrameAddressTaken: false
81 isReturnAddressTaken: false
90 maxCallFrameSize: 4294967295
91 hasOpaqueSPAdjustment: false
93 hasMustTailInVarArgFunc: false
105 %3:gpr32 = IMPLICIT_DEF
106 %2:gpr32 = LWLE %0, 0, %3 :: (load (s32) from %ir.a, align 1)
107 %4:gpr32 = LWRE %0, 3, %2 :: (load (s32) from %ir.a, align 1)
108 SWLE %4, %1, 0 :: (store (s32) into %ir.b, align 1)
109 SWRE %4, %1, 3 :: (store (s32) into %ir.b, align 1)
115 # CHECK: 0: 60 24 00 00 lwl $1, 0($4)
116 # CHECK: 4: 60 24 10 03 lwr $1, 3($4)
117 # CHECK: 8: 60 25 80 00 swl $1, 0($5)
118 # CHECK: c: 60 25 90 03 swr $1, 3($5)
121 # CHECK: 14: 60 24 64 00 lwle $1, 0($4)
122 # CHECK: 18: 60 24 66 03 lwre $1, 3($4)
123 # CHECK: 1c: 60 25 a0 00 swle $1, 0($5)
124 # CHECK: 20: 60 25 a2 03 swre $1, 3($5)