[clang] [AArch64][SME]Update intrinsic interface for ld1/st1 (PR #65582)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 01:46:56 PDT 2023


https://github.com/CarolineConcatto created https://github.com/llvm/llvm-project/pull/65582:

The new ACLE PR#225[1] now combines the slice parameters for some builtins. This patch is the #1 of 3 patches to update the interface.

Slice specifies the ZA slice number directly and needs to be explicity implemented by the "user" with the base register plus the immediate offset

[1]https://github.com/ARM-software/acle/pull/225/files

>From ae2f1bee2d912895cecb002c2434ef11da7ba3a7 Mon Sep 17 00:00:00 2001
From: Caroline Concatto <caroline.concatto at arm.com>
Date: Wed, 6 Sep 2023 14:16:17 +0000
Subject: [PATCH] [AArch64][SME]Update intrinsic interface for ld1/st1

The new ACLE PR#225[1] now combines the slice parameters for some builtins.
This patch is the #1 of 3 patches to update the interface.

Slice specifies the ZA slice number directly and needs to be
explicity implemented by the "user" with the base register plus the
immediate offset

[1]https://github.com/ARM-software/acle/pull/225/files
---
 clang/include/clang/Basic/arm_sme.td          |  36 +++----
 clang/lib/CodeGen/CGBuiltin.cpp               |  16 +--
 .../aarch64-sme-intrinsics/acle_sme_ld1.c     |  58 ++++++----
 .../acle_sme_ld1_vnum.c                       |  58 ++++++----
 .../aarch64-sme-intrinsics/acle_sme_st1.c     |  58 ++++++----
 .../acle_sme_st1_vnum.c                       |  58 ++++++----
 .../aarch64-sme-intrinsics/acle_sme_imm.cpp   | 102 +++++-------------
 .../aarch64-sme-intrinsics/acle_sme_target.c  |   8 +-
 8 files changed, 211 insertions(+), 183 deletions(-)

diff --git a/clang/include/clang/Basic/arm_sme.td b/clang/include/clang/Basic/arm_sme.td
index f747ccde38a3a15..58471c3dc8dd0d5 100644
--- a/clang/include/clang/Basic/arm_sme.td
+++ b/clang/include/clang/Basic/arm_sme.td
@@ -20,29 +20,29 @@ include "arm_sve_sme_incl.td"
 
 multiclass ZALoad<string n_suffix, string t, string i_prefix, list<ImmCheck> ch> {
   let TargetGuard = "sme" in {
-    def NAME # _H : MInst<"svld1_hor_" # n_suffix, "vimiPQ", t,
+    def NAME # _H : MInst<"svld1_hor_" # n_suffix, "vimPQ", t,
                           [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA],
                           MemEltTyDefault, i_prefix # "_horiz", ch>;
 
-    def NAME # _H_VNUM : MInst<"svld1_hor_vnum_" # n_suffix, "vimiPQl", t,
+    def NAME # _H_VNUM : MInst<"svld1_hor_vnum_" # n_suffix, "vimPQl", t,
                                [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA],
                                MemEltTyDefault, i_prefix # "_horiz", ch>;
 
-    def NAME # _V : MInst<"svld1_ver_" # n_suffix, "vimiPQ", t,
+    def NAME # _V : MInst<"svld1_ver_" # n_suffix, "vimPQ", t,
                           [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA],
                           MemEltTyDefault, i_prefix # "_vert", ch>;
 
-    def NAME # _V_VNUM : MInst<"svld1_ver_vnum_" # n_suffix, "vimiPQl", t,
+    def NAME # _V_VNUM : MInst<"svld1_ver_vnum_" # n_suffix, "vimPQl", t,
                                [IsLoad, IsOverloadNone, IsStreaming, IsSharedZA],
                                MemEltTyDefault, i_prefix # "_vert", ch>;
   }
 }
 
-defm SVLD1_ZA8 : ZALoad<"za8", "c", "aarch64_sme_ld1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>;
-defm SVLD1_ZA16 : ZALoad<"za16", "s", "aarch64_sme_ld1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>;
-defm SVLD1_ZA32 : ZALoad<"za32", "i", "aarch64_sme_ld1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>;
-defm SVLD1_ZA64 : ZALoad<"za64", "l", "aarch64_sme_ld1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>;
-defm SVLD1_ZA128 : ZALoad<"za128", "q", "aarch64_sme_ld1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>;
+defm SVLD1_ZA8 : ZALoad<"za8", "c", "aarch64_sme_ld1b", [ImmCheck<0, ImmCheck0_0>]>;
+defm SVLD1_ZA16 : ZALoad<"za16", "s", "aarch64_sme_ld1h", [ImmCheck<0, ImmCheck0_1>]>;
+defm SVLD1_ZA32 : ZALoad<"za32", "i", "aarch64_sme_ld1w", [ImmCheck<0, ImmCheck0_3>]>;
+defm SVLD1_ZA64 : ZALoad<"za64", "l", "aarch64_sme_ld1d", [ImmCheck<0, ImmCheck0_7>]>;
+defm SVLD1_ZA128 : ZALoad<"za128", "q", "aarch64_sme_ld1q", [ImmCheck<0, ImmCheck0_15>]>;
 
 def SVLDR_VNUM_ZA : MInst<"svldr_vnum_za", "vmiQ", "",
                           [IsOverloadNone, IsStreamingCompatible, IsSharedZA],
@@ -54,29 +54,29 @@ def SVLDR_VNUM_ZA : MInst<"svldr_vnum_za", "vmiQ", "",
 
 multiclass ZAStore<string n_suffix, string t, string i_prefix, list<ImmCheck> ch> {
   let TargetGuard = "sme" in {
-    def NAME # _H : MInst<"svst1_hor_" # n_suffix, "vimiP%", t,
+    def NAME # _H : MInst<"svst1_hor_" # n_suffix, "vimP%", t,
                           [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA],
                           MemEltTyDefault, i_prefix # "_horiz", ch>;
 
-    def NAME # _H_VNUM : MInst<"svst1_hor_vnum_" # n_suffix, "vimiP%l", t,
+    def NAME # _H_VNUM : MInst<"svst1_hor_vnum_" # n_suffix, "vimP%l", t,
                                [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA],
                                MemEltTyDefault, i_prefix # "_horiz", ch>;
 
-    def NAME # _V : MInst<"svst1_ver_" # n_suffix, "vimiP%", t,
+    def NAME # _V : MInst<"svst1_ver_" # n_suffix, "vimP%", t,
                           [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA],
                           MemEltTyDefault, i_prefix # "_vert", ch>;
 
-    def NAME # _V_VNUM : MInst<"svst1_ver_vnum_" # n_suffix, "vimiP%l", t,
+    def NAME # _V_VNUM : MInst<"svst1_ver_vnum_" # n_suffix, "vimP%l", t,
                                [IsStore, IsOverloadNone, IsStreaming, IsSharedZA, IsPreservesZA],
                                MemEltTyDefault, i_prefix # "_vert", ch>;
   }
 }
 
-defm SVST1_ZA8 : ZAStore<"za8", "c", "aarch64_sme_st1b", [ImmCheck<0, ImmCheck0_0>, ImmCheck<2, ImmCheck0_15>]>;
-defm SVST1_ZA16 : ZAStore<"za16", "s", "aarch64_sme_st1h", [ImmCheck<0, ImmCheck0_1>, ImmCheck<2, ImmCheck0_7>]>;
-defm SVST1_ZA32 : ZAStore<"za32", "i", "aarch64_sme_st1w", [ImmCheck<0, ImmCheck0_3>, ImmCheck<2, ImmCheck0_3>]>;
-defm SVST1_ZA64 : ZAStore<"za64", "l", "aarch64_sme_st1d", [ImmCheck<0, ImmCheck0_7>, ImmCheck<2, ImmCheck0_1>]>;
-defm SVST1_ZA128 : ZAStore<"za128", "q", "aarch64_sme_st1q", [ImmCheck<0, ImmCheck0_15>, ImmCheck<2, ImmCheck0_0>]>;
+defm SVST1_ZA8 : ZAStore<"za8", "c", "aarch64_sme_st1b", [ImmCheck<0, ImmCheck0_0>]>;
+defm SVST1_ZA16 : ZAStore<"za16", "s", "aarch64_sme_st1h", [ImmCheck<0, ImmCheck0_1>]>;
+defm SVST1_ZA32 : ZAStore<"za32", "i", "aarch64_sme_st1w", [ImmCheck<0, ImmCheck0_3>]>;
+defm SVST1_ZA64 : ZAStore<"za64", "l", "aarch64_sme_st1d", [ImmCheck<0, ImmCheck0_7>]>;
+defm SVST1_ZA128 : ZAStore<"za128", "q", "aarch64_sme_st1q", [ImmCheck<0, ImmCheck0_15>]>;
 
 def SVSTR_VNUM_ZA : MInst<"svstr_vnum_za", "vmi%", "",
                           [IsOverloadNone, IsStreamingCompatible, IsSharedZA, IsPreservesZA],
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index a513eae46e358e5..7abe184b096b77e 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -9519,29 +9519,29 @@ Value *CodeGenFunction::EmitTileslice(Value *Offset, Value *Base) {
 Value *CodeGenFunction::EmitSMELd1St1(const SVETypeFlags &TypeFlags,
                                       SmallVectorImpl<Value *> &Ops,
                                       unsigned IntID) {
-  Ops[3] = EmitSVEPredicateCast(
-      Ops[3], getSVEVectorForElementType(SVEBuiltinMemEltTy(TypeFlags)));
+  Ops[2] = EmitSVEPredicateCast(
+      Ops[2], getSVEVectorForElementType(SVEBuiltinMemEltTy(TypeFlags)));
 
   SmallVector<Value *> NewOps;
-  NewOps.push_back(Ops[3]);
+  NewOps.push_back(Ops[2]);
 
-  llvm::Value *BasePtr = Ops[4];
+  llvm::Value *BasePtr = Ops[3];
 
   // If the intrinsic contains the vnum parameter, multiply it with the vector
   // size in bytes.
-  if (Ops.size() == 6) {
+  if (Ops.size() == 5) {
     Function *StreamingVectorLength =
         CGM.getIntrinsic(Intrinsic::aarch64_sme_cntsb);
     llvm::Value *StreamingVectorLengthCall =
         Builder.CreateCall(StreamingVectorLength);
     llvm::Value *Mulvl =
-        Builder.CreateMul(StreamingVectorLengthCall, Ops[5], "mulvl");
+        Builder.CreateMul(StreamingVectorLengthCall, Ops[4], "mulvl");
     // The type of the ptr parameter is void *, so use Int8Ty here.
-    BasePtr = Builder.CreateGEP(Int8Ty, Ops[4], Mulvl);
+    BasePtr = Builder.CreateGEP(Int8Ty, Ops[3], Mulvl);
   }
   NewOps.push_back(BasePtr);
   NewOps.push_back(Ops[0]);
-  NewOps.push_back(EmitTileslice(Ops[2], Ops[1]));
+  NewOps.push_back(Ops[1]);
   Function *F = CGM.getIntrinsic(IntID);
   return Builder.CreateCall(F, NewOps);
 }
diff --git a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1.c b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1.c
index c309bde627f7df2..d88f583011d1139 100644
--- a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1.c
+++ b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1.c
@@ -20,8 +20,10 @@
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_za8(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_hor_za8(0, slice_base, 0, pg, ptr);
-  svld1_hor_za8(0, slice_base, 15, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_hor_za8(0, slice, pg, ptr);
+  slice = slice_base + 15;
+  svld1_hor_za8(0, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_za16(
@@ -34,8 +36,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_za8(uint32_t slice_base, svbool_t pg, con
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_za16(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_hor_za16(0, slice_base, 0, pg, ptr);
-  svld1_hor_za16(1, slice_base, 7, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_hor_za16(0, slice, pg, ptr);
+  slice = slice_base + 7;
+  svld1_hor_za16(1, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_za32(
@@ -48,8 +52,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_za16(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_za32(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_hor_za32(0, slice_base, 0, pg, ptr);
-  svld1_hor_za32(3, slice_base, 3, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_hor_za32(0, slice, pg, ptr);
+  slice = slice_base + 3;
+  svld1_hor_za32(3, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_za64(
@@ -62,8 +68,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_za32(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_za64(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_hor_za64(0, slice_base, 0, pg, ptr);
-  svld1_hor_za64(7, slice_base, 1, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_hor_za64(0, slice, pg, ptr);
+  slice = slice_base + 1;
+  svld1_hor_za64(7, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_za128(
@@ -75,8 +83,9 @@ ARM_STREAMING_ATTR void test_svld1_hor_za64(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_za128(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_hor_za128(0, slice_base, 0, pg, ptr);
-  svld1_hor_za128(15, slice_base, 0, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_hor_za128(0, slice, pg, ptr);
+  svld1_hor_za128(15, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL: @test_svld1_ver_za8(
@@ -88,8 +97,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_za128(uint32_t slice_base, svbool_t pg, c
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_za8(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_ver_za8(0, slice_base, 0, pg, ptr);
-  svld1_ver_za8(0, slice_base, 15, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_ver_za8(0, slice, pg, ptr);
+  slice = slice_base + 15;
+  svld1_ver_za8(0, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_za16(
@@ -102,8 +113,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_za8(uint32_t slice_base, svbool_t pg, con
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_za16(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_ver_za16(0, slice_base, 0, pg, ptr);
-  svld1_ver_za16(1, slice_base, 7, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_ver_za16(0, slice, pg, ptr);
+  slice = slice_base + 7;
+  svld1_ver_za16(1, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_za32(
@@ -116,8 +129,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_za16(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_za32(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_ver_za32(0, slice_base, 0, pg, ptr);
-  svld1_ver_za32(3, slice_base, 3, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_ver_za32(0, slice, pg, ptr);
+  slice = slice_base + 3;
+  svld1_ver_za32(3, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_za64(
@@ -130,8 +145,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_za32(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_za64(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_ver_za64(0, slice_base, 0, pg, ptr);
-  svld1_ver_za64(7, slice_base, 1, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_ver_za64(0, slice, pg, ptr);
+  slice = slice_base + 1;
+  svld1_ver_za64(7, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_za128(
@@ -143,6 +160,7 @@ ARM_STREAMING_ATTR void test_svld1_ver_za64(uint32_t slice_base, svbool_t pg, co
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_za128(uint32_t slice_base, svbool_t pg, const void *ptr) {
-  svld1_ver_za128(0, slice_base, 0, pg, ptr);
-  svld1_ver_za128(15, slice_base, 0, pg, ptr);
+  uint32_t slice = slice_base;
+  svld1_ver_za128(0, slice, pg, ptr);
+  svld1_ver_za128(15, slice, pg, ptr);
 }
diff --git a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1_vnum.c b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1_vnum.c
index 6c80ef55f81895d..8459358c4132ee8 100644
--- a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1_vnum.c
+++ b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_ld1_vnum.c
@@ -23,8 +23,10 @@
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_vnum_za8(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_hor_vnum_za8(0, slice_base, 0, pg, ptr, vnum);
-  svld1_hor_vnum_za8(0, slice_base, 15, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_hor_vnum_za8(0, slice, pg, ptr, vnum);
+  slice = slice_base + 15;
+  svld1_hor_vnum_za8(0, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_vnum_za16(
@@ -40,8 +42,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_vnum_za8(uint32_t slice_base, svbool_t pg
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_vnum_za16(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_hor_vnum_za16(0, slice_base, 0, pg, ptr, vnum);
-  svld1_hor_vnum_za16(1, slice_base, 7, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_hor_vnum_za16(0, slice, pg, ptr, vnum);
+  slice = slice_base + 7;
+  svld1_hor_vnum_za16(1, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_vnum_za32(
@@ -57,8 +61,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_vnum_za16(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_vnum_za32(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_hor_vnum_za32(0, slice_base, 0, pg, ptr, vnum);
-  svld1_hor_vnum_za32(3, slice_base, 3, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_hor_vnum_za32(0, slice, pg, ptr, vnum);
+  slice = slice_base + 3;
+  svld1_hor_vnum_za32(3, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_vnum_za64(
@@ -74,8 +80,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_vnum_za32(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_vnum_za64(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_hor_vnum_za64(0, slice_base, 0, pg, ptr, vnum);
-  svld1_hor_vnum_za64(7, slice_base, 1, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_hor_vnum_za64(0, slice, pg, ptr, vnum);
+  slice = slice_base + 1;
+  svld1_hor_vnum_za64(7, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_hor_vnum_za128(
@@ -90,8 +98,9 @@ ARM_STREAMING_ATTR void test_svld1_hor_vnum_za64(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_hor_vnum_za128(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_hor_vnum_za128(0, slice_base, 0, pg, ptr, vnum);
-  svld1_hor_vnum_za128(15, slice_base, 0, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_hor_vnum_za128(0, slice, pg, ptr, vnum);
+  svld1_hor_vnum_za128(15, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_hor_za8(
@@ -106,8 +115,10 @@ ARM_STREAMING_ATTR void test_svld1_hor_vnum_za128(uint32_t slice_base, svbool_t
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_hor_za8(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_ver_vnum_za8(0, slice_base, 0, pg, ptr, vnum);
-  svld1_ver_vnum_za8(0, slice_base, 15, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_ver_vnum_za8(0, slice, pg, ptr, vnum);
+  slice = slice_base + 15;
+  svld1_ver_vnum_za8(0, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_vnum_za16(
@@ -123,8 +134,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_hor_za8(uint32_t slice_base, svbool_t pg,
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_vnum_za16(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_ver_vnum_za16(0, slice_base, 0, pg, ptr, vnum);
-  svld1_ver_vnum_za16(1, slice_base, 7, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_ver_vnum_za16(0, slice, pg, ptr, vnum);
+  slice = slice_base + 7;
+  svld1_ver_vnum_za16(1, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_vnum_za32(
@@ -140,8 +153,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_vnum_za16(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_vnum_za32(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_ver_vnum_za32(0, slice_base, 0, pg, ptr, vnum);
-  svld1_ver_vnum_za32(3, slice_base, 3, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_ver_vnum_za32(0, slice, pg, ptr, vnum);
+  slice = slice_base + 3;
+  svld1_ver_vnum_za32(3, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_vnum_za64(
@@ -157,8 +172,10 @@ ARM_STREAMING_ATTR void test_svld1_ver_vnum_za32(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_vnum_za64(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_ver_vnum_za64(0, slice_base, 0, pg, ptr, vnum);
-  svld1_ver_vnum_za64(7, slice_base, 1, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_ver_vnum_za64(0, slice, pg, ptr, vnum);
+  slice = slice_base + 1;
+  svld1_ver_vnum_za64(7, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svld1_ver_vnum_za128(
@@ -173,6 +190,7 @@ ARM_STREAMING_ATTR void test_svld1_ver_vnum_za64(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svld1_ver_vnum_za128(uint32_t slice_base, svbool_t pg, const void *ptr, int64_t vnum) {
-  svld1_ver_vnum_za128(0, slice_base, 0, pg, ptr, vnum);
-  svld1_ver_vnum_za128(15, slice_base, 0, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svld1_ver_vnum_za128(0, slice, pg, ptr, vnum);
+  svld1_ver_vnum_za128(15, slice, pg, ptr, vnum);
 }
diff --git a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1.c b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1.c
index 067745f7d4a0592..744f3325d4b932e 100644
--- a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1.c
+++ b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1.c
@@ -20,8 +20,10 @@
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_za8(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_hor_za8(0, slice_base, 0, pg, ptr);
-  svst1_hor_za8(0, slice_base, 15, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_hor_za8(0, slice, pg, ptr);
+  slice = slice_base + 15;
+  svst1_hor_za8(0, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_za16(
@@ -34,8 +36,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_za8(uint32_t slice_base, svbool_t pg, voi
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_za16(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_hor_za16(0, slice_base, 0, pg, ptr);
-  svst1_hor_za16(1, slice_base, 7, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_hor_za16(0, slice, pg, ptr);
+  slice = slice_base + 7;
+  svst1_hor_za16(1, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_za32(
@@ -48,8 +52,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_za16(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_za32(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_hor_za32(0, slice_base, 0, pg, ptr);
-  svst1_hor_za32(3, slice_base, 3, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_hor_za32(0, slice, pg, ptr);
+  slice = slice_base + 3;
+  svst1_hor_za32(3, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_za64(
@@ -62,8 +68,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_za32(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_za64(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_hor_za64(0, slice_base, 0, pg, ptr);
-  svst1_hor_za64(7, slice_base, 1, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_hor_za64(0, slice, pg, ptr);
+  slice = slice_base + 1;
+  svst1_hor_za64(7, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_za128(
@@ -75,8 +83,9 @@ ARM_STREAMING_ATTR void test_svst1_hor_za64(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_za128(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_hor_za128(0, slice_base, 0, pg, ptr);
-  svst1_hor_za128(15, slice_base, 0, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_hor_za128(0, slice, pg, ptr);
+  svst1_hor_za128(15, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_za8(
@@ -88,8 +97,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_za128(uint32_t slice_base, svbool_t pg, v
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_za8(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_ver_za8(0, slice_base, 0, pg, ptr);
-  svst1_ver_za8(0, slice_base, 15, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_ver_za8(0, slice, pg, ptr);
+  slice = slice_base + 15;
+  svst1_ver_za8(0, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_za16(
@@ -102,8 +113,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_za8(uint32_t slice_base, svbool_t pg, voi
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_za16(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_ver_za16(0, slice_base, 0, pg, ptr);
-  svst1_ver_za16(1, slice_base, 7, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_ver_za16(0, slice, pg, ptr);
+  slice = slice_base + 7;
+  svst1_ver_za16(1, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_za32(
@@ -116,8 +129,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_za16(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_za32(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_ver_za32(0, slice_base, 0, pg, ptr);
-  svst1_ver_za32(3, slice_base, 3, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_ver_za32(0, slice, pg, ptr);
+  slice = slice_base + 3;
+  svst1_ver_za32(3, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_za64(
@@ -130,8 +145,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_za32(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_za64(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_ver_za64(0, slice_base, 0, pg, ptr);
-  svst1_ver_za64(7, slice_base, 1, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_ver_za64(0, slice, pg, ptr);
+  slice = slice_base + 1;
+  svst1_ver_za64(7, slice, pg, ptr);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_za128(
@@ -143,6 +160,7 @@ ARM_STREAMING_ATTR void test_svst1_ver_za64(uint32_t slice_base, svbool_t pg, vo
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_za128(uint32_t slice_base, svbool_t pg, void *ptr) {
-  svst1_ver_za128(0, slice_base, 0, pg, ptr);
-  svst1_ver_za128(15, slice_base, 0, pg, ptr);
+  uint32_t slice = slice_base;
+  svst1_ver_za128(0, slice, pg, ptr);
+  svst1_ver_za128(15, slice, pg, ptr);
 }
diff --git a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1_vnum.c b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1_vnum.c
index 4af93ac38dcca75..0353967a60ed057 100644
--- a/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1_vnum.c
+++ b/clang/test/CodeGen/aarch64-sme-intrinsics/acle_sme_st1_vnum.c
@@ -23,8 +23,10 @@
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_vnum_za8(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_hor_vnum_za8(0, slice_base, 0, pg, ptr, vnum);
-  svst1_hor_vnum_za8(0, slice_base, 15, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_hor_vnum_za8(0, slice, pg, ptr, vnum);
+  slice = slice_base + 15;
+  svst1_hor_vnum_za8(0, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_vnum_za16(
@@ -40,8 +42,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_vnum_za8(uint32_t slice_base, svbool_t pg
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_vnum_za16(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_hor_vnum_za16(0, slice_base, 0, pg, ptr, vnum);
-  svst1_hor_vnum_za16(1, slice_base, 7, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_hor_vnum_za16(0, slice, pg, ptr, vnum);
+  slice = slice_base + 7;
+  svst1_hor_vnum_za16(1, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_vnum_za32(
@@ -57,8 +61,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_vnum_za16(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_vnum_za32(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_hor_vnum_za32(0, slice_base, 0, pg, ptr, vnum);
-  svst1_hor_vnum_za32(3, slice_base, 3, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_hor_vnum_za32(0, slice, pg, ptr, vnum);
+  slice = slice_base + 3;
+  svst1_hor_vnum_za32(3, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_vnum_za64(
@@ -74,8 +80,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_vnum_za32(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_vnum_za64(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_hor_vnum_za64(0, slice_base, 0, pg, ptr, vnum);
-  svst1_hor_vnum_za64(7, slice_base, 1, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_hor_vnum_za64(0, slice, pg, ptr, vnum);
+  slice = slice_base + 1;
+  svst1_hor_vnum_za64(7, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_hor_vnum_za128(
@@ -90,8 +98,9 @@ ARM_STREAMING_ATTR void test_svst1_hor_vnum_za64(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_hor_vnum_za128(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_hor_vnum_za128(0, slice_base, 0, pg, ptr, vnum);
-  svst1_hor_vnum_za128(15, slice_base, 0, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_hor_vnum_za128(0, slice, pg, ptr, vnum);
+  svst1_hor_vnum_za128(15, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_vnum_za8(
@@ -106,8 +115,10 @@ ARM_STREAMING_ATTR void test_svst1_hor_vnum_za128(uint32_t slice_base, svbool_t
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_vnum_za8(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_ver_vnum_za8(0, slice_base, 0, pg, ptr, vnum);
-  svst1_ver_vnum_za8(0, slice_base, 15, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_ver_vnum_za8(0, slice, pg, ptr, vnum);
+  slice = slice_base + 15;
+  svst1_ver_vnum_za8(0, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_vnum_za16(
@@ -123,8 +134,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za8(uint32_t slice_base, svbool_t pg
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_vnum_za16(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_ver_vnum_za16(0, slice_base, 0, pg, ptr, vnum);
-  svst1_ver_vnum_za16(1, slice_base, 7, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_ver_vnum_za16(0, slice, pg, ptr, vnum);
+  slice = slice_base + 7;
+  svst1_ver_vnum_za16(1, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_vnum_za32(
@@ -140,8 +153,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za16(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_vnum_za32(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_ver_vnum_za32(0, slice_base, 0, pg, ptr, vnum);
-  svst1_ver_vnum_za32(3, slice_base, 3, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_ver_vnum_za32(0, slice, pg, ptr, vnum);
+  slice = slice_base + 3;
+  svst1_ver_vnum_za32(3, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_vnum_za64(
@@ -157,8 +172,10 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za32(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_vnum_za64(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_ver_vnum_za64(0, slice_base, 0, pg, ptr, vnum);
-  svst1_ver_vnum_za64(7, slice_base, 1, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_ver_vnum_za64(0, slice, pg, ptr, vnum);
+  slice = slice_base + 1;
+  svst1_ver_vnum_za64(7, slice, pg, ptr, vnum);
 }
 
 // CHECK-C-LABEL:   @test_svst1_ver_vnum_za128(
@@ -173,6 +190,7 @@ ARM_STREAMING_ATTR void test_svst1_ver_vnum_za64(uint32_t slice_base, svbool_t p
 // CHECK-NEXT:        ret void
 //
 ARM_STREAMING_ATTR void test_svst1_ver_vnum_za128(uint32_t slice_base, svbool_t pg, void *ptr, int64_t vnum) {
-  svst1_ver_vnum_za128(0, slice_base, 0, pg, ptr, vnum);
-  svst1_ver_vnum_za128(15, slice_base, 0, pg, ptr, vnum);
+  uint32_t slice = slice_base;
+  svst1_ver_vnum_za128(0, slice, pg, ptr, vnum);
+  svst1_ver_vnum_za128(15, slice, pg, ptr, vnum);
 }
diff --git a/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_imm.cpp b/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_imm.cpp
index 175694f147a3f80..96f18c642c28459 100644
--- a/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_imm.cpp
+++ b/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_imm.cpp
@@ -12,23 +12,15 @@
 
 #include <arm_sme_draft_spec_subject_to_change.h>
 
-void test_range_0_0(svbool_t pg, void *ptr) {
+void test_range_0_0(uint32_t slice, svbool_t pg, void *ptr) {
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svld1_hor_za8,,,)(-1, -1, 0, pg, ptr);
+  SVE_ACLE_FUNC(svld1_hor_za8,,,)(-1, slice, pg, ptr);
   // expected-error at +1 {{argument value 1 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svst1_ver_za8,,,)(1, -1, 15, pg, ptr);
+  SVE_ACLE_FUNC(svst1_ver_za8,,,)(1, slice, pg, ptr);
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svld1_hor_za128,,,)(0, -1, -1, pg, ptr);
+  SVE_ACLE_FUNC(svld1_hor_vnum_za8,,,)(-1, slice, pg, ptr, 1);
   // expected-error at +1 {{argument value 1 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svst1_ver_za128,,,)(15, -1, 1, pg, ptr);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za8,,,)(-1, -1, 0, pg, ptr, 1);
-  // expected-error at +1 {{argument value 1 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za8,,,)(1, -1, 15, pg, ptr, 1);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za128,,,)(0, -1, -1, pg, ptr, 1);
-  // expected-error at +1 {{argument value 1 is outside the valid range [0, 0]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za128,,,)(15, -1, 1, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_vnum_za8,,,)(1, slice, pg, ptr, 1);
 
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 0]}}
   SVE_ACLE_FUNC(svread_hor_za8, _s8, _m,)(svundef_s8(), pg, -1, -1, 0);
@@ -48,23 +40,15 @@ void test_range_0_0(svbool_t pg, void *ptr) {
   SVE_ACLE_FUNC(svwrite_ver_za128, _s8, _m,)(15, -1, 1, pg, svundef_s8());
 }
 
-void test_range_0_1(svbool_t pg, void *ptr) {
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svld1_hor_za16,,,)(-1, -1, 0, pg, ptr);
-  // expected-error at +1 {{argument value 2 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svst1_ver_za16,,,)(2, -1, 7, pg, ptr);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svld1_hor_za64,,,)(0, -1, -1, pg, ptr);
-  // expected-error at +1 {{argument value 2 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svst1_ver_za64,,,)(7, -1, 2, pg, ptr);
+void test_range_0_1(uint32_t slice, svbool_t pg, void *ptr) {
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za16,,,)(-1, -1, 0, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_za16,,,)(-1, slice, pg, ptr);
   // expected-error at +1 {{argument value 2 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za16,,,)(2, -1, 7, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_za16,,,)(2, slice, pg, ptr);
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za64,,,)(0, -1, -1, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_vnum_za16,,,)(-1, slice, pg, ptr, 1);
   // expected-error at +1 {{argument value 2 is outside the valid range [0, 1]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za64,,,)(7, -1, 2, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_vnum_za16,,,)(2, slice, pg, ptr, 1);
 
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 1]}}
   SVE_ACLE_FUNC(svread_hor_za16, _s16, _m,)(svundef_s16(), pg, -1, -1, 0);
@@ -84,23 +68,15 @@ void test_range_0_1(svbool_t pg, void *ptr) {
   SVE_ACLE_FUNC(svwrite_ver_za64, _s64, _m,)(7, -1, 2, pg, svundef_s64());
 }
 
-void test_range_0_3(svbool_t pg, void *ptr) {
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svld1_hor_za32,,,)(-1, -1, 0, pg, ptr);
-  // expected-error at +1 {{argument value 4 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svst1_ver_za32,,,)(4, -1, 3, pg, ptr);
+void test_range_0_3(uint32_t slice, svbool_t pg, void *ptr) {
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svld1_hor_za32,,,)(0, -1, -1, pg, ptr);
+  SVE_ACLE_FUNC(svld1_hor_za32,,,)(-1, slice, pg, ptr);
   // expected-error at +1 {{argument value 4 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svst1_ver_za32,,,)(3, -1, 4, pg, ptr);
+  SVE_ACLE_FUNC(svst1_ver_za32,,,)(4, slice, pg, ptr);
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za32,,,)(-1, -1, 0, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_vnum_za32,,,)(-1, slice, pg, ptr, 1);
   // expected-error at +1 {{argument value 4 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za32,,,)(4, -1, 3, pg, ptr, 1);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za32,,,)(0, -1, -1, pg, ptr, 1);
-  // expected-error at +1 {{argument value 4 is outside the valid range [0, 3]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za32,,,)(3, -1, 4, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_vnum_za32,,,)(4, slice, pg, ptr, 1);
 
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 3]}}
   SVE_ACLE_FUNC(svread_hor_za32, _s32, _m,)(svundef_s32(), pg, -1, -1, 0);
@@ -138,23 +114,15 @@ void test_range_0_3(svbool_t pg, void *ptr) {
   SVE_ACLE_FUNC(svusmops_za32, _u8, _m,)(-1, pg, pg, svundef_u8(), svundef_s8());
 }
 
-void test_range_0_7(svbool_t pg, void *ptr) {
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svld1_hor_za64,,,)(-1, -1, 0, pg, ptr);
-  // expected-error at +1 {{argument value 8 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svst1_ver_za64,,,)(8, -1, 1, pg, ptr);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svld1_hor_za16,,,)(0, -1, -1, pg, ptr);
-  // expected-error at +1 {{argument value 8 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svst1_ver_za16,,,)(1, -1, 8, pg, ptr);
+void test_range_0_7(uint32_t slice, svbool_t pg, void *ptr) {
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za64,,,)(-1, -1, 0, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_za64,,,)(-1, slice, pg, ptr);
   // expected-error at +1 {{argument value 8 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za64,,,)(8, -1, 1, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_za64,,,)(8, slice, pg, ptr);
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za16,,,)(0, -1, -1, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_vnum_za64,,,)(-1, slice, pg, ptr, 1);
   // expected-error at +1 {{argument value 8 is outside the valid range [0, 7]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za16,,,)(1, -1, 8, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_vnum_za64,,,)(8, slice, pg, ptr, 1);
 
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 7]}}
   SVE_ACLE_FUNC(svread_hor_za64, _s64, _m,)(svundef_s64(), pg, -1, -1, 0);
@@ -197,23 +165,15 @@ void test_range_0_7(svbool_t pg, void *ptr) {
   SVE_ACLE_FUNC(svmops_za64, _f64, _m,)(-1, pg, pg, svundef_f64(), svundef_f64());
 }
 
-void test_range_0_15(svbool_t pg, void *ptr) {
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svld1_hor_za128,,,)(-1, -1, 0, pg, ptr);
-  // expected-error at +1 {{argument value 16 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svst1_ver_za128,,,)(16, -1, 0, pg, ptr);
-  // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svld1_hor_za8,,,)(0, -1, -1, pg, ptr);
-  // expected-error at +1 {{argument value 16 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svst1_ver_za8,,,)(0, -1, 16, pg, ptr);
+void test_range_0_15(uint32_t slice, svbool_t pg, void *ptr) {
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za128,,,)(-1, -1, 0, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_za128,,,)(-1, slice, pg, ptr);
   // expected-error at +1 {{argument value 16 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za128,,,)(16, -1, 0, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_za128,,,)(16, slice, pg, ptr);
   // expected-error at +1 {{argument value 18446744073709551615 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za8,,,)(0, -1, -1, pg, ptr, 1);
+  SVE_ACLE_FUNC(svld1_hor_vnum_za128,,,)(-1, slice, pg, ptr, 1);
   // expected-error at +1 {{argument value 16 is outside the valid range [0, 15]}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za8,,,)(0, -1, 16, pg, ptr, 1);
+  SVE_ACLE_FUNC(svst1_ver_vnum_za128,,,)(16, slice, pg, ptr, 1);
 
   // expected-error at +1 {{argument value 16 is outside the valid range [0, 15]}}
   SVE_ACLE_FUNC(svldr_vnum_za,,,)(-1, 16, ptr);
@@ -246,14 +206,10 @@ void test_range_0_255(svbool_t pg, void *ptr) {
 }
 
 void test_constant(uint64_t u64, svbool_t pg, void *ptr) {
-  SVE_ACLE_FUNC(svld1_hor_za8,,,)(u64, u64, 0, pg, ptr);  // expected-error {{argument to 'svld1_hor_za8' must be a constant integer}}
-  SVE_ACLE_FUNC(svld1_ver_za16,,,)(0, u64, u64, pg, ptr); // expected-error {{argument to 'svld1_ver_za16' must be a constant integer}}
-  SVE_ACLE_FUNC(svst1_hor_za32,,,)(u64, u64, 0, pg, ptr); // expected-error {{argument to 'svst1_hor_za32' must be a constant integer}}
-  SVE_ACLE_FUNC(svst1_ver_za64,,,)(0, u64, u64, pg, ptr); // expected-error {{argument to 'svst1_ver_za64' must be a constant integer}}
-  SVE_ACLE_FUNC(svld1_hor_vnum_za8,,,)(u64, u64, 0, pg, ptr, u64);  // expected-error {{argument to 'svld1_hor_vnum_za8' must be a constant integer}}
-  SVE_ACLE_FUNC(svld1_ver_vnum_za16,,,)(0, u64, u64, pg, ptr, u64); // expected-error {{argument to 'svld1_ver_vnum_za16' must be a constant integer}}
-  SVE_ACLE_FUNC(svst1_hor_vnum_za32,,,)(u64, u64, 0, pg, ptr, u64); // expected-error {{argument to 'svst1_hor_vnum_za32' must be a constant integer}}
-  SVE_ACLE_FUNC(svst1_ver_vnum_za64,,,)(0, u64, u64, pg, ptr, u64); // expected-error {{argument to 'svst1_ver_vnum_za64' must be a constant integer}}
+  SVE_ACLE_FUNC(svld1_hor_za8,,,)(u64, u64, pg, ptr);  // expected-error {{argument to 'svld1_hor_za8' must be a constant integer}}
+  SVE_ACLE_FUNC(svst1_hor_za32,,,)(u64, 0, pg, ptr); // expected-error {{argument to 'svst1_hor_za32' must be a constant integer}}
+  SVE_ACLE_FUNC(svld1_hor_vnum_za8,,,)(u64, 0, pg, ptr, u64);  // expected-error {{argument to 'svld1_hor_vnum_za8' must be a constant integer}}
+  SVE_ACLE_FUNC(svst1_hor_vnum_za32,,,)(u64, 0, pg, ptr, u64); // expected-error {{argument to 'svst1_hor_vnum_za32' must be a constant integer}}
 
   SVE_ACLE_FUNC(svldr_vnum_za,,,)(u64, u64, ptr); // expected-error {{argument to 'svldr_vnum_za' must be a constant integer}}
   SVE_ACLE_FUNC(svstr_vnum_za,,,)(u64, u64, ptr); // expected-error {{argument to 'svstr_vnum_za' must be a constant integer}}
diff --git a/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_target.c b/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_target.c
index b384244ac6c6a92..2de6d9f6877f021 100644
--- a/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_target.c
+++ b/clang/test/Sema/aarch64-sme-intrinsics/acle_sme_target.c
@@ -7,19 +7,19 @@
 
 __attribute__((target("sme")))
 void test_sme(svbool_t pg, void *ptr) {
-  svld1_hor_za8(0, 0, 0, pg, ptr);
+  svld1_hor_za8(0, 0, pg, ptr);
 }
 
 __attribute__((target("arch=armv8-a+sme")))
 void test_arch_sme(svbool_t pg, void *ptr) {
-  svld1_hor_vnum_za32(0, 0, 0, pg, ptr, 0);
+  svld1_hor_vnum_za32(0, 0, pg, ptr, 0);
 }
 
 __attribute__((target("+sme")))
 void test_plus_sme(svbool_t pg, void *ptr) {
-  svst1_ver_za16(0, 0, 0, pg, ptr);
+  svst1_ver_za16(0, 0, pg, ptr);
 }
 
 void undefined(svbool_t pg, void *ptr) {
-  svst1_ver_vnum_za64(0, 0, 0, pg, ptr, 0); // expected-error {{'svst1_ver_vnum_za64' needs target feature sme}}
+  svst1_ver_vnum_za64(0, 0, pg, ptr, 0); // expected-error {{'svst1_ver_vnum_za64' needs target feature sme}}
 }



More information about the cfe-commits mailing list