mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-28 06:29:45 +00:00
Sorry for the unit test churn. I'll try to make the change permanently next time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184705 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
723 B
LLVM
26 lines
723 B
LLVM
; RUN: llc -mtriple x86_64-linux -mcpu core2 -verify-machineinstrs %s -o - | FileCheck %s
|
|
define i32 @f(i1 %foo, i16* %tm_year2, i8* %bar, i16 %zed, i32 %zed2) {
|
|
entry:
|
|
br i1 %foo, label %return, label %if.end
|
|
|
|
if.end:
|
|
%rem = srem i32 %zed2, 100
|
|
%conv3 = trunc i32 %rem to i16
|
|
store i16 %conv3, i16* %tm_year2
|
|
%sext = shl i32 %rem, 16
|
|
%conv5 = ashr exact i32 %sext, 16
|
|
%div = sdiv i32 %conv5, 10
|
|
%conv6 = trunc i32 %div to i8
|
|
store i8 %conv6, i8* %bar
|
|
br label %return
|
|
|
|
return:
|
|
%retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
|
|
ret i32 %retval.0
|
|
}
|
|
|
|
; We were miscompiling this and using %ax instead of %cx in the movw.
|
|
; CHECK: movw %ax, (%rsi)
|
|
; CHECK: movswl %ax, %eax
|
|
; CHECK: movslq %eax, %rax
|