[llvm] 7fbdadb - [AArch64][X86] xor.ll - fix vec_add_of_not_with_undef_decrement copy+pasta typo
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 19 05:47:52 PDT 2024
Author: Simon Pilgrim
Date: 2024-04-19T13:47:28+01:00
New Revision: 7fbdadb68e259079d23165ecb94e2893a3823576
URL: https://github.com/llvm/llvm-project/commit/7fbdadb68e259079d23165ecb94e2893a3823576
DIFF: https://github.com/llvm/llvm-project/commit/7fbdadb68e259079d23165ecb94e2893a3823576.diff
LOG: [AArch64][X86] xor.ll - fix vec_add_of_not_with_undef_decrement copy+pasta typo
This was copied from vec_add_of_not_with_undef instead of vec_add_of_not_decrement - replacing the second sub with an add
Added:
Modified:
llvm/test/CodeGen/AArch64/xor.ll
llvm/test/CodeGen/X86/xor.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/xor.ll b/llvm/test/CodeGen/AArch64/xor.ll
index 7d7f7bfdbf38e8..1379bcb78e24b2 100644
--- a/llvm/test/CodeGen/AArch64/xor.ll
+++ b/llvm/test/CodeGen/AArch64/xor.ll
@@ -73,11 +73,10 @@ define <4 x i32> @vec_add_of_not_with_undef(<4 x i32> %x, <4 x i32> %y) {
define <4 x i32> @vec_add_of_not_with_undef_decrement(<4 x i32> %x, <4 x i32> %y) {
; CHECK-LABEL: vec_add_of_not_with_undef_decrement:
; CHECK: // %bb.0:
-; CHECK-NEXT: movi v2.4s, #1
-; CHECK-NEXT: sub v0.4s, v0.4s, v1.4s
-; CHECK-NEXT: add v0.4s, v0.4s, v2.4s
+; CHECK-NEXT: mvn v1.16b, v1.16b
+; CHECK-NEXT: add v0.4s, v0.4s, v1.4s
; CHECK-NEXT: ret
%t0 = sub <4 x i32> %x, %y
- %r = add <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>
+ %r = sub <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>
ret <4 x i32> %r
}
diff --git a/llvm/test/CodeGen/X86/xor.ll b/llvm/test/CodeGen/X86/xor.ll
index 8c8b7cc5161056..62b39786787a39 100644
--- a/llvm/test/CodeGen/X86/xor.ll
+++ b/llvm/test/CodeGen/X86/xor.ll
@@ -654,26 +654,25 @@ define <4 x i32> @vec_add_of_not_with_undef(<4 x i32> %x, <4 x i32> %y) {
define <4 x i32> @vec_add_of_not_with_undef_decrement(<4 x i32> %x, <4 x i32> %y) {
; X86-LABEL: vec_add_of_not_with_undef_decrement:
; X86: # %bb.0:
-; X86-NEXT: psubd %xmm1, %xmm0
-; X86-NEXT: pcmpeqd %xmm1, %xmm1
-; X86-NEXT: psubd %xmm1, %xmm0
+; X86-NEXT: pcmpeqd %xmm2, %xmm2
+; X86-NEXT: pxor %xmm1, %xmm2
+; X86-NEXT: paddd %xmm2, %xmm0
; X86-NEXT: retl
;
; X64-LIN-LABEL: vec_add_of_not_with_undef_decrement:
; X64-LIN: # %bb.0:
-; X64-LIN-NEXT: psubd %xmm1, %xmm0
-; X64-LIN-NEXT: pcmpeqd %xmm1, %xmm1
-; X64-LIN-NEXT: psubd %xmm1, %xmm0
+; X64-LIN-NEXT: pcmpeqd %xmm2, %xmm2
+; X64-LIN-NEXT: pxor %xmm1, %xmm2
+; X64-LIN-NEXT: paddd %xmm2, %xmm0
; X64-LIN-NEXT: retq
;
; X64-WIN-LABEL: vec_add_of_not_with_undef_decrement:
; X64-WIN: # %bb.0:
-; X64-WIN-NEXT: movdqa (%rcx), %xmm0
-; X64-WIN-NEXT: psubd (%rdx), %xmm0
-; X64-WIN-NEXT: pcmpeqd %xmm1, %xmm1
-; X64-WIN-NEXT: psubd %xmm1, %xmm0
+; X64-WIN-NEXT: pcmpeqd %xmm0, %xmm0
+; X64-WIN-NEXT: pxor (%rdx), %xmm0
+; X64-WIN-NEXT: paddd (%rcx), %xmm0
; X64-WIN-NEXT: retq
%t0 = sub <4 x i32> %x, %y
- %r = add <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>
+ %r = sub <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>
ret <4 x i32> %r
}
More information about the llvm-commits
mailing list