blob: de75e96b87046f1c8ed8decaa523ab030c2b6247 [file] [log] [blame]
Tanya Lattner6263f942008-02-17 20:02:20 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+v6
2; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | \
Dan Gohman28beeea2007-08-15 13:36:28 +00003; RUN: grep smmul | count 1
Tanya Lattner6263f942008-02-17 20:02:20 +00004; RUN: llvm-as < %s | llc -march=arm | grep umull | count 1
Evan Cheng02b985c2007-01-19 09:20:23 +00005
Tanya Lattner6263f942008-02-17 20:02:20 +00006define i32 @smulhi(i32 %x, i32 %y) {
7 %tmp = sext i32 %x to i64 ; <i64> [#uses=1]
8 %tmp1 = sext i32 %y to i64 ; <i64> [#uses=1]
9 %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
10 %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
11 %tmp3.upgrd.1 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
12 ret i32 %tmp3.upgrd.1
Evan Cheng02b985c2007-01-19 09:20:23 +000013}
14
Tanya Lattner6263f942008-02-17 20:02:20 +000015define i32 @umulhi(i32 %x, i32 %y) {
16 %tmp = zext i32 %x to i64 ; <i64> [#uses=1]
17 %tmp1 = zext i32 %y to i64 ; <i64> [#uses=1]
18 %tmp2 = mul i64 %tmp1, %tmp ; <i64> [#uses=1]
19 %tmp3 = lshr i64 %tmp2, 32 ; <i64> [#uses=1]
20 %tmp3.upgrd.2 = trunc i64 %tmp3 to i32 ; <i32> [#uses=1]
21 ret i32 %tmp3.upgrd.2
Evan Cheng02b985c2007-01-19 09:20:23 +000022}