diff --git a/llvm/test/CodeGen/X86/andn-x-x.ll b/llvm/test/CodeGen/X86/andn-x-x.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/X86/andn-x-x.ll @@ -0,0 +1,46 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=x86_64-pc-linux-gnu | FileCheck %s + +define <2 x i64> @andnp_xx(<2 x i64> %v0) nounwind { +; CHECK-LABEL: andnp_xx: +; CHECK: # %bb.0: +; CHECK-NEXT: andnps %xmm0, %xmm0 +; CHECK-NEXT: retq + %x = xor <2 x i64> %v0, + %y = and <2 x i64> %v0, %x + ret <2 x i64> %y +} + +define <2 x i64> @andnp_xx_2(<2 x i64> %v0) nounwind { +; CHECK-LABEL: andnp_xx_2: +; CHECK: # %bb.0: +; CHECK-NEXT: andnps %xmm0, %xmm0 +; CHECK-NEXT: retq + %x = xor <2 x i64> %v0, + %y = and <2 x i64> %x, %v0 + ret <2 x i64> %y +} + +define i64 @andn_xx(i64 %v0) nounwind { +; CHECK-LABEL: andn_xx: +; CHECK: # %bb.0: +; CHECK-NEXT: movq %rdi, %rax +; CHECK-NEXT: notq %rax +; CHECK-NEXT: andq %rdi, %rax +; CHECK-NEXT: retq + %x = xor i64 %v0, -1 + %y = and i64 %v0, %x + ret i64 %y +} + +define i64 @andn_xx_2(i64 %v0) nounwind { +; CHECK-LABEL: andn_xx_2: +; CHECK: # %bb.0: +; CHECK-NEXT: movq %rdi, %rax +; CHECK-NEXT: notq %rax +; CHECK-NEXT: andq %rdi, %rax +; CHECK-NEXT: retq + %x = xor i64 %v0, -1 + %y = and i64 %x, %v0 + ret i64 %y +}