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: divb {{[0-9]+}}(%esp)
12 ; X32-NEXT: movzbl %al, %eax
13 ; X32-NEXT: andl $1, %eax
18 ; X64-NEXT: movzbl %dil, %eax
20 ; X64-NEXT: movzbl %al, %eax
21 ; X64-NEXT: andl $1, %eax
23 %q = trunc i32 %p to i8
25 %s = zext i8 %r to i32
30 define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
33 ; X32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
34 ; X32-NEXT: xorl %edx, %edx
35 ; X32-NEXT: divw {{[0-9]+}}(%esp)
36 ; X32-NEXT: # kill: def $ax killed $ax def $eax
37 ; X32-NEXT: andl $1, %eax
42 ; X64-NEXT: movl %edi, %eax
43 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
44 ; X64-NEXT: xorl %edx, %edx
46 ; X64-NEXT: # kill: def $ax killed $ax def $eax
47 ; X64-NEXT: andl $1, %eax
49 %q = trunc i32 %p to i16
51 %s = zext i16 %r to i32