%{mlongcalls:--longcalls} \
%{mno-longcalls:--no-longcalls} \
%{mauto-litpools:--auto-litpools} \
- %{mno-auto-litpools:--no-auto-litpools}"
+ %{mno-auto-litpools:--no-auto-litpools} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#undef LIB_SPEC
#define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{static:-static}}}"
+ %{static:-static}}} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
%{mlongcalls:--longcalls} \
%{mno-longcalls:--no-longcalls} \
%{mauto-litpools:--auto-litpools} \
- %{mno-auto-litpools:--no-auto-litpools}"
+ %{mno-auto-litpools:--no-auto-litpools} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
%{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
- %{static:-static}}"
+ %{static:-static}} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
%{mlongcalls:--longcalls} \
%{mno-longcalls:--no-longcalls} \
%{mauto-litpools:--auto-litpools} \
- %{mno-auto-litpools:--no-auto-litpools}"
+ %{mno-auto-litpools:--no-auto-litpools} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#undef LINK_SPEC
-#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}"
+#define LINK_SPEC \
+ "%{!no-elf2flt:%{!elf2flt*:-elf2flt}} \
+ %{mabi=windowed:--abi-windowed} \
+ %{mabi=call0:--abi-call0}"
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX "."
int regno;
machine_mode mode;
+ if (xtensa_windowed_abi == -1)
+ xtensa_windowed_abi = TARGET_WINDOWED_ABI_DEFAULT;
+
/* Use CONST16 in the absence of L32R.
Set it in the TARGET_OPTION_OVERRIDE to avoid dependency on xtensa
configuration in the xtensa-common.c */
#define TARGET_ABSOLUTE_LITERALS XSHAL_USE_ABSOLUTE_LITERALS
#define TARGET_THREADPTR XCHAL_HAVE_THREADPTR
#define TARGET_LOOPS XCHAL_HAVE_LOOPS
-#define TARGET_WINDOWED_ABI (XSHAL_ABI == XTHAL_ABI_WINDOWED)
+#define TARGET_WINDOWED_ABI_DEFAULT (XSHAL_ABI == XTHAL_ABI_WINDOWED)
+#define TARGET_WINDOWED_ABI xtensa_windowed_abi
#define TARGET_DEBUG XCHAL_HAVE_DEBUG
#define TARGET_L32R XCHAL_HAVE_L32R
mserialize-volatile
Target Report Mask(SERIALIZE_VOLATILE)
-mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions.
+
+TargetVariable
+int xtensa_windowed_abi = -1
+
+mabi=call0
+Target Report RejectNegative Var(xtensa_windowed_abi, 0)
+Use call0 ABI.
+
+mabi=windowed
+Target Report RejectNegative Var(xtensa_windowed_abi, 1)
+Use windowed registers ABI.
-mtext-section-literals -mno-text-section-literals @gol
-mauto-litpools -mno-auto-litpools @gol
-mtarget-align -mno-target-align @gol
--mlongcalls -mno-longcalls}
+-mlongcalls -mno-longcalls @gol
+-mabi=@var{abi-type}}
@emph{zSeries Options}
See S/390 and zSeries Options.
instructions---look at the disassembled object code to see the actual
instructions. Note that the assembler uses an indirect call for
every cross-file call, not just those that really are out of range.
+
+@item -mabi=@var{name}
+@opindex mabi
+Generate code for the specified ABI@. Permissible values are: @samp{call0},
+@samp{windowed}. Default ABI is chosen by the Xtensa core configuration.
+
+@item -mabi=call0
+@opindex mabi=call0
+When this option is enabled function parameters are passed in registers
+@code{a2} through @code{a7}, registers @code{a12} through @code{a15} are
+caller-saved, and register @code{a15} may be used as a frame pointer.
+When this version of the ABI is enabled the C preprocessor symbol
+@code{__XTENSA_CALL0_ABI__} is defined.
+
+@item -mabi=windowed
+@opindex mabi=windowed
+When this option is enabled function parameters are passed in registers
+@code{a10} through @code{a15}, and called function rotates register window
+by 8 registers on entry so that its arguments are found in registers
+@code{a2} through @code{a7}. Register @code{a7} may be used as a frame
+pointer. Register window is rotated 8 registers back upon return.
+When this version of the ABI is enabled the C preprocessor symbol
+@code{__XTENSA_WINDOWED_ABI__} is defined.
@end table
@node zSeries Options
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mabi=call0" } */
+
+#ifndef __XTENSA_CALL0_ABI__
+#error
+#endif
+
+void foo(void)
+{
+}
+
+/* { dg-final { scan-assembler-not "entry" } } */
+/* { dg-final { scan-assembler-not "retw" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mabi=windowed" } */
+
+#ifndef __XTENSA_WINDOWED_ABI__
+#error
+#endif
+
+void foo(void)
+{
+}
+
+/* { dg-final { scan-assembler "entry" } } */
+/* { dg-final { scan-assembler "retw" } } */
# This is after config.host so we can augment tmake_file.
case ${host} in
xtensa*-*)
- cat > conftest.c <<EOF
- #ifdef __XTENSA_CALL0_ABI__
- #error
- #endif
-EOF
- if { ac_try='${CC-cc} -E -o conftest.i conftest.c 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- tmake_file="${tmake_file} xtensa/t-windowed"
- fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __XTENSA_CALL0_ABI__
+ #error
+ #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tmake_file="${tmake_file} xtensa/t-windowed"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
;;
esac
# This is after config.host so we can augment tmake_file.
case ${host} in
xtensa*-*)
- cat > conftest.c <<EOF
- #ifdef __XTENSA_CALL0_ABI__
- #error
- #endif
-EOF
- if AC_TRY_COMMAND(${CC-cc} -E -o conftest.i conftest.c 1>&AS_MESSAGE_LOG_FD); then
- tmake_file="${tmake_file} xtensa/t-windowed"
- fi
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [#ifdef __XTENSA_CALL0_ABI__
+ #error
+ #endif
+ ])],
+ [tmake_file="${tmake_file} xtensa/t-windowed"])
;;
esac