1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 -mattr=+d < %s | FileCheck %s --check-prefix=LA32
3 ; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s --check-prefix=LA64
5 define i8 @load_i8() nounwind {
8 ; LA32-NEXT: ld.b $a0, $zero, 40
11 ; LA64-LABEL: load_i8:
13 ; LA64-NEXT: ld.b $a0, $zero, 40
15 %a = load i8, ptr inttoptr (i64 40 to ptr), align 8
19 define signext i8 @load_i8_sext() nounwind {
20 ; LA32-LABEL: load_i8_sext:
22 ; LA32-NEXT: ld.b $a0, $zero, 40
25 ; LA64-LABEL: load_i8_sext:
27 ; LA64-NEXT: ld.b $a0, $zero, 40
29 %a = load i8, ptr inttoptr (i64 40 to ptr), align 8
33 define i16 @load_i16() nounwind {
34 ; LA32-LABEL: load_i16:
36 ; LA32-NEXT: ld.h $a0, $zero, 40
39 ; LA64-LABEL: load_i16:
41 ; LA64-NEXT: ld.h $a0, $zero, 40
43 %a = load i16, ptr inttoptr (i64 40 to ptr), align 8
47 define signext i16 @load_i16_sext() nounwind {
48 ; LA32-LABEL: load_i16_sext:
50 ; LA32-NEXT: ld.h $a0, $zero, 40
53 ; LA64-LABEL: load_i16_sext:
55 ; LA64-NEXT: ld.h $a0, $zero, 40
57 %a = load i16, ptr inttoptr (i64 40 to ptr), align 8
61 define i32 @load_i32() nounwind {
62 ; LA32-LABEL: load_i32:
64 ; LA32-NEXT: ld.w $a0, $zero, 40
67 ; LA64-LABEL: load_i32:
69 ; LA64-NEXT: ld.w $a0, $zero, 40
71 %a = load i32, ptr inttoptr (i64 40 to ptr), align 8
75 define signext i32 @load_i32_sext() nounwind {
76 ; LA32-LABEL: load_i32_sext:
78 ; LA32-NEXT: ld.w $a0, $zero, 40
81 ; LA64-LABEL: load_i32_sext:
83 ; LA64-NEXT: ld.w $a0, $zero, 40
85 %a = load i32, ptr inttoptr (i64 40 to ptr), align 8
89 define i64 @load_i64() nounwind {
90 ; LA32-LABEL: load_i64:
92 ; LA32-NEXT: ld.w $a0, $zero, 40
93 ; LA32-NEXT: ld.w $a1, $zero, 44
96 ; LA64-LABEL: load_i64:
98 ; LA64-NEXT: ld.d $a0, $zero, 40
100 %a = load i64, ptr inttoptr (i64 40 to ptr), align 8
104 define void @store_i8(i8 %v) nounwind {
105 ; LA32-LABEL: store_i8:
107 ; LA32-NEXT: st.b $a0, $zero, 40
110 ; LA64-LABEL: store_i8:
112 ; LA64-NEXT: st.b $a0, $zero, 40
114 store i8 %v, ptr inttoptr (i64 40 to ptr), align 8
118 define void @store_i16(i16 %v) nounwind {
119 ; LA32-LABEL: store_i16:
121 ; LA32-NEXT: st.h $a0, $zero, 40
124 ; LA64-LABEL: store_i16:
126 ; LA64-NEXT: st.h $a0, $zero, 40
128 store i16 %v, ptr inttoptr (i64 40 to ptr), align 8
132 define void @store_i32(i32 %v) nounwind {
133 ; LA32-LABEL: store_i32:
135 ; LA32-NEXT: st.w $a0, $zero, 40
138 ; LA64-LABEL: store_i32:
140 ; LA64-NEXT: st.w $a0, $zero, 40
142 store i32 %v, ptr inttoptr (i64 40 to ptr), align 8
146 define void @store_i64(i64 %v) nounwind {
147 ; LA32-LABEL: store_i64:
149 ; LA32-NEXT: st.w $a1, $zero, 44
150 ; LA32-NEXT: st.w $a0, $zero, 40
153 ; LA64-LABEL: store_i64:
155 ; LA64-NEXT: st.d $a0, $zero, 40
157 store i64 %v, ptr inttoptr (i64 40 to ptr), align 8