Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52128,7 +52128,19 @@ static SDValue combineXor(SDNode *N, SelectionDAG &DAG,
if (SDValue R = combineBMILogicOp(N, DAG, Subtarget))
return R;

return combineFneg(N, DAG, DCI, Subtarget);
if (SDValue R = combineFneg(N, DAG, DCI, Subtarget))
return R;

// (xor x, SIGN_BIT) == (add x, SIGN_BIT), since we can lower `add` with `lea`
// which can be fused with shift/eliminate register moves, its preferable.
if (VT.isScalarInteger() && VT.getScalarSizeInBits() <= 32) {
Copy link
Collaborator

@topperc topperc Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already do this for ==32 and ==8 in tablegen? i16 is weird because its promoted before tablegen.

def : Pat<(xor GR8:$src1, -128),                                                 
          (ADD8ri GR8:$src1, -128)>;                                             
def : Pat<(xor GR16:$src1, -32768),                                              
          (ADD16ri GR16:$src1, -32768)>;                                         
def : Pat<(xor GR32:$src1, -2147483648),                                         
          (ADD32ri GR32:$src1, -2147483648)>;

if (auto *C = dyn_cast<ConstantSDNode>(N1)) {
if (C->getAPIntValue().isSignMask())
return DAG.getNode(ISD::ADD, SDLoc(N), VT, N0, N1);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use DAG.isADDLike ?


return SDValue();
}

static SDValue combineBITREVERSE(SDNode *N, SelectionDAG &DAG,
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/X86/combine-fneg.ll
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ define <2 x float> @fneg_bitcast(i64 %i) nounwind {
; X86-SSE1-NEXT: subl $16, %esp
; X86-SSE1-NEXT: movl $-2147483648, %eax # imm = 0x80000000
; X86-SSE1-NEXT: movl 12(%ebp), %ecx
; X86-SSE1-NEXT: xorl %eax, %ecx
; X86-SSE1-NEXT: addl %eax, %ecx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't the load or the immediate fold into this instruction?

; X86-SSE1-NEXT: movl %ecx, {{[0-9]+}}(%esp)
; X86-SSE1-NEXT: xorl 8(%ebp), %eax
; X86-SSE1-NEXT: addl 8(%ebp), %eax
; X86-SSE1-NEXT: movl %eax, (%esp)
; X86-SSE1-NEXT: movaps (%esp), %xmm0
; X86-SSE1-NEXT: movl %ebp, %esp
Expand All @@ -137,9 +137,9 @@ define <2 x float> @fneg_bitcast(i64 %i) nounwind {
; X86-SSE2: # %bb.0:
; X86-SSE2-NEXT: movl $-2147483648, %eax # imm = 0x80000000
; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-SSE2-NEXT: xorl %eax, %ecx
; X86-SSE2-NEXT: addl %eax, %ecx
; X86-SSE2-NEXT: movd %ecx, %xmm1
; X86-SSE2-NEXT: xorl {{[0-9]+}}(%esp), %eax
; X86-SSE2-NEXT: addl {{[0-9]+}}(%esp), %eax
; X86-SSE2-NEXT: movd %eax, %xmm0
; X86-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
; X86-SSE2-NEXT: retl
Expand Down
58 changes: 29 additions & 29 deletions llvm/test/CodeGen/X86/horizontal-reduce-smin.ll
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ define i16 @test_reduce_v8i16(<8 x i16> %a0) {
; X86-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X86-SSE42-NEXT: movd %xmm0, %eax
; X86-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-SSE42-NEXT: retl
;
Expand All @@ -217,7 +217,7 @@ define i16 @test_reduce_v8i16(<8 x i16> %a0) {
; X86-AVX-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX-NEXT: vmovd %xmm0, %eax
; X86-AVX-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX-NEXT: retl
;
Expand All @@ -239,7 +239,7 @@ define i16 @test_reduce_v8i16(<8 x i16> %a0) {
; X64-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X64-SSE42-NEXT: movd %xmm0, %eax
; X64-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-SSE42-NEXT: retq
;
Expand All @@ -248,7 +248,7 @@ define i16 @test_reduce_v8i16(<8 x i16> %a0) {
; X64-AVX1OR2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vmovd %xmm0, %eax
; X64-AVX1OR2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX1OR2-NEXT: retq
;
Expand All @@ -257,7 +257,7 @@ define i16 @test_reduce_v8i16(<8 x i16> %a0) {
; X64-AVX512-NEXT: vpxord {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX512-NEXT: vmovd %xmm0, %eax
; X64-AVX512-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX512-NEXT: retq
%1 = shufflevector <8 x i16> %a0, <8 x i16> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
Expand Down Expand Up @@ -743,7 +743,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X86-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X86-SSE42-NEXT: movd %xmm0, %eax
; X86-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-SSE42-NEXT: retl
;
Expand All @@ -754,7 +754,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X86-AVX1-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX1-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX1-NEXT: vmovd %xmm0, %eax
; X86-AVX1-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX1-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX1-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX1-NEXT: vzeroupper
; X86-AVX1-NEXT: retl
Expand All @@ -766,7 +766,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X86-AVX2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX2-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX2-NEXT: vmovd %xmm0, %eax
; X86-AVX2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX2-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX2-NEXT: vzeroupper
; X86-AVX2-NEXT: retl
Expand All @@ -791,7 +791,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X64-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X64-SSE42-NEXT: movd %xmm0, %eax
; X64-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-SSE42-NEXT: retq
;
Expand All @@ -802,7 +802,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X64-AVX1-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX1-NEXT: vmovd %xmm0, %eax
; X64-AVX1-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX1-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX1-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX1-NEXT: vzeroupper
; X64-AVX1-NEXT: retq
Expand All @@ -814,7 +814,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X64-AVX2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX2-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX2-NEXT: vmovd %xmm0, %eax
; X64-AVX2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX2-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX2-NEXT: vzeroupper
; X64-AVX2-NEXT: retq
Expand All @@ -826,7 +826,7 @@ define i16 @test_reduce_v16i16(<16 x i16> %a0) {
; X64-AVX512-NEXT: vpxord {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX512-NEXT: vmovd %xmm0, %eax
; X64-AVX512-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX512-NEXT: vzeroupper
; X64-AVX512-NEXT: retq
Expand Down Expand Up @@ -1500,7 +1500,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X86-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X86-SSE42-NEXT: movd %xmm0, %eax
; X86-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-SSE42-NEXT: retl
;
Expand All @@ -1514,7 +1514,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X86-AVX1-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX1-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX1-NEXT: vmovd %xmm0, %eax
; X86-AVX1-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX1-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX1-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX1-NEXT: vzeroupper
; X86-AVX1-NEXT: retl
Expand All @@ -1527,7 +1527,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X86-AVX2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX2-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX2-NEXT: vmovd %xmm0, %eax
; X86-AVX2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX2-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX2-NEXT: vzeroupper
; X86-AVX2-NEXT: retl
Expand Down Expand Up @@ -1556,7 +1556,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X64-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X64-SSE42-NEXT: movd %xmm0, %eax
; X64-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-SSE42-NEXT: retq
;
Expand All @@ -1570,7 +1570,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X64-AVX1-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX1-NEXT: vmovd %xmm0, %eax
; X64-AVX1-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX1-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX1-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX1-NEXT: vzeroupper
; X64-AVX1-NEXT: retq
Expand All @@ -1583,7 +1583,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X64-AVX2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX2-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX2-NEXT: vmovd %xmm0, %eax
; X64-AVX2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX2-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX2-NEXT: vzeroupper
; X64-AVX2-NEXT: retq
Expand All @@ -1597,7 +1597,7 @@ define i16 @test_reduce_v32i16(<32 x i16> %a0) {
; X64-AVX512-NEXT: vpxord {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX512-NEXT: vmovd %xmm0, %eax
; X64-AVX512-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX512-NEXT: vzeroupper
; X64-AVX512-NEXT: retq
Expand Down Expand Up @@ -1869,7 +1869,7 @@ define i16 @test_reduce_v16i16_v8i16(<16 x i16> %a0) {
; X86-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X86-SSE42-NEXT: movd %xmm0, %eax
; X86-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-SSE42-NEXT: retl
;
Expand All @@ -1878,7 +1878,7 @@ define i16 @test_reduce_v16i16_v8i16(<16 x i16> %a0) {
; X86-AVX-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX-NEXT: vmovd %xmm0, %eax
; X86-AVX-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX-NEXT: vzeroupper
; X86-AVX-NEXT: retl
Expand All @@ -1901,7 +1901,7 @@ define i16 @test_reduce_v16i16_v8i16(<16 x i16> %a0) {
; X64-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X64-SSE42-NEXT: movd %xmm0, %eax
; X64-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-SSE42-NEXT: retq
;
Expand All @@ -1910,7 +1910,7 @@ define i16 @test_reduce_v16i16_v8i16(<16 x i16> %a0) {
; X64-AVX1OR2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vmovd %xmm0, %eax
; X64-AVX1OR2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX1OR2-NEXT: vzeroupper
; X64-AVX1OR2-NEXT: retq
Expand All @@ -1920,7 +1920,7 @@ define i16 @test_reduce_v16i16_v8i16(<16 x i16> %a0) {
; X64-AVX512-NEXT: vpxord {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX512-NEXT: vmovd %xmm0, %eax
; X64-AVX512-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX512-NEXT: vzeroupper
; X64-AVX512-NEXT: retq
Expand Down Expand Up @@ -1956,7 +1956,7 @@ define i16 @test_reduce_v32i16_v8i16(<32 x i16> %a0) {
; X86-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X86-SSE42-NEXT: movd %xmm0, %eax
; X86-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-SSE42-NEXT: retl
;
Expand All @@ -1965,7 +1965,7 @@ define i16 @test_reduce_v32i16_v8i16(<32 x i16> %a0) {
; X86-AVX-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX-NEXT: vphminposuw %xmm0, %xmm0
; X86-AVX-NEXT: vmovd %xmm0, %eax
; X86-AVX-NEXT: xorl $32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: addl $-32768, %eax ## imm = 0x8000
; X86-AVX-NEXT: ## kill: def $ax killed $ax killed $eax
; X86-AVX-NEXT: vzeroupper
; X86-AVX-NEXT: retl
Expand All @@ -1988,7 +1988,7 @@ define i16 @test_reduce_v32i16_v8i16(<32 x i16> %a0) {
; X64-SSE42-NEXT: pxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE42-NEXT: phminposuw %xmm0, %xmm0
; X64-SSE42-NEXT: movd %xmm0, %eax
; X64-SSE42-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-SSE42-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-SSE42-NEXT: retq
;
Expand All @@ -1997,7 +1997,7 @@ define i16 @test_reduce_v32i16_v8i16(<32 x i16> %a0) {
; X64-AVX1OR2-NEXT: vpxor {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vmovd %xmm0, %eax
; X64-AVX1OR2-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX1OR2-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX1OR2-NEXT: vzeroupper
; X64-AVX1OR2-NEXT: retq
Expand All @@ -2007,7 +2007,7 @@ define i16 @test_reduce_v32i16_v8i16(<32 x i16> %a0) {
; X64-AVX512-NEXT: vpxord {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
; X64-AVX512-NEXT: vphminposuw %xmm0, %xmm0
; X64-AVX512-NEXT: vmovd %xmm0, %eax
; X64-AVX512-NEXT: xorl $32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: addl $-32768, %eax ## imm = 0x8000
; X64-AVX512-NEXT: ## kill: def $ax killed $ax killed $eax
; X64-AVX512-NEXT: vzeroupper
; X64-AVX512-NEXT: retq
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/X86/is_fpclass-fp80.ll
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ define i1 @is_inf_f80(x86_fp80 %x) {
; CHECK-32-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: notl %eax
; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: addl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: andl $32767, %eax # imm = 0x7FFF
; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: orl %ecx, %eax
Expand All @@ -276,7 +276,7 @@ define i1 @is_posinf_f80(x86_fp80 %x) {
; CHECK-32: # %bb.0: # %entry
; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: addl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: xorl $32767, %eax # imm = 0x7FFF
; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: orl %ecx, %eax
Expand All @@ -303,7 +303,7 @@ define i1 @is_neginf_f80(x86_fp80 %x) {
; CHECK-32-NEXT: movzwl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: xorl $65535, %eax # imm = 0xFFFF
; CHECK-32-NEXT: movl $-2147483648, %ecx # imm = 0x80000000
; CHECK-32-NEXT: xorl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: addl {{[0-9]+}}(%esp), %ecx
; CHECK-32-NEXT: orl {{[0-9]+}}(%esp), %eax
; CHECK-32-NEXT: orl %ecx, %eax
; CHECK-32-NEXT: sete %al
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/X86/sadd_sat.ll
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ define signext i16 @func16(i16 signext %x, i16 signext %y) nounwind {
; X86-NEXT: addw %cx, %dx
; X86-NEXT: movswl %dx, %edx
; X86-NEXT: sarl $15, %edx
; X86-NEXT: xorl $-32768, %edx # imm = 0x8000
; X86-NEXT: addl $-32768, %edx # imm = 0x8000
; X86-NEXT: addw %cx, %ax
; X86-NEXT: cmovol %edx, %eax
; X86-NEXT: # kill: def $ax killed $ax killed $eax
Expand All @@ -89,7 +89,7 @@ define signext i16 @func16(i16 signext %x, i16 signext %y) nounwind {
; X64-NEXT: leal (%rdi,%rsi), %eax
; X64-NEXT: cwtl
; X64-NEXT: sarl $15, %eax
; X64-NEXT: xorl $-32768, %eax # imm = 0x8000
; X64-NEXT: addl $-32768, %eax # imm = 0x8000
; X64-NEXT: addw %si, %di
; X64-NEXT: cmovnol %edi, %eax
; X64-NEXT: # kill: def $ax killed $ax killed $eax
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/X86/sadd_sat_plus.ll
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ define signext i16 @func16(i16 signext %x, i16 signext %y, i16 signext %z) nounw
; X86-NEXT: addw %cx, %dx
; X86-NEXT: movswl %dx, %edx
; X86-NEXT: sarl $15, %edx
; X86-NEXT: xorl $-32768, %edx # imm = 0x8000
; X86-NEXT: addl $-32768, %edx # imm = 0x8000
; X86-NEXT: addw %cx, %ax
; X86-NEXT: cmovol %edx, %eax
; X86-NEXT: # kill: def $ax killed $ax killed $eax
Expand All @@ -94,7 +94,7 @@ define signext i16 @func16(i16 signext %x, i16 signext %y, i16 signext %z) nounw
; X64-NEXT: leal (%rdi,%rsi), %eax
; X64-NEXT: cwtl
; X64-NEXT: sarl $15, %eax
; X64-NEXT: xorl $-32768, %eax # imm = 0x8000
; X64-NEXT: addl $-32768, %eax # imm = 0x8000
; X64-NEXT: addw %si, %di
; X64-NEXT: cmovnol %edi, %eax
; X64-NEXT: # kill: def $ax killed $ax killed $eax
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/X86/sadd_sat_vec.ll
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ define void @v1i16(ptr %px, ptr %py, ptr %pz) nounwind {
; SSE-NEXT: leal (%rax,%rcx), %esi
; SSE-NEXT: movswl %si, %esi
; SSE-NEXT: sarl $15, %esi
; SSE-NEXT: xorl $-32768, %esi # imm = 0x8000
; SSE-NEXT: addl $-32768, %esi # imm = 0x8000
; SSE-NEXT: addw %cx, %ax
; SSE-NEXT: cmovol %esi, %eax
; SSE-NEXT: movw %ax, (%rdx)
Expand All @@ -482,7 +482,7 @@ define void @v1i16(ptr %px, ptr %py, ptr %pz) nounwind {
; AVX-NEXT: leal (%rax,%rcx), %esi
; AVX-NEXT: movswl %si, %esi
; AVX-NEXT: sarl $15, %esi
; AVX-NEXT: xorl $-32768, %esi # imm = 0x8000
; AVX-NEXT: addl $-32768, %esi # imm = 0x8000
; AVX-NEXT: addw %cx, %ax
; AVX-NEXT: cmovol %esi, %eax
; AVX-NEXT: movw %ax, (%rdx)
Expand Down
Loading