summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2018-05-31 22:27:24 +0000
committerDan Gohman <dan433584@gmail.com>2018-05-31 22:27:24 +0000
commitb17de645ea3b536ab3c12b3837fcca6ae25f0343 (patch)
tree7fc8064f8bbc172b09d3bfbef6975e13c75fec96 /llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
parent5ef4d5f9c1c18ea7e274172e6f43a23aa1b1da31 (diff)
downloadbcm5719-llvm-b17de645ea3b536ab3c12b3837fcca6ae25f0343.tar.gz
bcm5719-llvm-b17de645ea3b536ab3c12b3837fcca6ae25f0343.zip
[WebAssembly] Fix the signatures for the __mulo* libcalls.
The __mulo* libcalls have an extra i32* to return the overflow value. Fixes PR37401. llvm-svn: 333706
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
index 283cecd4b9d..e5180ad7f2e 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
@@ -59,13 +59,16 @@ enum RuntimeLibcallSignature {
i32_func_f32_f32,
i32_func_f64_f64,
i32_func_i32_i32,
+ i32_func_i32_i32_iPTR,
i64_func_i64_i64,
+ i64_func_i64_i64_iPTR,
i64_i64_func_f32,
i64_i64_func_f64,
i16_i16_func_i16_i16,
i32_i32_func_i32_i32,
i64_i64_func_i64_i64,
i64_i64_func_i64_i64_i64_i64,
+ i64_i64_func_i64_i64_i64_i64_iPTR,
i64_i64_i64_i64_func_i64_i64_i64_i64,
i64_i64_func_i64_i64_i32,
iPTR_func_iPTR_i32_iPTR,
@@ -109,9 +112,9 @@ struct RuntimeLibcallSignatureTable {
Table[RTLIB::MUL_I32] = i32_func_i32_i32;
Table[RTLIB::MUL_I64] = i64_func_i64_i64;
Table[RTLIB::MUL_I128] = i64_i64_func_i64_i64_i64_i64;
- Table[RTLIB::MULO_I32] = i32_func_i32_i32;
- Table[RTLIB::MULO_I64] = i64_func_i64_i64;
- Table[RTLIB::MULO_I128] = i64_i64_func_i64_i64_i64_i64;
+ Table[RTLIB::MULO_I32] = i32_func_i32_i32_iPTR;
+ Table[RTLIB::MULO_I64] = i64_func_i64_i64_iPTR;
+ Table[RTLIB::MULO_I128] = i64_i64_func_i64_i64_i64_i64_iPTR;
Table[RTLIB::SDIV_I8] = i8_func_i8_i8;
Table[RTLIB::SDIV_I16] = i16_func_i16_i16;
Table[RTLIB::SDIV_I32] = i32_func_i32_i32;
@@ -627,11 +630,23 @@ void llvm::GetSignature(const WebAssemblySubtarget &Subtarget,
Params.push_back(wasm::ValType::I32);
Params.push_back(wasm::ValType::I32);
break;
+ case i32_func_i32_i32_iPTR:
+ Rets.push_back(wasm::ValType::I32);
+ Params.push_back(wasm::ValType::I32);
+ Params.push_back(wasm::ValType::I32);
+ Params.push_back(iPTR);
+ break;
case i64_func_i64_i64:
Rets.push_back(wasm::ValType::I64);
Params.push_back(wasm::ValType::I64);
Params.push_back(wasm::ValType::I64);
break;
+ case i64_func_i64_i64_iPTR:
+ Rets.push_back(wasm::ValType::I64);
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(iPTR);
+ break;
case i64_i64_func_f32:
#if 0 // TODO: Enable this when wasm gets multiple-return-value support.
Rets.push_back(wasm::ValType::I64);
@@ -692,6 +707,19 @@ void llvm::GetSignature(const WebAssemblySubtarget &Subtarget,
Params.push_back(wasm::ValType::I64);
Params.push_back(wasm::ValType::I64);
break;
+ case i64_i64_func_i64_i64_i64_i64_iPTR:
+#if 0 // TODO: Enable this when wasm gets multiple-return-value support.
+ Rets.push_back(wasm::ValType::I64);
+ Rets.push_back(wasm::ValType::I64);
+#else
+ Params.push_back(iPTR);
+#endif
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(wasm::ValType::I64);
+ Params.push_back(iPTR);
+ break;
case i64_i64_i64_i64_func_i64_i64_i64_i64:
#if 0 // TODO: Enable this when wasm gets multiple-return-value support.
Rets.push_back(wasm::ValType::I64);
OpenPOWER on IntegriCloud