[PATCH] D53722: [WebAssembly] Lower to target-independent saturating add

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 25 12:10:36 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL345300: [WebAssembly] Lower to target-independent saturating add (authored by tlively, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D53722

Files:
  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
  cfe/trunk/test/CodeGen/builtins-wasm.c


Index: cfe/trunk/test/CodeGen/builtins-wasm.c
===================================================================
--- cfe/trunk/test/CodeGen/builtins-wasm.c
+++ cfe/trunk/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: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp
+++ cfe/trunk/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.171162.patch
Type: text/x-patch
Size: 2303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181025/6cd5f371/attachment.bin>


More information about the llvm-commits mailing list