1 ; RUN: llc -march=mips64el -mcpu=mips64 -mattr=n64 < %s | FileCheck -check-prefix=EL %s
2 ; RUN: llc -march=mips64 -mcpu=mips64 -mattr=n64 < %s | FileCheck -check-prefix=EB %s
4 %struct.SLL = type { i64 }
5 %struct.SI = type { i32 }
6 %struct.SUI = type { i32 }
8 @sll = common global %struct.SLL zeroinitializer, align 1
9 @si = common global %struct.SI zeroinitializer, align 1
10 @sui = common global %struct.SUI zeroinitializer, align 1
12 define i64 @foo_load_ll() nounwind readonly {
14 ; EL: ldl $[[R0:[0-9]+]], 7($[[R1:[0-9]+]])
15 ; EL: ldr $[[R0]], 0($[[R1]])
16 ; EB: ldl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
17 ; EB: ldr $[[R0]], 7($[[R1]])
19 %0 = load i64* getelementptr inbounds (%struct.SLL* @sll, i64 0, i32 0), align 1
23 define i64 @foo_load_i() nounwind readonly {
25 ; EL: lwl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]])
26 ; EL: lwr $[[R0]], 0($[[R1]])
27 ; EB: lwl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
28 ; EB: lwr $[[R0]], 3($[[R1]])
30 %0 = load i32* getelementptr inbounds (%struct.SI* @si, i64 0, i32 0), align 1
31 %conv = sext i32 %0 to i64
35 define i64 @foo_load_ui() nounwind readonly {
37 ; EL: lwl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]])
38 ; EL: lwr $[[R0]], 0($[[R1]])
39 ; EL: daddiu $[[R2:[0-9]+]], $zero, 1
40 ; EL: dsll $[[R3:[0-9]+]], $[[R2]], 32
41 ; EL: daddiu $[[R4:[0-9]+]], $[[R3]], -1
42 ; EL: and ${{[0-9]+}}, $[[R0]], $[[R4]]
43 ; EB: lwl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
44 ; EB: lwr $[[R0]], 3($[[R1]])
47 %0 = load i32* getelementptr inbounds (%struct.SUI* @sui, i64 0, i32 0), align 1
48 %conv = zext i32 %0 to i64
52 define void @foo_store_ll(i64 %a) nounwind {
54 ; EL: sdl $[[R0:[0-9]+]], 7($[[R1:[0-9]+]])
55 ; EL: sdr $[[R0]], 0($[[R1]])
56 ; EB: sdl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
57 ; EB: sdr $[[R0]], 7($[[R1]])
59 store i64 %a, i64* getelementptr inbounds (%struct.SLL* @sll, i64 0, i32 0), align 1
63 define void @foo_store_i(i32 %a) nounwind {
65 ; EL: swl $[[R0:[0-9]+]], 3($[[R1:[0-9]+]])
66 ; EL: swr $[[R0]], 0($[[R1]])
67 ; EB: swl $[[R0:[0-9]+]], 0($[[R1:[0-9]+]])
68 ; EB: swr $[[R0]], 3($[[R1]])
70 store i32 %a, i32* getelementptr inbounds (%struct.SI* @si, i64 0, i32 0), align 1