| 1 |
; All of these ands and shifts should be folded into rlwimi's |
| 2 |
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -o %t |
| 3 |
; RUN: not grep mulhwu %t |
| 4 |
; RUN: not grep srawi %t |
| 5 |
; RUN: not grep add %t |
| 6 |
; RUN: grep mulhw %t | count 1 |
| 7 |
|
| 8 |
define i32 @mulhs(i32 %a, i32 %b) nounwind { |
| 9 |
entry: |
| 10 |
%tmp.1 = sext i32 %a to i64 ; <i64> [#uses=1] |
| 11 |
%tmp.3 = sext i32 %b to i64 ; <i64> [#uses=1] |
| 12 |
%tmp.4 = mul i64 %tmp.3, %tmp.1 ; <i64> [#uses=1] |
| 13 |
%tmp.6 = lshr i64 %tmp.4, 32 ; <i64> [#uses=1] |
| 14 |
%tmp.7 = trunc i64 %tmp.6 to i32 ; <i32> [#uses=1] |
| 15 |
ret i32 %tmp.7 |
| 16 |
} |
| 17 |
|