mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-16 11:05:54 +00:00
d336de318e
(movzx/movsx) because they give more information. Revert that part of the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129498 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
426 B
LLVM
19 lines
426 B
LLVM
; RUN: llc < %s -march=x86-64 | grep movzbl | count 2
|
|
|
|
; Use movzbl to avoid partial-register updates.
|
|
|
|
define i32 @foo(i32 %p, i8 zeroext %x) nounwind {
|
|
%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
|
|
}
|