1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
4 ; SVE Logical Vector Immediate Unpredicated CodeGen
8 define <vscale x 16 x i8> @orr_i8(<vscale x 16 x i8> %a) {
10 ; CHECK: orr z0.b, z0.b, #0xf
12 %elt = insertelement <vscale x 16 x i8> undef, i8 15, i32 0
13 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
14 %res = or <vscale x 16 x i8> %a, %splat
15 ret <vscale x 16 x i8> %res
18 define <vscale x 8 x i16> @orr_i16(<vscale x 8 x i16> %a) {
19 ; CHECK-LABEL: orr_i16:
20 ; CHECK: orr z0.h, z0.h, #0xfc07
22 %elt = insertelement <vscale x 8 x i16> undef, i16 64519, i32 0
23 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
24 %res = or <vscale x 8 x i16> %a, %splat
25 ret <vscale x 8 x i16> %res
28 define <vscale x 4 x i32> @orr_i32(<vscale x 4 x i32> %a) {
29 ; CHECK-LABEL: orr_i32:
30 ; CHECK: orr z0.s, z0.s, #0xffff00
32 %elt = insertelement <vscale x 4 x i32> undef, i32 16776960, i32 0
33 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
34 %res = or <vscale x 4 x i32> %a, %splat
35 ret <vscale x 4 x i32> %res
38 define <vscale x 2 x i64> @orr_i64(<vscale x 2 x i64> %a) {
39 ; CHECK-LABEL: orr_i64:
40 ; CHECK: orr z0.d, z0.d, #0xfffc000000000000
42 %elt = insertelement <vscale x 2 x i64> undef, i64 18445618173802708992, i32 0
43 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
44 %res = or <vscale x 2 x i64> %a, %splat
45 ret <vscale x 2 x i64> %res
49 define <vscale x 16 x i8> @eor_i8(<vscale x 16 x i8> %a) {
50 ; CHECK-LABEL: eor_i8:
51 ; CHECK: eor z0.b, z0.b, #0xf
53 %elt = insertelement <vscale x 16 x i8> undef, i8 15, i32 0
54 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
55 %res = xor <vscale x 16 x i8> %a, %splat
56 ret <vscale x 16 x i8> %res
59 define <vscale x 8 x i16> @eor_i16(<vscale x 8 x i16> %a) {
60 ; CHECK-LABEL: eor_i16:
61 ; CHECK: eor z0.h, z0.h, #0xfc07
63 %elt = insertelement <vscale x 8 x i16> undef, i16 64519, i32 0
64 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
65 %res = xor <vscale x 8 x i16> %a, %splat
66 ret <vscale x 8 x i16> %res
69 define <vscale x 4 x i32> @eor_i32(<vscale x 4 x i32> %a) {
70 ; CHECK-LABEL: eor_i32:
71 ; CHECK: eor z0.s, z0.s, #0xffff00
73 %elt = insertelement <vscale x 4 x i32> undef, i32 16776960, i32 0
74 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
75 %res = xor <vscale x 4 x i32> %a, %splat
76 ret <vscale x 4 x i32> %res
79 define <vscale x 2 x i64> @eor_i64(<vscale x 2 x i64> %a) {
80 ; CHECK-LABEL: eor_i64:
81 ; CHECK: eor z0.d, z0.d, #0xfffc000000000000
83 %elt = insertelement <vscale x 2 x i64> undef, i64 18445618173802708992, i32 0
84 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
85 %res = xor <vscale x 2 x i64> %a, %splat
86 ret <vscale x 2 x i64> %res
90 define <vscale x 16 x i8> @and_i8(<vscale x 16 x i8> %a) {
91 ; CHECK-LABEL: and_i8:
92 ; CHECK: and z0.b, z0.b, #0xf
94 %elt = insertelement <vscale x 16 x i8> undef, i8 15, i32 0
95 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
96 %res = and <vscale x 16 x i8> %a, %splat
97 ret <vscale x 16 x i8> %res
100 define <vscale x 8 x i16> @and_i16(<vscale x 8 x i16> %a) {
101 ; CHECK-LABEL: and_i16:
102 ; CHECK: and z0.h, z0.h, #0xfc07
104 %elt = insertelement <vscale x 8 x i16> undef, i16 64519, i32 0
105 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
106 %res = and <vscale x 8 x i16> %a, %splat
107 ret <vscale x 8 x i16> %res
110 define <vscale x 4 x i32> @and_i32(<vscale x 4 x i32> %a) {
111 ; CHECK-LABEL: and_i32:
112 ; CHECK: and z0.s, z0.s, #0xffff00
114 %elt = insertelement <vscale x 4 x i32> undef, i32 16776960, i32 0
115 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
116 %res = and <vscale x 4 x i32> %a, %splat
117 ret <vscale x 4 x i32> %res
120 define <vscale x 2 x i64> @and_i64(<vscale x 2 x i64> %a) {
121 ; CHECK-LABEL: and_i64:
122 ; CHECK: and z0.d, z0.d, #0xfffc000000000000
124 %elt = insertelement <vscale x 2 x i64> undef, i64 18445618173802708992, i32 0
125 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
126 %res = and <vscale x 2 x i64> %a, %splat
127 ret <vscale x 2 x i64> %res