1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
4 define i32 @PR39657(i8* %p, i64 %x) {
5 ; CHECK-LABEL: PR39657:
7 ; CHECK-NEXT: mvn x8, x1
8 ; CHECK-NEXT: ldr w0, [x0, x8, lsl #2]
11 %mul = xor i64 %sh, -4
12 %add.ptr = getelementptr inbounds i8, i8* %p, i64 %mul
13 %bc = bitcast i8* %add.ptr to i32*
14 %load = load i32, i32* %bc, align 4
18 define i32 @add_of_not(i32 %x, i32 %y) {
19 ; CHECK-LABEL: add_of_not:
21 ; CHECK-NEXT: mvn w8, w1
22 ; CHECK-NEXT: add w0, w8, w0
29 define i32 @add_of_not_decrement(i32 %x, i32 %y) {
30 ; CHECK-LABEL: add_of_not_decrement:
32 ; CHECK-NEXT: mvn w8, w1
33 ; CHECK-NEXT: add w0, w8, w0
40 define <4 x i32> @vec_add_of_not(<4 x i32> %x, <4 x i32> %y) {
41 ; CHECK-LABEL: vec_add_of_not:
43 ; CHECK-NEXT: mvn v1.16b, v1.16b
44 ; CHECK-NEXT: add v0.4s, v1.4s, v0.4s
46 %t0 = sub <4 x i32> %x, %y
47 %r = add <4 x i32> %t0, <i32 -1, i32 -1, i32 -1, i32 -1>
51 define <4 x i32> @vec_add_of_not_decrement(<4 x i32> %x, <4 x i32> %y) {
52 ; CHECK-LABEL: vec_add_of_not_decrement:
54 ; CHECK-NEXT: mvn v1.16b, v1.16b
55 ; CHECK-NEXT: add v0.4s, v1.4s, v0.4s
57 %t0 = sub <4 x i32> %x, %y
58 %r = sub <4 x i32> %t0, <i32 1, i32 1, i32 1, i32 1>
62 define <4 x i32> @vec_add_of_not_with_undef(<4 x i32> %x, <4 x i32> %y) {
63 ; CHECK-LABEL: vec_add_of_not_with_undef:
65 ; CHECK-NEXT: sub v0.4s, v0.4s, v1.4s
66 ; CHECK-NEXT: movi v1.2d, #0xffffffffffffffff
67 ; CHECK-NEXT: add v0.4s, v0.4s, v1.4s
69 %t0 = sub <4 x i32> %x, %y
70 %r = add <4 x i32> %t0, <i32 -1, i32 undef, i32 -1, i32 -1>
74 define <4 x i32> @vec_add_of_not_with_undef_decrement(<4 x i32> %x, <4 x i32> %y) {
75 ; CHECK-LABEL: vec_add_of_not_with_undef_decrement:
77 ; CHECK-NEXT: sub v0.4s, v0.4s, v1.4s
78 ; CHECK-NEXT: movi v1.4s, #1
79 ; CHECK-NEXT: add v0.4s, v0.4s, v1.4s
81 %t0 = sub <4 x i32> %x, %y
82 %r = add <4 x i32> %t0, <i32 1, i32 undef, i32 1, i32 1>