]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: [MVE intrinsics] Fix tuples field name (PR 118332)
authorChristophe Lyon <christophe.lyon@linaro.org>
Tue, 7 Jan 2025 16:59:03 +0000 (16:59 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 8 Jan 2025 07:15:32 +0000 (07:15 +0000)
A recent commit mistakenly changed the field name for tuples from
'val' to '__val', but unlike SVE this name is mandated by ACLE.

The patch simply switches back the name to 'val'.

PR target/118332

gcc/ChangeLog:

* config/arm/arm-mve-builtins.cc (wrap_type_in_struct): Use 'val'
instead of '__val'.

gcc/testsuite/ChangeLog:

* gcc.target/arm/mve/intrinsics/pr118332.c: New test.

gcc/config/arm/arm-mve-builtins.cc
gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c [new file with mode: 0644]

index aacdbf159b977fcbf4ebf641c776c2b22f0fd912..4c52415f3f1b234b6e9ce92446c748740acadb18 100644 (file)
@@ -464,13 +464,12 @@ register_vector_type (vector_type_index type)
 }
 
 /* Return a structure type that contains a single field of type FIELD_TYPE.
-   The field is called __val, but that's an internal detail rather than
-   an exposed part of the API.  */
+   The field is called 'val', as mandated by ACLE.  */
 static tree
 wrap_type_in_struct (tree field_type)
 {
   tree field = build_decl (input_location, FIELD_DECL,
-                          get_identifier ("__val"), field_type);
+                          get_identifier ("val"), field_type);
   tree struct_type = lang_hooks.types.make_type (RECORD_TYPE);
   DECL_FIELD_CONTEXT (field) = struct_type;
   TYPE_FIELDS (struct_type) = field;
diff --git a/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c b/gcc/testsuite/gcc.target/arm/mve/intrinsics/pr118332.c
new file mode 100644 (file)
index 0000000..a8f6389
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-require-effective-target arm_v8_1m_mve_ok } */
+/* { dg-add-options arm_v8_1m_mve } */
+
+#include <arm_mve.h>
+uint32x4_t first(uint32x4x4_t a) { return a.val[0]; }