1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- -mattr=-bmi | FileCheck %s
4 ; Use h-register extract and zero-extend.
6 define double @foo8(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
9 ; CHECK-NEXT: movq %rsi, %rax
10 ; CHECK-NEXT: movzbl %ah, %eax
11 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
14 %t1 = and i64 %t0, 255
15 %t2 = getelementptr double, ptr %p, i64 %t1
16 %t3 = load double, ptr %t2, align 8
20 define float @foo4(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
23 ; CHECK-NEXT: movq %rsi, %rax
24 ; CHECK-NEXT: movzbl %ah, %eax
25 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
28 %t1 = and i64 %t0, 255
29 %t2 = getelementptr float, ptr %p, i64 %t1
30 %t3 = load float, ptr %t2, align 8
34 define i16 @foo2(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
37 ; CHECK-NEXT: movq %rsi, %rax
38 ; CHECK-NEXT: movzbl %ah, %eax
39 ; CHECK-NEXT: movzwl (%rdi,%rax,2), %eax
42 %t1 = and i64 %t0, 255
43 %t2 = getelementptr i16, ptr %p, i64 %t1
44 %t3 = load i16, ptr %t2, align 8
48 define i8 @foo1(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
51 ; CHECK-NEXT: movq %rsi, %rax
52 ; CHECK-NEXT: movzbl %ah, %eax
53 ; CHECK-NEXT: movzbl (%rdi,%rax), %eax
56 %t1 = and i64 %t0, 255
57 %t2 = getelementptr i8, ptr %p, i64 %t1
58 %t3 = load i8, ptr %t2, align 8
62 define i8 @bar8(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
65 ; CHECK-NEXT: movq %rsi, %rax
66 ; CHECK-NEXT: movzbl %ah, %eax
67 ; CHECK-NEXT: movzbl (%rdi,%rax,8), %eax
70 %t1 = and i64 %t0, 2040
71 %t2 = getelementptr i8, ptr %p, i64 %t1
72 %t3 = load i8, ptr %t2, align 8
76 define i8 @bar4(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
79 ; CHECK-NEXT: movq %rsi, %rax
80 ; CHECK-NEXT: movzbl %ah, %eax
81 ; CHECK-NEXT: movzbl (%rdi,%rax,4), %eax
84 %t1 = and i64 %t0, 1020
85 %t2 = getelementptr i8, ptr %p, i64 %t1
86 %t3 = load i8, ptr %t2, align 8
90 define i8 @bar2(ptr nocapture inreg %p, i64 inreg %x) nounwind readonly {
93 ; CHECK-NEXT: movq %rsi, %rax
94 ; CHECK-NEXT: movzbl %ah, %eax
95 ; CHECK-NEXT: movzbl (%rdi,%rax,2), %eax
98 %t1 = and i64 %t0, 510
99 %t2 = getelementptr i8, ptr %p, i64 %t1
100 %t3 = load i8, ptr %t2, align 8
104 define double @ext8(ptr nocapture inreg %p, i32 inreg %x) nounwind readonly {
107 ; CHECK-NEXT: movl %esi, %eax
108 ; CHECK-NEXT: movzbl %ah, %eax
109 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
112 %t1 = and i32 %t0, 2040
113 %t2 = zext i32 %t1 to i64
114 %t3 = getelementptr i8, ptr %p, i64 %t2
115 %t4 = load double, ptr %t3, align 8
119 define float @ext4(ptr nocapture inreg %p, i32 inreg %x) nounwind readonly {
122 ; CHECK-NEXT: movl %esi, %eax
123 ; CHECK-NEXT: movzbl %ah, %eax
124 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
127 %t1 = and i32 %t0, 1020
128 %t2 = zext i32 %t1 to i64
129 %t3 = getelementptr i8, ptr %p, i64 %t2
130 %t4 = load float, ptr %t3, align 8
134 define i8 @ext2(ptr nocapture inreg %p, i32 inreg %x) nounwind readonly {
137 ; CHECK-NEXT: movl %esi, %eax
138 ; CHECK-NEXT: movzbl %ah, %eax
139 ; CHECK-NEXT: movzbl (%rdi,%rax,2), %eax
142 %t1 = and i32 %t0, 510
143 %t2 = zext i32 %t1 to i64
144 %t3 = getelementptr i8, ptr %p, i64 %t2
145 %t4 = load i8, ptr %t3, align 8