1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64_be -o - %s | FileCheck %s --check-prefix CHECK-BE
3 ; RUN: llc -mtriple=aarch64 -o - %s | FileCheck %s --check-prefix CHECK-LE
5 define i8 @test1(i32 %a, ptr %pa) {
6 ; CHECK-BE-LABEL: test1:
8 ; CHECK-BE-NEXT: mov w8, w0
9 ; CHECK-BE-NEXT: lsr w0, w0, #24
10 ; CHECK-BE-NEXT: str w8, [x1]
13 ; CHECK-LE-LABEL: test1:
15 ; CHECK-LE-NEXT: str w0, [x1]
18 %res = load i8, ptr %pa
22 define i8 @test2(i32 %a, ptr %pa) {
23 ; CHECK-BE-LABEL: test2:
25 ; CHECK-BE-NEXT: str w0, [x1]
26 ; CHECK-BE-NEXT: ldrb w0, [x1, #1]
29 ; CHECK-LE-LABEL: test2:
31 ; CHECK-LE-NEXT: str w0, [x1]
32 ; CHECK-LE-NEXT: ubfx w0, w0, #8, #8
34 %p8 = getelementptr i8, ptr %pa, i32 1
36 %res = load i8, ptr %p8
40 define i8 @test3(i32 %a, ptr %pa) {
41 ; CHECK-BE-LABEL: test3:
43 ; CHECK-BE-NEXT: str w0, [x1]
44 ; CHECK-BE-NEXT: ldrb w0, [x1, #2]
47 ; CHECK-LE-LABEL: test3:
49 ; CHECK-LE-NEXT: str w0, [x1]
50 ; CHECK-LE-NEXT: ubfx w0, w0, #16, #8
52 %p8 = getelementptr i8, ptr %pa, i32 2
54 %res = load i8, ptr %p8
58 define i8 @test4(i32 %a, ptr %pa) {
59 ; CHECK-BE-LABEL: test4:
61 ; CHECK-BE-NEXT: str w0, [x1]
64 ; CHECK-LE-LABEL: test4:
66 ; CHECK-LE-NEXT: str w0, [x1]
67 ; CHECK-LE-NEXT: lsr w0, w0, #24
69 %p8 = getelementptr i8, ptr %pa, i32 3
71 %res = load i8, ptr %p8