diff options
author | YunQiang Su <syq@gcc.gnu.org> | 2024-03-15 14:33:58 +0800 |
---|---|---|
committer | YunQiang Su <syq@gcc.gnu.org> | 2024-03-15 14:47:36 +0800 |
commit | acc38ff59976e972ba4b1e39f7653813a05de588 (patch) | |
tree | 7cb73dfb4265bb3b766d799b67fdd527dbf420ea | |
parent | 81f3d963e05de8b17d4ccc7667ead9ed156193a4 (diff) | |
download | gcc-acc38ff59976e972ba4b1e39f7653813a05de588.zip gcc-acc38ff59976e972ba4b1e39f7653813a05de588.tar.gz gcc-acc38ff59976e972ba4b1e39f7653813a05de588.tar.bz2 |
MIPS: Add -m(no-)strict-align option
We support options -m(no-)unaligned-access 2 years ago, while
currently most of other ports prefer -m(no-)strict-align.
Let's support -m(no-)strict-align, and keep -m(no-)unaligned-access
as alias.
gcc
* config/mips/mips.opt: Support -mstrict-align, and use
TARGET_STRICT_ALIGN as the flag; keep -m(no-)unaligned-access
as alias.
* config/mips/mips.h: Use TARGET_STRICT_ALIGN.
* config/mips/mips.opt.urls: Regenerate.
* doc/invoke.texi: Document -m(no-)strict-algin for MIPSr6.
-rw-r--r-- | gcc/config/mips/mips.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.opt | 12 | ||||
-rw-r--r-- | gcc/config/mips/mips.opt.urls | 6 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 18 |
4 files changed, 29 insertions, 9 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 7145d23..6444a68 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -251,7 +251,7 @@ struct mips_cpu_info { || ISA_HAS_MSA)) /* ISA load/store instructions can handle unaligned address */ -#define ISA_HAS_UNALIGNED_ACCESS (TARGET_UNALIGNED_ACCESS \ +#define ISA_HAS_UNALIGNED_ACCESS (!TARGET_STRICT_ALIGN \ && (mips_isa_rev >= 6)) /* The ISA compression flags that are currently in effect. */ diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index ce36942..c1abb36 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -429,9 +429,17 @@ mtune= Target RejectNegative Joined Var(mips_tune_option) ToLower Enum(mips_arch_opt_value) -mtune=PROCESSOR Optimize the output for PROCESSOR. +mstrict-align +Target Var(TARGET_STRICT_ALIGN) Init(0) +Don't generate code with unaligned load store, only valid for MIPS R6. + munaligned-access -Target Var(TARGET_UNALIGNED_ACCESS) Init(1) -Generate code with unaligned load store, valid for MIPS R6. +Target RejectNegative Alias(mstrict-align) NegativeAlias +Generate code with unaligned load store for R6 (alias of -mno-strict-align). + +mno-unaligned-access +Target RejectNegative Alias(mstrict-align) +Don't generate code with unaligned load store for R6 (alias of -mstrict-align). muninit-const-in-rodata Target Var(TARGET_UNINIT_CONST_IN_RODATA) diff --git a/gcc/config/mips/mips.opt.urls b/gcc/config/mips/mips.opt.urls index 96aba04..9d16664 100644 --- a/gcc/config/mips/mips.opt.urls +++ b/gcc/config/mips/mips.opt.urls @@ -233,9 +233,15 @@ UrlSuffix(gcc/MIPS-Options.html#index-mmadd4) mtune= UrlSuffix(gcc/MIPS-Options.html#index-mtune-10) +mstrict-align +UrlSuffix(gcc/MIPS-Options.html#index-mstrict-align-3) + munaligned-access UrlSuffix(gcc/MIPS-Options.html#index-munaligned-access-1) +mno-unaligned-access +UrlSuffix(gcc/MIPS-Options.html#index-mno-unaligned-access-1) + muninit-const-in-rodata UrlSuffix(gcc/MIPS-Options.html#index-muninit-const-in-rodata) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 85c938d..864768f 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1143,7 +1143,8 @@ Objective-C and Objective-C++ Dialects}. -mcheck-zero-division -mno-check-zero-division -mdivide-traps -mdivide-breaks -mload-store-pairs -mno-load-store-pairs --munaligned-access -mno-unaligned-access +-mstrict-align -mno-strict-align +-mno-unaligned-access -munaligned-access -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls -mmad -mno-mad -mimadd -mno-imadd -mfused-madd -mno-fused-madd -nocpp -mfix-24k -mno-fix-24k @@ -28561,14 +28562,19 @@ instructions to enable load/store bonding. This option is enabled by default but only takes effect when the selected architecture is known to support bonding. +@opindex mstrict-align +@opindex mno-strict-align @opindex munaligned-access @opindex mno-unaligned-access -@item -munaligned-access +@item -mstrict-align +@itemx -mno-strict-align +@itemx -munaligned-access @itemx -mno-unaligned-access -Enable (disable) direct unaligned access for MIPS Release 6. -MIPSr6 requires load/store unaligned-access support, -by hardware or trap&emulate. -So @option{-mno-unaligned-access} may be needed by kernel. +Disable (enable) direct unaligned access for MIPS Release 6. +MIPSr6 requires load/store unaligned-access support, by hardware or +trap&emulate. So @option{-mstrict-align} may be needed by kernel. The +options @option{-munaligned-access} and @option{-mno-unaligned-access} +are obsoleted, and only for backward-compatible. @opindex mmemcpy @opindex mno-memcpy |