1 ; RUN: llc < %s -march=x86-64 | FileCheck %s -check-prefix=X86-64
2 ; RUN: llc < %s -march=x86 | FileCheck %s -check-prefix=X86-32
4 ; Use h registers. On x86-64, codegen doesn't support general allocation
5 ; of h registers yet, due to x86 encoding complications.
7 define void @bar64(i64 inreg %x, i8* inreg %p) nounwind {
9 ; X86-64: shrq $8, %rdi
15 %t1 = trunc i64 %t0 to i8
21 define void @bar32(i32 inreg %x, i8* inreg %p) nounwind {
23 ; X86-64: shrl $8, %edi
29 %t1 = trunc i32 %t0 to i8
35 define void @bar16(i16 inreg %x, i8* inreg %p) nounwind {
37 ; X86-64: shrl $8, %edi
43 %t1 = trunc i16 %t0 to i8
49 define i64 @qux64(i64 inreg %x) nounwind {
51 ; X86-64: movq %rdi, %rax
52 ; X86-64: movzbl %ah, %eax
55 ; X86-32: movzbl %ah, %eax
57 %t1 = and i64 %t0, 255
61 define i32 @qux32(i32 inreg %x) nounwind {
63 ; X86-64: movl %edi, %eax
64 ; X86-64: movzbl %ah, %eax
67 ; X86-32: movzbl %ah, %eax
69 %t1 = and i32 %t0, 255
73 define i16 @qux16(i16 inreg %x) nounwind {
75 ; X86-64: movl %edi, %eax
76 ; X86-64: movzbl %ah, %eax
79 ; X86-32: movzbl %ah, %eax