1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
5 ; Use movzbl to avoid partial-register updates.
7 define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
10 ; X32-NEXT: movzbl {{[0-9]+}}(%esp), %eax
11 ; X32-NEXT: # kill: def $eax killed $eax def $ax
12 ; X32-NEXT: divb {{[0-9]+}}(%esp)
13 ; X32-NEXT: movzbl %al, %eax
14 ; X32-NEXT: andl $1, %eax
19 ; X64-NEXT: movzbl %dil, %eax
20 ; X64-NEXT: # kill: def $eax killed $eax def $ax
22 ; X64-NEXT: movzbl %al, %eax
23 ; X64-NEXT: andl $1, %eax
25 %q = trunc i32 %p to i8
27 %s = zext i8 %r to i32
32 define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
35 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
36 ; X32-NEXT: xorl %edx, %edx
37 ; X32-NEXT: divw {{[0-9]+}}(%esp)
38 ; X32-NEXT: # kill: def $ax killed $ax def $eax
39 ; X32-NEXT: andl $1, %eax
44 ; X64-NEXT: movl %edi, %eax
45 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
46 ; X64-NEXT: xorl %edx, %edx
48 ; X64-NEXT: # kill: def $ax killed $ax def $eax
49 ; X64-NEXT: andl $1, %eax
51 %q = trunc i32 %p to i16
53 %s = zext i16 %r to i32