aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2002-05-09 03:38:44 -0700
committerDavid S. Miller <davem@gcc.gnu.org>2002-05-09 03:38:44 -0700
commit4e7d5d2733308bac25794673fa0cc2ae8e2947ac (patch)
treed04642ef22117a3979511677417378ceeb18d417 /gcc
parent0a0576f3f1edcfdea0122ce5190e5017e7fd73ab (diff)
downloadgcc-4e7d5d2733308bac25794673fa0cc2ae8e2947ac.zip
gcc-4e7d5d2733308bac25794673fa0cc2ae8e2947ac.tar.gz
gcc-4e7d5d2733308bac25794673fa0cc2ae8e2947ac.tar.bz2
sparc.h (TARGET_BUGGY_QP_LIB): Define to zero.
2002-05-07 David S. Miller <davem@redhat.com> * config/sparc/sparc.h (TARGET_BUGGY_QP_LIB): Define to zero. * config/sparc/sol2.h (TARGET_BUGGY_QP_LIB): Override to one. * config/sparc/sparc.c (emit_soft_tfmode_libcall): If the Qp library implementation clobbers the output before the inputs are fully consumed, use stack temporary for the output. From-SVN: r53322
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/sparc/sol2.h6
-rw-r--r--gcc/config/sparc/sparc.c30
-rw-r--r--gcc/config/sparc/sparc.h5
4 files changed, 29 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e1f507c..9bf0db8d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-05-07 David S. Miller <davem@redhat.com>
+
+ * config/sparc/sparc.h (TARGET_BUGGY_QP_LIB): Define to zero.
+ * config/sparc/sol2.h (TARGET_BUGGY_QP_LIB): Override to one.
+ * config/sparc/sparc.c (emit_soft_tfmode_libcall): If the Qp
+ library implementation clobbers the output before the inputs
+ are fully consumed, use stack temporary for the output.
+
2002-05-09 Jason Thorpe <thorpej@wasabisystems.com>
* config/netbsd.h (CPP_SPEC): Remove.
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 69ba9f5..f27b3ad 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -225,6 +225,12 @@ Boston, MA 02111-1307, USA. */
#define MODDI3_LIBCALL "__rem64"
#define UMODDI3_LIBCALL "__urem64"
+/* Solaris's _Qp_* library routine implementation clobbers the output
+ memory before the inputs are fully consumed. */
+
+#undef TARGET_BUGGY_QP_LIB
+#define TARGET_BUGGY_QP_LIB 1
+
#undef INIT_SUBTARGET_OPTABS
#define INIT_SUBTARGET_OPTABS \
fixsfdi_libfunc \
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index cd7c983..6219be3 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -2476,7 +2476,7 @@ emit_soft_tfmode_libcall (func_name, nargs, operands)
rtx *operands;
{
rtx ret_slot = NULL, arg[3], func_sym;
- int i, j;
+ int i;
/* We only expect to be called for conversions, unary, and binary ops. */
if (nargs < 2 || nargs > 3)
@@ -2490,27 +2490,17 @@ emit_soft_tfmode_libcall (func_name, nargs, operands)
/* TFmode arguments and return values are passed by reference. */
if (GET_MODE (this_arg) == TFmode)
{
- if (GET_CODE (this_arg) == MEM)
- {
- this_arg = XEXP (this_arg, 0);
+ int force_stack_temp;
- /* Make sure the output is not in the same place
- as one of our inputs. */
- if (i == 0)
- {
- for (j = 1; j < nargs; j++)
- if (rtx_equal_p (operands[0], operands[j]))
- break;
+ force_stack_temp = 0;
+ if (TARGET_BUGGY_QP_LIB && i == 0)
+ force_stack_temp = 1;
- if (j != nargs)
- {
- ret_slot = assign_stack_temp (TFmode,
- GET_MODE_SIZE (TFmode), 0);
- this_arg = XEXP (ret_slot, 0);
- }
- }
- }
- else if (CONSTANT_P (this_arg))
+ if (GET_CODE (this_arg) == MEM
+ && ! force_stack_temp)
+ this_arg = XEXP (this_arg, 0);
+ else if (CONSTANT_P (this_arg)
+ && ! force_stack_temp)
{
this_slot = force_const_mem (TFmode, this_arg);
this_arg = XEXP (this_slot, 0);
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 073debd..1b3b2ea 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -2598,6 +2598,11 @@ do { \
#define LTTF2_LIBCALL "_Q_flt"
#define LETF2_LIBCALL "_Q_fle"
+/* Assume by default that the _Qp_* 64-bit libcalls are implemented such
+ that the inputs are fully consumed before the output memory is clobbered. */
+
+#define TARGET_BUGGY_QP_LIB 0
+
/* We can define the TFmode sqrt optab only if TARGET_FPU. This is because
with soft-float, the SFmode and DFmode sqrt instructions will be absent,
and the compiler will notice and try to use the TFmode sqrt instruction