Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/test/CodeGen/X86/not-and-simplify.ll
Show All 14 Lines | ; ALL-NEXT: retq | ||||
%not = xor i32 %sh, -1 | %not = xor i32 %sh, -1 | ||||
%and = and i32 %not, 1 | %and = and i32 %not, 1 | ||||
ret i32 %and | ret i32 %and | ||||
} | } | ||||
define <4 x i32> @shrink_xor_constant1_splat(<4 x i32> %x) { | define <4 x i32> @shrink_xor_constant1_splat(<4 x i32> %x) { | ||||
; ALL-LABEL: shrink_xor_constant1_splat: | ; ALL-LABEL: shrink_xor_constant1_splat: | ||||
; ALL: # %bb.0: | ; ALL: # %bb.0: | ||||
; ALL-NEXT: pcmpeqd %xmm1, %xmm1 | |||||
; ALL-NEXT: pxor %xmm1, %xmm0 | |||||
; ALL-NEXT: psrld $31, %xmm0 | ; ALL-NEXT: psrld $31, %xmm0 | ||||
; ALL-NEXT: pxor {{.*}}(%rip), %xmm0 | |||||
; ALL-NEXT: retq | ; ALL-NEXT: retq | ||||
%sh = lshr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31> | %sh = lshr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31> | ||||
%not = xor <4 x i32> %sh, <i32 -1, i32 -1, i32 -1, i32 -1> | %not = xor <4 x i32> %sh, <i32 -1, i32 -1, i32 -1, i32 -1> | ||||
%and = and <4 x i32> %not, <i32 1, i32 1, i32 1, i32 1> | %and = and <4 x i32> %not, <i32 1, i32 1, i32 1, i32 1> | ||||
ret <4 x i32> %and | ret <4 x i32> %and | ||||
} | } | ||||
; Clear low bits via shift, set them with xor (not), then mask them off. | ; Clear low bits via shift, set them with xor (not), then mask them off. | ||||
Show All 26 Lines |