Commit 9cb8fcaf by Geoff Keating Committed by Geoffrey Keating

aix.h (RS6000_ITRUNC): Moved from rs6000.h.

	* config/rs6000/aix.h (RS6000_ITRUNC): Moved from rs6000.h.
	(RS6000_UITRUNC): Likewise.
	(INIT_TARGET_OPTABS): New macro.
	* config/rs6000/rs6000.c (rs6000_trunc_used): Delete.
	(trunc_defined): Delete.
	(output_prolog): Don't output .extern definitions for fp->int
	conversion routines, ASM_OUTPUT_EXTERNAL_LIBCALL will do it.
	* config/rs6000/rs6000.h (rs6000_trunc_used): Delete.
	(trunc_defined): Delete.
	(RS6000_ITRUNC): Moved to aix.h.
	(RS6000_UITRUNC): Likewise.
	* config/rs6000/rs6000.md (fix_truncdfsi2): Fail if it would
	only emit a libcall.
	(fixuns_truncdfsi2): Delete.
	(trunc_call): Delete.
	(trunc_call_rtl): Delete.

From-SVN: r36310
parent 8f820299
2000-09-10 Geoff Keating <geoffk@cygnus.com>
* config/rs6000/aix.h (RS6000_ITRUNC): Moved from rs6000.h.
(RS6000_UITRUNC): Likewise.
(INIT_TARGET_OPTABS): New macro.
* config/rs6000/rs6000.c (rs6000_trunc_used): Delete.
(trunc_defined): Delete.
(output_prolog): Don't output .extern definitions for fp->int
conversion routines, ASM_OUTPUT_EXTERNAL_LIBCALL will do it.
* config/rs6000/rs6000.h (rs6000_trunc_used): Delete.
(trunc_defined): Delete.
(RS6000_ITRUNC): Moved to aix.h.
(RS6000_UITRUNC): Likewise.
* config/rs6000/rs6000.md (fix_truncdfsi2): Fail if it would
only emit a libcall.
(fixuns_truncdfsi2): Delete.
(trunc_call): Delete.
(trunc_call_rtl): Delete.
2000-09-10 Zack Weinberg <zack@wolery.cumb.org>
* varasm.c (make_decl_rtl): Restore leading star on
......
......@@ -275,6 +275,22 @@ toc_section () \
/* Function name to call to do profiling. */
#define RS6000_MCOUNT ".__mcount"
/* Function names to call to do floating point truncation. */
#define RS6000_ITRUNC "__itrunc"
#define RS6000_UITRUNC "__uitrunc"
/* Optabs entries for the int->float routines, using the standard
AIX names. */
#define INIT_TARGET_OPTABS \
do { \
if (! TARGET_POWER2 && ! TARGET_POWERPC && TARGET_HARD_FLOAT) \
{ \
fixdfsi_libfunc = init_one_libfunc (RS6000_ITRUNC); \
fixunsdfsi_libfunc = init_one_libfunc (RS6000_UITRUNC); \
} \
} while (0)
/* AIX always has a TOC. */
#define TARGET_NO_TOC 0
#define TARGET_TOC 1
......
......@@ -63,15 +63,6 @@ struct rs6000_cpu_select rs6000_select[3] =
{ (const char *)0, "-mtune=", 1, 0 },
};
/* Set to non-zero by "fix" operation to indicate that itrunc and
uitrunc must be defined. */
int rs6000_trunc_used;
/* Set to non-zero once they have been defined. */
static int trunc_defined;
/* Set to non-zero once AIX common-mode calls have been defined. */
static int common_mode_defined;
......@@ -5794,14 +5785,6 @@ output_prolog (file, size)
SAVE_FP_PREFIX, info->first_fp_reg_save - 32, SAVE_FP_SUFFIX,
RESTORE_FP_PREFIX, info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX);
/* Write .extern for truncation routines, if needed. */
if (rs6000_trunc_used && ! trunc_defined)
{
fprintf (file, "\t.extern .%s\n\t.extern .%s\n",
RS6000_ITRUNC, RS6000_UITRUNC);
trunc_defined = 1;
}
/* Write .extern for AIX common mode routines, if needed. */
if (! TARGET_POWER && ! TARGET_POWERPC && ! common_mode_defined)
{
......
......@@ -2302,17 +2302,6 @@ do { \
extern struct rtx_def *rs6000_compare_op0, *rs6000_compare_op1;
extern int rs6000_compare_fp_p;
/* Set to non-zero by "fix" operation to indicate that itrunc and
uitrunc must be defined. */
extern int rs6000_trunc_used;
/* Function names to call to do floating point truncation. */
#define RS6000_ITRUNC "__itrunc"
#define RS6000_UITRUNC "__uitrunc"
/* Control the assembler format that we output. */
......
......@@ -5339,16 +5339,9 @@
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
(clobber (match_dup 2))
(clobber (match_dup 3))])]
"TARGET_HARD_FLOAT"
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"
{
if (! TARGET_POWER2 && ! TARGET_POWERPC)
{
emit_insn (gen_trunc_call (operands[0], operands[1],
gen_rtx_SYMBOL_REF (Pmode, RS6000_ITRUNC)));
DONE;
}
operands[2] = gen_reg_rtx (DImode);
operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
}")
......@@ -5358,7 +5351,7 @@
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
(clobber (match_operand:DI 3 "memory_operand" "=o"))]
"TARGET_HARD_FLOAT"
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
"#"
[(set_attr "length" "16")])
......@@ -5367,7 +5360,7 @@
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" ""))
(clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
"TARGET_HARD_FLOAT"
"(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
[(set (match_operand:SI 0 "gpc_reg_operand" "")
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
(clobber (match_operand:DI 2 "gpc_reg_operand" ""))
......@@ -5387,51 +5380,6 @@
DONE;
}")
(define_expand "fixuns_truncdfsi2"
[(set (match_operand:SI 0 "gpc_reg_operand" "")
(unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))]
"! TARGET_POWER2 && ! TARGET_POWERPC && TARGET_HARD_FLOAT"
"
{
emit_insn (gen_trunc_call (operands[0], operands[1],
gen_rtx_SYMBOL_REF (Pmode, RS6000_UITRUNC)));
DONE;
}")
(define_expand "trunc_call"
[(parallel [(set (match_operand:SI 0 "" "")
(fix:SI (match_operand:DF 1 "" "")))
(use (match_operand:SI 2 "" ""))])]
"TARGET_HARD_FLOAT"
"
{
rtx insns = gen_trunc_call_rtl (operands[0], operands[1], operands[2]);
rtx first = XVECEXP (insns, 0, 0);
rtx last = XVECEXP (insns, 0, XVECLEN (insns, 0) - 1);
REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
REG_NOTES (first));
REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last));
emit_insn (insns);
DONE;
}")
(define_expand "trunc_call_rtl"
[(set (reg:DF 33) (match_operand:DF 1 "gpc_reg_operand" ""))
(use (reg:DF 33))
(parallel [(set (reg:SI 3)
(call (mem:SI (match_operand 2 "" "")) (const_int 0)))
(use (const_int 0))
(clobber (scratch:SI))])
(set (match_operand:SI 0 "gpc_reg_operand" "")
(reg:SI 3))]
"TARGET_HARD_FLOAT"
"
{
rs6000_trunc_used = 1;
}")
; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] 10))
; rather than (set (subreg:SI (reg)) (fix:SI ...))
; because the first makes it clear that operand 0 is not live
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment