blob: 7661e9c5bda01090a9dacb6b2299cc2161123847 [file] [log] [blame]
Nate Begemanfeca19b2005-09-01 00:04:03 +00001; All of these ands and shifts should be folded into rlwimi's
Reid Spencereb1d74e2007-04-16 17:36:08 +00002; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -o %t -f
3; RUN: not grep mulhwu %t
4; RUN: not grep srawi %t
5; RUN: not grep add %t
Dan Gohman28beeea2007-08-15 13:36:28 +00006; RUN: grep mulhw %t | count 1
Nate Begemanfeca19b2005-09-01 00:04:03 +00007
8implementation ; Functions:
9
10int %mulhs(int %a, int %b) {
11entry:
12 %tmp.1 = cast int %a to ulong ; <ulong> [#uses=1]
13 %tmp.3 = cast int %b to ulong ; <ulong> [#uses=1]
14 %tmp.4 = mul ulong %tmp.3, %tmp.1 ; <ulong> [#uses=1]
15 %tmp.6 = shr ulong %tmp.4, ubyte 32 ; <ulong> [#uses=1]
16 %tmp.7 = cast ulong %tmp.6 to int ; <int> [#uses=1]
17 ret int %tmp.7
18}