[WebAssembly] Also legalize sign_extend_inreg of i32->i64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2015-12-10 01:00:19 +00:00
parent 0c2c493a1d
commit 3384127652
2 changed files with 10 additions and 1 deletions

View File

@ -159,7 +159,7 @@ WebAssemblyTargetLowering::WebAssemblyTargetLowering(
// As a special case, these operators use the type to mean the type to
// sign-extend from.
for (auto T : {MVT::i1, MVT::i8, MVT::i16})
for (auto T : {MVT::i1, MVT::i8, MVT::i16, MVT::i32})
setOperationAction(ISD::SIGN_EXTEND_INREG, T, Expand);
// Dynamic stack allocation: use the default expansion.

View File

@ -22,3 +22,12 @@ define i53 @shl_i53(i53 %a, i53 %b, i53* %p) {
%t = shl i53 %a, %b
ret i53 %t
}
; CHECK-LABEL: sext_in_reg_i32_i64:
; CHECK: i64.shl
; CHECK: i64.shr_s
define i64 @sext_in_reg_i32_i64(i64 %a) {
%b = shl i64 %a, 32
%c = ashr i64 %b, 32
ret i64 %c
}