RISC-V: Change unaligned fast/slow/avoid macros to misaligned [PR111557]
Checks
Commit Message
Fix __riscv_unaligned_fast/slow/avoid macro name to
__riscv_misaligned_fast/slow/avoid to be consistent with the RISC-V API Spec
gcc/ChangeLog:
* config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): update macro name
gcc/testsuite/ChangeLog:
* gcc.target/riscv/attribute-1.c: update macro name
* gcc.target/riscv/attribute-4.c: ditto
* gcc.target/riscv/attribute-5.c: ditto
* gcc.target/riscv/predef-align-1.c: ditto
* gcc.target/riscv/predef-align-2.c: ditto
* gcc.target/riscv/predef-align-3.c: ditto
* gcc.target/riscv/predef-align-4.c: ditto
* gcc.target/riscv/predef-align-5.c: ditto
* gcc.target/riscv/predef-align-6.c: ditto
Signed-off-by: Edwin Lu <ewlu@rivosinc.com>
---
gcc/config/riscv/riscv-c.cc | 6 +++---
gcc/testsuite/gcc.target/riscv/attribute-1.c | 10 +++++-----
gcc/testsuite/gcc.target/riscv/attribute-4.c | 8 ++++----
gcc/testsuite/gcc.target/riscv/attribute-5.c | 10 +++++-----
gcc/testsuite/gcc.target/riscv/predef-align-1.c | 10 +++++-----
gcc/testsuite/gcc.target/riscv/predef-align-2.c | 8 ++++----
gcc/testsuite/gcc.target/riscv/predef-align-3.c | 10 +++++-----
gcc/testsuite/gcc.target/riscv/predef-align-4.c | 10 +++++-----
gcc/testsuite/gcc.target/riscv/predef-align-5.c | 8 ++++----
gcc/testsuite/gcc.target/riscv/predef-align-6.c | 10 +++++-----
10 files changed, 45 insertions(+), 45 deletions(-)
@@ -109,11 +109,11 @@ riscv_cpu_cpp_builtins (cpp_reader *pfile)
}
if (riscv_user_wants_strict_align)
- builtin_define_with_int_value ("__riscv_unaligned_avoid", 1);
+ builtin_define_with_int_value ("__riscv_misaligned_avoid", 1);
else if (riscv_slow_unaligned_access_p)
- builtin_define_with_int_value ("__riscv_unaligned_slow", 1);
+ builtin_define_with_int_value ("__riscv_misaligned_slow", 1);
else
- builtin_define_with_int_value ("__riscv_unaligned_fast", 1);
+ builtin_define_with_int_value ("__riscv_misaligned_fast", 1);
if (TARGET_MIN_VLEN != 0)
builtin_define_with_int_value ("__riscv_v_min_vlen", TARGET_MIN_VLEN);
@@ -4,13 +4,13 @@ int foo()
{
/* In absence of -m[no-]strict-align, default mcpu is currently
- set to rocket. rocket has slow_unaligned_access=true. */
-#if !defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_slow is not set"
+ set to rocket. rocket has slow_misaligned_access=true. */
+#if !defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_slow is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_fast is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_fast is unexpectedly set"
#endif
return 0;
@@ -3,12 +3,12 @@
int foo()
{
-#if !defined(__riscv_unaligned_avoid)
-#error "__riscv_unaligned_avoid is not set"
+#if !defined(__riscv_misaligned_avoid)
+#error "__riscv_misaligned_avoid is not set"
#endif
-#if defined(__riscv_unaligned_fast) || defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_fast or __riscv_unaligned_slow is unexpectedly set"
+#if defined(__riscv_misaligned_fast) || defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_fast or __riscv_misaligned_slow is unexpectedly set"
#endif
return 0;
@@ -3,13 +3,13 @@
int foo()
{
-/* Default mcpu is rocket which has slow_unaligned_access=true. */
-#if !defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_slow is not set"
+/* Default mcpu is rocket which has slow_misaligned_access=true. */
+#if !defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_slow is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_fast is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_fast is unexpectedly set"
#endif
return 0;
@@ -3,13 +3,13 @@
int main() {
-/* thead-c906 default is cpu tune param unaligned access fast */
-#if !defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_fast is not set"
+/* thead-c906 default is cpu tune param misaligned access fast */
+#if !defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_fast is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_slow is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_slow is unexpectedly set"
#endif
return 0;
@@ -3,12 +3,12 @@
int main() {
-#if !defined(__riscv_unaligned_avoid)
-#error "__riscv_unaligned_avoid is not set"
+#if !defined(__riscv_misaligned_avoid)
+#error "__riscv_misaligned_avoid is not set"
#endif
-#if defined(__riscv_unaligned_fast) || defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_fast or __riscv_unaligned_slow is unexpectedly set"
+#if defined(__riscv_misaligned_fast) || defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_fast or __riscv_misaligned_slow is unexpectedly set"
#endif
return 0;
@@ -3,13 +3,13 @@
int main() {
-/* thead-c906 default is cpu tune param unaligned access fast */
-#if !defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_fast is not set"
+/* thead-c906 default is cpu tune param misaligned access fast */
+#if !defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_fast is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_slow is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_slow is unexpectedly set"
#endif
return 0;
@@ -3,13 +3,13 @@
int main() {
-/* rocket default is cpu tune param unaligned access slow */
-#if !defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_slow is not set"
+/* rocket default is cpu tune param misaligned access slow */
+#if !defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_slow is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_fast is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_fast is unexpectedly set"
#endif
return 0;
@@ -3,12 +3,12 @@
int main() {
-#if !defined(__riscv_unaligned_avoid)
-#error "__riscv_unaligned_avoid is not set"
+#if !defined(__riscv_misaligned_avoid)
+#error "__riscv_misaligned_avoid is not set"
#endif
-#if defined(__riscv_unaligned_fast) || defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_fast or __riscv_unaligned_slow is unexpectedly set"
+#if defined(__riscv_misaligned_fast) || defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_fast or __riscv_misaligned_slow is unexpectedly set"
#endif
return 0;
@@ -3,13 +3,13 @@
int main() {
-/* rocket default is cpu tune param unaligned access slow */
-#if !defined(__riscv_unaligned_slow)
-#error "__riscv_unaligned_slow is not set"
+/* rocket default is cpu tune param misaligned access slow */
+#if !defined(__riscv_misaligned_slow)
+#error "__riscv_misaligned_slow is not set"
#endif
-#if defined(__riscv_unaligned_avoid) || defined(__riscv_unaligned_fast)
-#error "__riscv_unaligned_avoid or __riscv_unaligned_fast is unexpectedly set"
+#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_fast)
+#error "__riscv_misaligned_avoid or __riscv_misaligned_fast is unexpectedly set"
#endif
return 0;