[WebAssembly] Fix i64_i64_func_i64_i64_i32 type signature when multivalue feature is enabled

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D146533
This commit is contained in:
Congcong Cai 2023-03-22 06:32:01 +08:00
parent a09283a551
commit 696fdece49
2 changed files with 45 additions and 2 deletions

View File

@ -772,8 +772,6 @@ void llvm::getLibcallSignature(const WebAssemblySubtarget &Subtarget,
if (Subtarget.hasMultivalue()) {
Rets.push_back(wasm::ValType::I64);
Rets.push_back(wasm::ValType::I64);
Rets.push_back(wasm::ValType::I64);
Rets.push_back(wasm::ValType::I64);
} else {
Params.push_back(PtrTy);
}

View File

@ -96,3 +96,48 @@ define fp128 @multivalue_fsub(fp128 %a, fp128 %b) {
%sub = fsub fp128 %a, %b
ret fp128 %sub
}
define i128 @multivalue_lshr(i128 %a, i128 %b) {
; MULTIVALUE-LABEL: multivalue_lshr:
; MULTIVALUE: .functype multivalue_lshr (i64, i64, i64, i64) -> (i64, i64)
; MULTIVALUE-NEXT: # %bb.0:
; MULTIVALUE-NEXT: local.get 2
; MULTIVALUE-NEXT: local.get 3
; MULTIVALUE-NEXT: local.get 0
; MULTIVALUE-NEXT: i32.wrap_i64
; MULTIVALUE-NEXT: call __ashlti3
; MULTIVALUE-NEXT: # fallthrough-return
;
; NO_MULTIVALUE-LABEL: multivalue_lshr:
; NO_MULTIVALUE: .functype multivalue_lshr (i32, i64, i64, i64, i64) -> ()
; NO_MULTIVALUE-NEXT: .local i32
; NO_MULTIVALUE-NEXT: # %bb.0:
; NO_MULTIVALUE-NEXT: global.get __stack_pointer
; NO_MULTIVALUE-NEXT: i32.const 16
; NO_MULTIVALUE-NEXT: i32.sub
; NO_MULTIVALUE-NEXT: local.tee 5
; NO_MULTIVALUE-NEXT: global.set __stack_pointer
; NO_MULTIVALUE-NEXT: local.get 5
; NO_MULTIVALUE-NEXT: local.get 3
; NO_MULTIVALUE-NEXT: local.get 4
; NO_MULTIVALUE-NEXT: local.get 1
; NO_MULTIVALUE-NEXT: i32.wrap_i64
; NO_MULTIVALUE-NEXT: call __ashlti3
; NO_MULTIVALUE-NEXT: local.get 0
; NO_MULTIVALUE-NEXT: local.get 5
; NO_MULTIVALUE-NEXT: i32.const 8
; NO_MULTIVALUE-NEXT: i32.add
; NO_MULTIVALUE-NEXT: i64.load 0
; NO_MULTIVALUE-NEXT: i64.store 8
; NO_MULTIVALUE-NEXT: local.get 0
; NO_MULTIVALUE-NEXT: local.get 5
; NO_MULTIVALUE-NEXT: i64.load 0
; NO_MULTIVALUE-NEXT: i64.store 0
; NO_MULTIVALUE-NEXT: local.get 5
; NO_MULTIVALUE-NEXT: i32.const 16
; NO_MULTIVALUE-NEXT: i32.add
; NO_MULTIVALUE-NEXT: global.set __stack_pointer
; NO_MULTIVALUE-NEXT: # fallthrough-return
%tmp = shl i128 %b, %a
ret i128 %tmp
}