mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
b620724e61
instructions for calls since BL and BLX are always 32-bit long and BX is always 16-bit long. Also, we should be using BLX to call external function stubs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77756 91177308-0d34-0410-b5e6-96231b3b80d8
21 lines
970 B
LLVM
21 lines
970 B
LLVM
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep smmul | count 1
|
|
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep umull | count 1
|
|
|
|
define i32 @smulhi(i32 %x, i32 %y) {
|
|
%tmp = sext i32 %x to i64 ; <i64> [#uses=1]
|
|
%tmp1 = sext i32 %y to i64 ; <i64> [#uses=1]
|
|
%tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
|
|
%tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
|
|
%tmp3.upgrd.1 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
|
|
ret i32 %tmp3.upgrd.1
|
|
}
|
|
|
|
define i32 @umulhi(i32 %x, i32 %y) {
|
|
%tmp = zext i32 %x to i64 ; <i64> [#uses=1]
|
|
%tmp1 = zext i32 %y to i64 ; <i64> [#uses=1]
|
|
%tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
|
|
%tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
|
|
%tmp3.upgrd.2 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
|
|
ret i32 %tmp3.upgrd.2
|
|
}
|