1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
3 ; RUN: -riscv-experimental-rv64-legal-i32 | FileCheck -check-prefix=RV64I %s
5 ; Check indexed and unindexed, sext, zext and anyext loads
7 define void @lb(ptr %a, ptr %b) nounwind {
10 ; RV64I-NEXT: lb a2, 1(a0)
11 ; RV64I-NEXT: lbu zero, 0(a0)
12 ; RV64I-NEXT: sw a2, 0(a1)
14 %1 = getelementptr i8, ptr %a, i32 1
16 %3 = sext i8 %2 to i32
17 ; the unused load will produce an anyext for selection
18 %4 = load volatile i8, ptr %a
23 define void @lbu(ptr %a, ptr %b) nounwind {
26 ; RV64I-NEXT: lbu a0, 1(a0)
27 ; RV64I-NEXT: sw a0, 0(a1)
29 %1 = getelementptr i8, ptr %a, i32 1
31 %3 = zext i8 %2 to i32
36 define void @lh(ptr %a, ptr %b) nounwind {
39 ; RV64I-NEXT: lh a2, 2(a0)
40 ; RV64I-NEXT: lh zero, 0(a0)
41 ; RV64I-NEXT: sw a2, 0(a1)
43 %1 = getelementptr i16, ptr %a, i32 1
45 %3 = sext i16 %2 to i32
46 ; the unused load will produce an anyext for selection
47 %4 = load volatile i16, ptr %a
52 define void @lhu(ptr %a, ptr %b) nounwind {
55 ; RV64I-NEXT: lhu a0, 2(a0)
56 ; RV64I-NEXT: sw a0, 0(a1)
58 %1 = getelementptr i16, ptr %a, i32 1
60 %3 = zext i16 %2 to i32
65 define void @lw(ptr %a, ptr %b) nounwind {
68 ; RV64I-NEXT: lw a2, 4(a0)
69 ; RV64I-NEXT: lw zero, 0(a0)
70 ; RV64I-NEXT: sd a2, 0(a1)
72 %1 = getelementptr i32, ptr %a, i64 1
74 %3 = sext i32 %2 to i64
75 ; the unused load will produce an anyext for selection
76 %4 = load volatile i32, ptr %a
81 define void @lwu(ptr %a, ptr %b) nounwind {
84 ; RV64I-NEXT: lwu a0, 4(a0)
85 ; RV64I-NEXT: sd a0, 0(a1)
87 %1 = getelementptr i32, ptr %a, i64 1
89 %3 = zext i32 %2 to i64