[llvm] cfc256b - [DAG] TargetLowering::isBinOp() - add ISD::SSUBSAT/USUBSAT
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 17 07:51:20 PDT 2021
Author: Simon Pilgrim
Date: 2021-03-17T14:51:00Z
New Revision: cfc256ba9f6aa9d6aa29db91a98d35fa1f075596
URL: https://github.com/llvm/llvm-project/commit/cfc256ba9f6aa9d6aa29db91a98d35fa1f075596
DIFF: https://github.com/llvm/llvm-project/commit/cfc256ba9f6aa9d6aa29db91a98d35fa1f075596.diff
LOG: [DAG] TargetLowering::isBinOp() - add ISD::SSUBSAT/USUBSAT
Add to the generic non-commutative binop list.
Added:
Modified:
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/test/CodeGen/AMDGPU/ssubsat.ll
llvm/test/CodeGen/AMDGPU/usubsat.ll
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 0d2453a778a4..05cc381834e5 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -2458,6 +2458,8 @@ class TargetLoweringBase {
case ISD::UDIV:
case ISD::SREM:
case ISD::UREM:
+ case ISD::SSUBSAT:
+ case ISD::USUBSAT:
case ISD::FSUB:
case ISD::FDIV:
case ISD::FREM:
diff --git a/llvm/test/CodeGen/AMDGPU/ssubsat.ll b/llvm/test/CodeGen/AMDGPU/ssubsat.ll
index 5ec602373409..4aede123e48b 100644
--- a/llvm/test/CodeGen/AMDGPU/ssubsat.ll
+++ b/llvm/test/CodeGen/AMDGPU/ssubsat.ll
@@ -226,8 +226,8 @@ define <3 x i16> @v_ssubsat_v3i16(<3 x i16> %lhs, <3 x i16> %rhs) {
; GFX9-LABEL: v_ssubsat_v3i16:
; GFX9: ; %bb.0:
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX9-NEXT: v_pk_sub_i16 v0, v0, v2 clamp
; GFX9-NEXT: v_pk_sub_i16 v1, v1, v3 clamp
+; GFX9-NEXT: v_pk_sub_i16 v0, v0, v2 clamp
; GFX9-NEXT: s_setpc_b64 s[30:31]
%result = call <3 x i16> @llvm.ssub.sat.v3i16(<3 x i16> %lhs, <3 x i16> %rhs)
ret <3 x i16> %result
diff --git a/llvm/test/CodeGen/AMDGPU/usubsat.ll b/llvm/test/CodeGen/AMDGPU/usubsat.ll
index eeabd31f9062..13f61b6ea131 100644
--- a/llvm/test/CodeGen/AMDGPU/usubsat.ll
+++ b/llvm/test/CodeGen/AMDGPU/usubsat.ll
@@ -147,8 +147,8 @@ define <3 x i16> @v_usubsat_v3i16(<3 x i16> %lhs, <3 x i16> %rhs) {
; GFX9-LABEL: v_usubsat_v3i16:
; GFX9: ; %bb.0:
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GFX9-NEXT: v_pk_sub_u16 v0, v0, v2 clamp
; GFX9-NEXT: v_pk_sub_u16 v1, v1, v3 clamp
+; GFX9-NEXT: v_pk_sub_u16 v0, v0, v2 clamp
; GFX9-NEXT: s_setpc_b64 s[30:31]
%result = call <3 x i16> @llvm.usub.sat.v3i16(<3 x i16> %lhs, <3 x i16> %rhs)
ret <3 x i16> %result
More information about the llvm-commits
mailing list