[PATCH] D53722: [WebAssembly] Lower to target-independent saturating add
Thomas Lively via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 25 11:44:46 PDT 2018
tlively created this revision.
tlively added reviewers: aheejin, dschuff.
Herald added subscribers: cfe-commits, sunfish, jgravelle-google, sbc100.
Goes along with https://reviews.llvm.org/D53721.
Repository:
rC Clang
https://reviews.llvm.org/D53722
Files:
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtins-wasm.c
Index: test/CodeGen/builtins-wasm.c
===================================================================
--- test/CodeGen/builtins-wasm.c
+++ test/CodeGen/builtins-wasm.c
@@ -223,28 +223,28 @@
i8x16 add_saturate_s_i8x16(i8x16 x, i8x16 y) {
return __builtin_wasm_add_saturate_s_i8x16(x, y);
- // WEBASSEMBLY: call <16 x i8> @llvm.wasm.add.saturate.signed.v16i8(
+ // WEBASSEMBLY: call <16 x i8> @llvm.sadd.sat.v16i8(
// WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
// WEBASSEMBLY-NEXT: ret
}
i8x16 add_saturate_u_i8x16(i8x16 x, i8x16 y) {
return __builtin_wasm_add_saturate_u_i8x16(x, y);
- // WEBASSEMBLY: call <16 x i8> @llvm.wasm.add.saturate.unsigned.v16i8(
+ // WEBASSEMBLY: call <16 x i8> @llvm.uadd.sat.v16i8(
// WEBASSEMBLY-SAME: <16 x i8> %x, <16 x i8> %y)
// WEBASSEMBLY-NEXT: ret
}
i16x8 add_saturate_s_i16x8(i16x8 x, i16x8 y) {
return __builtin_wasm_add_saturate_s_i16x8(x, y);
- // WEBASSEMBLY: call <8 x i16> @llvm.wasm.add.saturate.signed.v8i16(
+ // WEBASSEMBLY: call <8 x i16> @llvm.sadd.sat.v8i16(
// WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
// WEBASSEMBLY-NEXT: ret
}
i16x8 add_saturate_u_i16x8(i16x8 x, i16x8 y) {
return __builtin_wasm_add_saturate_u_i16x8(x, y);
- // WEBASSEMBLY: call <8 x i16> @llvm.wasm.add.saturate.unsigned.v8i16(
+ // WEBASSEMBLY: call <8 x i16> @llvm.uadd.sat.v8i16(
// WEBASSEMBLY-SAME: <8 x i16> %x, <8 x i16> %y)
// WEBASSEMBLY-NEXT: ret
}
Index: lib/CodeGen/CGBuiltin.cpp
===================================================================
--- lib/CodeGen/CGBuiltin.cpp
+++ lib/CodeGen/CGBuiltin.cpp
@@ -12614,11 +12614,11 @@
switch (BuiltinID) {
case WebAssembly::BI__builtin_wasm_add_saturate_s_i8x16:
case WebAssembly::BI__builtin_wasm_add_saturate_s_i16x8:
- IntNo = Intrinsic::wasm_add_saturate_signed;
+ IntNo = Intrinsic::sadd_sat;
break;
case WebAssembly::BI__builtin_wasm_add_saturate_u_i8x16:
case WebAssembly::BI__builtin_wasm_add_saturate_u_i16x8:
- IntNo = Intrinsic::wasm_add_saturate_unsigned;
+ IntNo = Intrinsic::uadd_sat;
break;
case WebAssembly::BI__builtin_wasm_sub_saturate_s_i8x16:
case WebAssembly::BI__builtin_wasm_sub_saturate_s_i16x8:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53722.171154.patch
Type: text/x-patch
Size: 2243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181025/e07ecda6/attachment.bin>
More information about the cfe-commits
mailing list