blob: 106fe83661b413c3302f0eb40c20af3cf593f519 [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86-64 | grep movzbl | count 2
Dan Gohman9959b052009-08-26 14:59:13 +00002
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}