2009-09-09 02:09:15 +02:00
|
|
|
; RUN: llc < %s -march=arm -mattr=+v6
|
|
|
|
; RUN: llc < %s -march=arm -mattr=+v6 | \
|
2007-08-15 15:36:28 +02:00
|
|
|
; RUN: grep smmul | count 1
|
2009-09-09 02:09:15 +02:00
|
|
|
; RUN: llc < %s -march=arm | grep umull | count 1
|
2007-01-19 10:20:23 +01:00
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
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
|
2007-01-19 10:20:23 +01:00
|
|
|
}
|
|
|
|
|
2008-02-17 21:02:20 +01:00
|
|
|
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
|
2007-01-19 10:20:23 +01:00
|
|
|
}
|