1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
10 define <vscale x 16 x i8> @bitreverse_i8(<vscale x 16 x i8> %a) #0 {
11 ; CHECK-LABEL: bitreverse_i8:
13 ; CHECK-NEXT: ptrue p0.b
14 ; CHECK-NEXT: rbit z0.b, p0/m, z0.b
16 %res = call <vscale x 16 x i8> @llvm.bitreverse.nxv16i8(<vscale x 16 x i8> %a)
17 ret <vscale x 16 x i8> %res
20 define <vscale x 8 x i16> @bitreverse_i16(<vscale x 8 x i16> %a) #0 {
21 ; CHECK-LABEL: bitreverse_i16:
23 ; CHECK-NEXT: ptrue p0.h
24 ; CHECK-NEXT: rbit z0.h, p0/m, z0.h
26 %res = call <vscale x 8 x i16> @llvm.bitreverse.nxv8i16(<vscale x 8 x i16> %a)
27 ret <vscale x 8 x i16> %res
30 define <vscale x 4 x i32> @bitreverse_i32(<vscale x 4 x i32> %a) #0 {
31 ; CHECK-LABEL: bitreverse_i32:
33 ; CHECK-NEXT: ptrue p0.s
34 ; CHECK-NEXT: rbit z0.s, p0/m, z0.s
36 %res = call <vscale x 4 x i32> @llvm.bitreverse.nxv4i32(<vscale x 4 x i32> %a)
37 ret <vscale x 4 x i32> %res
40 define <vscale x 2 x i64> @bitreverse_i64(<vscale x 2 x i64> %a) #0 {
41 ; CHECK-LABEL: bitreverse_i64:
43 ; CHECK-NEXT: ptrue p0.d
44 ; CHECK-NEXT: rbit z0.d, p0/m, z0.d
46 %res = call <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64> %a)
47 ret <vscale x 2 x i64> %res
54 define <vscale x 8 x i16> @byteswap_i16(<vscale x 8 x i16> %a) #0 {
55 ; CHECK-LABEL: byteswap_i16:
57 ; CHECK-NEXT: ptrue p0.h
58 ; CHECK-NEXT: revb z0.h, p0/m, z0.h
60 %res = call <vscale x 8 x i16> @llvm.bswap.nxv8i16(<vscale x 8 x i16> %a)
61 ret <vscale x 8 x i16> %res
64 define <vscale x 4 x i32> @byteswap_i32(<vscale x 4 x i32> %a) #0 {
65 ; CHECK-LABEL: byteswap_i32:
67 ; CHECK-NEXT: ptrue p0.s
68 ; CHECK-NEXT: revb z0.s, p0/m, z0.s
70 %res = call <vscale x 4 x i32> @llvm.bswap.nxv4i32(<vscale x 4 x i32> %a)
71 ret <vscale x 4 x i32> %res
74 define <vscale x 2 x i64> @byteswap_i64(<vscale x 2 x i64> %a) #0 {
75 ; CHECK-LABEL: byteswap_i64:
77 ; CHECK-NEXT: ptrue p0.d
78 ; CHECK-NEXT: revb z0.d, p0/m, z0.d
80 %res = call <vscale x 2 x i64> @llvm.bswap.nxv2i64(<vscale x 2 x i64> %a)
81 ret <vscale x 2 x i64> %res
84 attributes #0 = { "target-features"="+sve" }
86 declare <vscale x 16 x i8> @llvm.bitreverse.nxv16i8(<vscale x 16 x i8>)
87 declare <vscale x 8 x i16> @llvm.bitreverse.nxv8i16(<vscale x 8 x i16>)
88 declare <vscale x 4 x i32> @llvm.bitreverse.nxv4i32(<vscale x 4 x i32>)
89 declare <vscale x 2 x i64> @llvm.bitreverse.nxv2i64(<vscale x 2 x i64>)
91 declare <vscale x 8 x i16> @llvm.bswap.nxv8i16(<vscale x 8 x i16>)
92 declare <vscale x 4 x i32> @llvm.bswap.nxv4i32(<vscale x 4 x i32>)
93 declare <vscale x 2 x i64> @llvm.bswap.nxv2i64(<vscale x 2 x i64>)