forked from OSchip/llvm-project
[SveEmitter] Add builtins for FFR manipulation
This patch adds builtins for: - svrdffr, svrdffr_z - svsetffr - svwrffr
This commit is contained in:
parent
91cb13f90d
commit
ac894a5181
|
@ -1137,6 +1137,14 @@ def SVPTEST_ANY : SInst<"svptest_any", "sPP", "Pc", MergeNone, "aarch64_sve_
|
|||
def SVPTEST_FIRST : SInst<"svptest_first", "sPP", "Pc", MergeNone, "aarch64_sve_ptest_first">;
|
||||
def SVPTEST_LAST : SInst<"svptest_last", "sPP", "Pc", MergeNone, "aarch64_sve_ptest_last">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// FFR manipulation
|
||||
|
||||
def SVRDFFR : SInst<"svrdffr", "P", "Pc", MergeNone, "", [IsOverloadNone]>;
|
||||
def SVRDFFR_Z : SInst<"svrdffr_z", "PP", "Pc", MergeNone, "", [IsOverloadNone]>;
|
||||
def SVSETFFR : SInst<"svsetffr", "v", "", MergeNone, "", [IsOverloadNone]>;
|
||||
def SVWRFFR : SInst<"svwrffr", "vP", "Pc", MergeNone, "", [IsOverloadNone]>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Counting elements
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
#include <arm_sve.h>
|
||||
|
||||
svbool_t test_svrdffr()
|
||||
{
|
||||
// CHECK-LABEL: test_svrdffr
|
||||
// CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.rdffr()
|
||||
// CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
|
||||
return svrdffr();
|
||||
}
|
||||
|
||||
svbool_t test_svrdffr_z(svbool_t pg)
|
||||
{
|
||||
// CHECK-LABEL: test_svrdffr_z
|
||||
// CHECK: %[[INTRINSIC:.*]] = call <vscale x 16 x i1> @llvm.aarch64.sve.rdffr.z(<vscale x 16 x i1> %pg)
|
||||
// CHECK: ret <vscale x 16 x i1> %[[INTRINSIC]]
|
||||
return svrdffr_z(pg);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
#include <arm_sve.h>
|
||||
|
||||
void test_svsetffr()
|
||||
{
|
||||
// CHECK-LABEL: test_svsetffr
|
||||
// CHECK: call void @llvm.aarch64.sve.setffr()
|
||||
// CHECK: ret void
|
||||
svsetffr();
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
#include <arm_sve.h>
|
||||
|
||||
void test_svwrffr(svbool_t op)
|
||||
{
|
||||
// CHECK-LABEL: test_svwrffr
|
||||
// CHECK: call void @llvm.aarch64.sve.wrffr(<vscale x 16 x i1> %op)
|
||||
// CHECK: ret void
|
||||
svwrffr(op);
|
||||
}
|
Loading…
Reference in New Issue