aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/config/csky/csky.h9
-rw-r--r--gcc/config/csky/csky.opt29
-rw-r--r--gcc/config/csky/csky_opts.h7
-rw-r--r--gcc/doc/invoke.texi18
4 files changed, 58 insertions, 5 deletions
diff --git a/gcc/config/csky/csky.h b/gcc/config/csky/csky.h
index 2d5a66c..8f4090b 100644
--- a/gcc/config/csky/csky.h
+++ b/gcc/config/csky/csky.h
@@ -126,6 +126,13 @@
#define TARGET_TLS \
(CSKY_TARGET_ARCH (CK807) || CSKY_TARGET_ARCH (CK810))
+/* Run-time Target Specification. */
+#define TARGET_SOFT_FLOAT (csky_float_abi == CSKY_FLOAT_ABI_SOFT)
+/* Use hardware floating point instructions. */
+#define TARGET_HARD_FLOAT (csky_float_abi != CSKY_FLOAT_ABI_SOFT)
+/* Use hardware floating point calling convention. */
+#define TARGET_HARD_FLOAT_ABI (csky_float_abi == CSKY_FLOAT_ABI_HARD)
+
/* Number of loads/stores handled by ldm/stm. */
#define CSKY_MIN_MULTIPLE_STLD 3
#define CSKY_MAX_MULTIPLE_STLD 12
@@ -818,7 +825,7 @@ while (0)
{"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
{"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"endian", "%{!mbig-endian:%{!mlittle-endian:-m%(VALUE)-endian}}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" },
+ {"float", "%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}" },
/******************************************************************
diff --git a/gcc/config/csky/csky.opt b/gcc/config/csky/csky.opt
index 5846e50..60b51e5 100644
--- a/gcc/config/csky/csky.opt
+++ b/gcc/config/csky/csky.opt
@@ -57,12 +57,33 @@ Target RejectNegative Report Alias(mlittle-endian) Undocumented
;; assembly.
mhard-float
-Target Report RejectNegative Mask(HARD_FLOAT)
-Enable hardware floating-point instructions.
+Target RejectNegative Alias(mfloat-abi=, hard) Undocumented
msoft-float
-Target Report RejectNegative InverseMask(HARD_FLOAT)
-Use library calls to perform floating-point operations (default).
+Target RejectNegative Alias(mfloat-abi=, soft) Undocumented
+
+mfloat-abi=v2
+Target RejectNegative Alias(mfloat-abi=, hard) Undocumented
+
+mfloat-abi=v1
+Target RejectNegative Alias(mfloat-abi=, softfp) Undocumented
+
+mfloat-abi=
+Target RejectNegative Joined Enum(float_abi_type) Var(csky_float_abi) Init(CSKY_FLOAT_ABI_SOFT)
+Specify if floating point hardware should be used.
+
+Enum
+Name(float_abi_type) Type(enum float_abi_type)
+Known floating-point ABIs (for use with the -mfloat-abi= option):
+
+EnumValue
+Enum(float_abi_type) String(soft) Value(CSKY_FLOAT_ABI_SOFT)
+
+EnumValue
+Enum(float_abi_type) String(softfp) Value(CSKY_FLOAT_ABI_SOFTFP)
+
+EnumValue
+Enum(float_abi_type) String(hard) Value(CSKY_FLOAT_ABI_HARD)
mfpu=
Target RejectNegative Joined Enum(csky_fpu) Var(csky_fpu_index) Init(TARGET_FPU_auto) Save
diff --git a/gcc/config/csky/csky_opts.h b/gcc/config/csky/csky_opts.h
index a6dbf5a..7ee56be 100644
--- a/gcc/config/csky/csky_opts.h
+++ b/gcc/config/csky/csky_opts.h
@@ -59,5 +59,12 @@ enum csky_fpu_type
};
#define CSKY_TARGET_FPU_GET(name) TARGET_FPU_ ## name
+enum float_abi_type
+{
+ CSKY_FLOAT_ABI_SOFT,
+ CSKY_FLOAT_ABI_SOFTFP,
+ CSKY_FLOAT_ABI_HARD
+};
+
#endif /* CSKY_OPTS_H */
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5a5159d..060d73e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -820,6 +820,7 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-march=@var{arch} -mcpu=@var{cpu} @gol
-mbig-endian -EB -mlittle-endian -EL @gol
-mhard-float -msoft-float -mfpu=@var{fpu} -mdouble-float -mfdivdu @gol
+-mfloat-abi=@var{name} @gol
-melrw -mistack -mmp -mcp -mcache -msecurity -mtrust @gol
-mdsp -medsp -mvdsp @gol
-mdiv -msmart -mhigh-registers -manchor @gol
@@ -20646,6 +20647,23 @@ Specify the C-SKY target processor. Valid values for @var{cpu} are:
Select big- or little-endian code. The default is little-endian.
+@item -mfloat-abi=@var{name}
+@opindex mfloat-abi
+Specifies which floating-point ABI to use. Permissible values
+are: @samp{soft}, @samp{softfp} and @samp{hard}.
+
+Specifying @samp{soft} causes GCC to generate output containing
+library calls for floating-point operations.
+@samp{softfp} allows the generation of code using hardware floating-point
+instructions, but still uses the soft-float calling conventions.
+@samp{hard} allows generation of floating-point instructions
+and uses FPU-specific calling conventions.
+
+The default depends on the specific target configuration. Note that
+the hard-float and soft-float ABIs are not link-compatible; you must
+compile your entire program with the same ABI, and link with a
+compatible set of libraries.
+
@item -mhard-float
@opindex mhard-float
@itemx -msoft-float