Skip to content

Commit cfc256b

Browse files
committed
[DAG] TargetLowering::isBinOp() - add ISD::SSUBSAT/USUBSAT
Add to the generic non-commutative binop list.
1 parent 05eeb60 commit cfc256b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

+2
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,8 @@ class TargetLoweringBase {
24582458
case ISD::UDIV:
24592459
case ISD::SREM:
24602460
case ISD::UREM:
2461+
case ISD::SSUBSAT:
2462+
case ISD::USUBSAT:
24612463
case ISD::FSUB:
24622464
case ISD::FDIV:
24632465
case ISD::FREM:

llvm/test/CodeGen/AMDGPU/ssubsat.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ define <3 x i16> @v_ssubsat_v3i16(<3 x i16> %lhs, <3 x i16> %rhs) {
226226
; GFX9-LABEL: v_ssubsat_v3i16:
227227
; GFX9: ; %bb.0:
228228
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
229-
; GFX9-NEXT: v_pk_sub_i16 v0, v0, v2 clamp
230229
; GFX9-NEXT: v_pk_sub_i16 v1, v1, v3 clamp
230+
; GFX9-NEXT: v_pk_sub_i16 v0, v0, v2 clamp
231231
; GFX9-NEXT: s_setpc_b64 s[30:31]
232232
%result = call <3 x i16> @llvm.ssub.sat.v3i16(<3 x i16> %lhs, <3 x i16> %rhs)
233233
ret <3 x i16> %result

llvm/test/CodeGen/AMDGPU/usubsat.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ define <3 x i16> @v_usubsat_v3i16(<3 x i16> %lhs, <3 x i16> %rhs) {
147147
; GFX9-LABEL: v_usubsat_v3i16:
148148
; GFX9: ; %bb.0:
149149
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
150-
; GFX9-NEXT: v_pk_sub_u16 v0, v0, v2 clamp
151150
; GFX9-NEXT: v_pk_sub_u16 v1, v1, v3 clamp
151+
; GFX9-NEXT: v_pk_sub_u16 v0, v0, v2 clamp
152152
; GFX9-NEXT: s_setpc_b64 s[30:31]
153153
%result = call <3 x i16> @llvm.usub.sat.v3i16(<3 x i16> %lhs, <3 x i16> %rhs)
154154
ret <3 x i16> %result

0 commit comments

Comments
 (0)