blob: c5f03abee71e6839282b21163ca0382d22500cdd [file] [log] [blame]
Dan Gohman9959b052009-08-26 14:59:13 +00001; RUN: llvm-as < %s | llc -march=x86-64 | grep movzbl | count 2
2
3; Use movzbl to avoid partial-register updates.
4
5define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
6 %q = trunc i32 %p to i8
7 %r = udiv i8 %q, %x
8 %s = zext i8 %r to i32
9 %t = and i32 %s, 1
10 ret i32 %t
11}
12define i32 @bar(i32 %p, i16 zeroext %x) nounwind {
13 %q = trunc i32 %p to i16
14 %r = udiv i16 %q, %x
15 %s = zext i16 %r to i32
16 %t = and i32 %s, 1
17 ret i32 %t
18}