1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-- -o - %s | FileCheck %s
4 define i32 @and_commute0(i32 %x, i32 %y) {
5 ; CHECK-LABEL: and_commute0:
7 ; CHECK-NEXT: and w0, w0, w1
14 define i128 @and_commute1(i128 %x, i128 %y) {
15 ; CHECK-LABEL: and_commute1:
17 ; CHECK-NEXT: and x1, x3, x1
18 ; CHECK-NEXT: and x0, x2, x0
25 define <4 x i32> @and_commute2(<4 x i32> %x, <4 x i32> %y) {
26 ; CHECK-LABEL: and_commute2:
28 ; CHECK-NEXT: and v0.16b, v0.16b, v1.16b
30 %b = and <4 x i32> %x, %y
31 %b2 = and <4 x i32> %b, %x
35 define <8 x i16> @and_commute3(<8 x i16> %x, <8 x i16> %y) {
36 ; CHECK-LABEL: and_commute3:
38 ; CHECK-NEXT: and v0.16b, v1.16b, v0.16b
40 %b = and <8 x i16> %y, %x
41 %b2 = and <8 x i16> %b, %x
45 define i16 @or_commute0(i16 %x, i16 %y) {
46 ; CHECK-LABEL: or_commute0:
48 ; CHECK-NEXT: orr w0, w0, w1
55 define i8 @or_commute1(i8 %x, i8 %y) {
56 ; CHECK-LABEL: or_commute1:
58 ; CHECK-NEXT: orr w0, w1, w0
65 define <2 x i64> @or_commute2(<2 x i64> %x, <2 x i64> %y) {
66 ; CHECK-LABEL: or_commute2:
68 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
70 %b = or <2 x i64> %x, %y
71 %b2 = or <2 x i64> %b, %x
75 define <8 x i64> @or_commute3(<8 x i64> %x, <8 x i64> %y) {
76 ; CHECK-LABEL: or_commute3:
78 ; CHECK-NEXT: orr v2.16b, v6.16b, v2.16b
79 ; CHECK-NEXT: orr v0.16b, v4.16b, v0.16b
80 ; CHECK-NEXT: orr v1.16b, v5.16b, v1.16b
81 ; CHECK-NEXT: orr v3.16b, v7.16b, v3.16b
83 %b = or <8 x i64> %y, %x
84 %b2 = or <8 x i64> %b, %x
88 define <16 x i8> @xor_commute0(<16 x i8> %x, <16 x i8> %y) {
89 ; CHECK-LABEL: xor_commute0:
91 ; CHECK-NEXT: mov v0.16b, v1.16b
93 %b = xor <16 x i8> %x, %y
94 %b2 = xor <16 x i8> %x, %b
98 define <8 x i32> @xor_commute1(<8 x i32> %x, <8 x i32> %y) {
99 ; CHECK-LABEL: xor_commute1:
101 ; CHECK-NEXT: mov v1.16b, v3.16b
102 ; CHECK-NEXT: mov v0.16b, v2.16b
104 %b = xor <8 x i32> %y, %x
105 %b2 = xor <8 x i32> %x, %b
109 define i64 @xor_commute2(i64 %x, i64 %y) {
110 ; CHECK-LABEL: xor_commute2:
112 ; CHECK-NEXT: mov x0, x1
119 define i78 @xor_commute3(i78 %x, i78 %y) {
120 ; CHECK-LABEL: xor_commute3:
122 ; CHECK-NEXT: mov x1, x3
123 ; CHECK-NEXT: mov x0, x2