aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/anyext.ll
blob: 32a48fbedca29911c67ee202f65347a523323ead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RUN: llc < %s -march=x86-64 | FileCheck %s

; Use movzbl (aliased as movzx) to avoid partial-register updates.

define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
; CHECK: movzx %dil, %eax
; CHECK: movzx %al, %eax
  %q = trunc i32 %p to i8
  %r = udiv i8 %q, %x
  %s = zext i8 %r to i32
  %t = and i32 %s, 1
  ret i32 %t
}
define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
  %q = trunc i32 %p to i16
  %r = udiv i16 %q, %x
  %s = zext i16 %r to i32
  %t = and i32 %s, 1
  ret i32 %t
}