Message ID | 1435068612-1477-1-git-send-email-cederman@gaisler.com |
---|---|
State | New |
Headers | show |
> The muser-mode flag causes the CASA instruction for LEON3 to use the > user mode ASI. This is the correct behavior for almost all LEON3 targets. Do they lack the CASA instruction with supervisor-mode ASI? What happens when the CASA instruction with user-mode ASI is executed in supervisor mode?
> > Do they lack the CASA instruction with supervisor-mode ASI? What happens when > the CASA instruction with user-mode ASI is executed in supervisor mode? > For all LEON3 (with CASA support) the CASA instruction works in supervisor-mode regardless of ASI used. In user-mode CASA only works with the user-mode ASI. So CASA with user-mode ASI works for both user-mode and supervisor-mode. By having user-mode ASI as default, one would not need to change flag when compiling user or kernel code. On a few old LEON3 systems the CASA instruction only works in supervisor mode. Using the CASA instruction with the user-mode ASI on these systems is not legal and will cause a trap.
> For all LEON3 (with CASA support) the CASA instruction works in > supervisor-mode regardless of ASI used. In user-mode CASA only works > with the user-mode ASI. So CASA with user-mode ASI works for both > user-mode and supervisor-mode. By having user-mode ASI as default, one > would not need to change flag when compiling user or kernel code. Thanks, OK for mainline, 5 branch and 4.9 branch.
diff --git a/gcc/config/sparc/sparc.opt b/gcc/config/sparc/sparc.opt index 93d24a6..85bf0bd 100644 --- a/gcc/config/sparc/sparc.opt +++ b/gcc/config/sparc/sparc.opt @@ -114,8 +114,8 @@ Target Optimize tail call instructions in assembler and linker muser-mode -Target Report Mask(USER_MODE) -Do not generate code that can only run in supervisor mode +Target Report InverseMask(SV_MODE) +Do not generate code that can only run in supervisor mode (default) mcpu= Target RejectNegative Joined Var(sparc_cpu_and_features) Enum(sparc_processor_type) Init(PROCESSOR_V7) diff --git a/gcc/config/sparc/sync.md b/gcc/config/sparc/sync.md index 7d00b10..2fabff5 100644 --- a/gcc/config/sparc/sync.md +++ b/gcc/config/sparc/sync.md @@ -222,10 +222,10 @@ UNSPECV_CAS))] "TARGET_LEON3" { - if (TARGET_USER_MODE) - return "casa\t%1 0xa, %2, %0"; /* ASI for user data space. */ - else + if (TARGET_SV_MODE) return "casa\t%1 0xb, %2, %0"; /* ASI for supervisor data space. */ + else + return "casa\t%1 0xa, %2, %0"; /* ASI for user data space. */ } [(set_attr "type" "multi")]) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b99ab1c..86b2a73 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21305,8 +21305,8 @@ in a performance loss, especially for floating-point code. @opindex muser-mode @opindex mno-user-mode Do not generate code that can only run in supervisor mode. This is relevant -only for the @code{casa} instruction emitted for the LEON3 processor. The -default is @option{-mno-user-mode}. +only for the @code{casa} instruction emitted for the LEON3 processor. This +is the default. @item -mno-faster-structs @itemx -mfaster-structs