1 ; RUN: llc < %s -march=xcore | FileCheck %s
3 define i32 @load32(i32* %p, i32 %offset) nounwind {
6 ; CHECK: ldw r0, r0[r1]
7 %0 = getelementptr i32, i32* %p, i32 %offset
8 %1 = load i32, i32* %0, align 4
12 define i32 @load32_imm(i32* %p) nounwind {
14 ; CHECK-LABEL: load32_imm:
15 ; CHECK: ldw r0, r0[11]
16 %0 = getelementptr i32, i32* %p, i32 11
17 %1 = load i32, i32* %0, align 4
21 define i32 @load16(i16* %p, i32 %offset) nounwind {
23 ; CHECK-LABEL: load16:
24 ; CHECK: ld16s r0, r0[r1]
26 %0 = getelementptr i16, i16* %p, i32 %offset
27 %1 = load i16, i16* %0, align 2
28 %2 = sext i16 %1 to i32
32 define i32 @load8(i8* %p, i32 %offset) nounwind {
35 ; CHECK: ld8u r0, r0[r1]
37 %0 = getelementptr i8, i8* %p, i32 %offset
38 %1 = load i8, i8* %0, align 1
39 %2 = zext i8 %1 to i32
43 @GConst = internal constant i32 42
44 define i32 @load_cp() nounwind {
46 ; CHECK-LABEL: load_cp:
47 ; CHECK: ldw r0, cp[GConst]
48 %0 = load i32, i32* @GConst