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 i1> @rdffr() #0 {
13 ; CHECK-NEXT: rdffr p0.b
15 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.rdffr()
16 ret <vscale x 16 x i1> %out
19 define <vscale x 16 x i1> @rdffr_z(<vscale x 16 x i1> %pg) #0 {
20 ; CHECK-LABEL: rdffr_z:
22 ; CHECK-NEXT: rdffr p0.b, p0/z
24 %out = call <vscale x 16 x i1> @llvm.aarch64.sve.rdffr.z(<vscale x 16 x i1> %pg)
25 ret <vscale x 16 x i1> %out
28 ; Test that rdffr.z followed by ptest optimizes to flags-setting rdffrs.
29 define i1 @rdffr_z_ptest(<vscale x 16 x i1> %pg) #0 {
30 ; CHECK-LABEL: rdffr_z_ptest:
32 ; CHECK-NEXT: rdffrs p0.b, p0/z
33 ; CHECK-NEXT: cset w0, ne
35 %rdffr = call <vscale x 16 x i1> @llvm.aarch64.sve.rdffr.z(<vscale x 16 x i1> %pg)
36 %out = call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %pg, <vscale x 16 x i1> %rdffr)
44 define void @set_ffr() #0 {
45 ; CHECK-LABEL: set_ffr:
49 call void @llvm.aarch64.sve.setffr()
57 define void @wrffr(<vscale x 16 x i1> %a) #0 {
60 ; CHECK-NEXT: wrffr p0.b
62 call void @llvm.aarch64.sve.wrffr(<vscale x 16 x i1> %a)
66 declare <vscale x 16 x i1> @llvm.aarch64.sve.rdffr()
67 declare <vscale x 16 x i1> @llvm.aarch64.sve.rdffr.z(<vscale x 16 x i1>)
68 declare void @llvm.aarch64.sve.setffr()
69 declare void @llvm.aarch64.sve.wrffr(<vscale x 16 x i1>)
71 declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>)
73 attributes #0 = { "target-features"="+sve" }