Commit 75959f0a by Richard Henderson Committed by Richard Henderson

alpha.c (xfloating_ops, [...]): New.

        * config/alpha/alpha.c (xfloating_ops, vax_cvt_ops): New.
        (alpha_lookup_xfloating_lib_func): Use them, return rtx.
        (alpha_emit_xfloating_arith): Update to match.
        (alpha_emit_xfloating_compare): Likewise.
        (alpha_emit_xfloating_cvt): Likewise.
        (alpha_emit_xfloating_libcall): Take already built symbol,
        mark call const.
        * config/alpha/alpha.md (extendsftf2, extenddftf2): Take
        op1 in a register.

From-SVN: r79371
parent 009368db
2004-03-11 Richard Henderson <rth@redhat.com> 2004-03-11 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (xfloating_ops, vax_cvt_ops): New.
(alpha_lookup_xfloating_lib_func): Use them, return rtx.
(alpha_emit_xfloating_arith): Update to match.
(alpha_emit_xfloating_compare): Likewise.
(alpha_emit_xfloating_cvt): Likewise.
(alpha_emit_xfloating_libcall): Take already built symbol,
mark call const.
* config/alpha/alpha.md (extendsftf2, extenddftf2): Take
op1 in a register.
2004-03-11 Richard Henderson <rth@redhat.com>
PR target/14539 PR target/14539
* config/alpha/alpha.h (STACK_BOUNDARY): Set to 128. * config/alpha/alpha.h (STACK_BOUNDARY): Set to 128.
......
...@@ -3564,85 +3564,65 @@ alpha_split_conditional_move (enum rtx_code code, rtx dest, rtx cond, ...@@ -3564,85 +3564,65 @@ alpha_split_conditional_move (enum rtx_code code, rtx dest, rtx cond,
/* Look up the function X_floating library function name for the /* Look up the function X_floating library function name for the
given operation. */ given operation. */
static const char * struct xfloating_op GTY(())
{
const enum rtx_code code;
const char *const GTY((skip(""))) osf_func;
const char *const GTY((skip(""))) vms_func;
rtx libcall;
};
static GTY(()) struct xfloating_op xfloating_ops[] =
{
{ PLUS, "_OtsAddX", "OTS$ADD_X", 0 },
{ MINUS, "_OtsSubX", "OTS$SUB_X", 0 },
{ MULT, "_OtsMulX", "OTS$MUL_X", 0 },
{ DIV, "_OtsDivX", "OTS$DIV_X", 0 },
{ EQ, "_OtsEqlX", "OTS$EQL_X", 0 },
{ NE, "_OtsNeqX", "OTS$NEQ_X", 0 },
{ LT, "_OtsLssX", "OTS$LSS_X", 0 },
{ LE, "_OtsLeqX", "OTS$LEQ_X", 0 },
{ GT, "_OtsGtrX", "OTS$GTR_X", 0 },
{ GE, "_OtsGeqX", "OTS$GEQ_X", 0 },
{ FIX, "_OtsCvtXQ", "OTS$CVTXQ", 0 },
{ FLOAT, "_OtsCvtQX", "OTS$CVTQX", 0 },
{ UNSIGNED_FLOAT, "_OtsCvtQUX", "OTS$CVTQUX", 0 },
{ FLOAT_EXTEND, "_OtsConvertFloatTX", "OTS$CVT_FLOAT_T_X", 0 },
{ FLOAT_TRUNCATE, "_OtsConvertFloatXT", "OTS$CVT_FLOAT_X_T", 0 }
};
static GTY(()) struct xfloating_op vax_cvt_ops[] =
{
{ FLOAT_EXTEND, "_OtsConvertFloatGX", "OTS$CVT_FLOAT_G_X", 0 },
{ FLOAT_TRUNCATE, "_OtsConvertFloatXG", "OTS$CVT_FLOAT_X_G", 0 }
};
static rtx
alpha_lookup_xfloating_lib_func (enum rtx_code code) alpha_lookup_xfloating_lib_func (enum rtx_code code)
{ {
struct xfloating_op struct xfloating_op *ops = xfloating_ops;
{ long n = ARRAY_SIZE (xfloating_ops);
const enum rtx_code code;
const char *const func;
};
static const struct xfloating_op vms_xfloating_ops[] =
{
{ PLUS, "OTS$ADD_X" },
{ MINUS, "OTS$SUB_X" },
{ MULT, "OTS$MUL_X" },
{ DIV, "OTS$DIV_X" },
{ EQ, "OTS$EQL_X" },
{ NE, "OTS$NEQ_X" },
{ LT, "OTS$LSS_X" },
{ LE, "OTS$LEQ_X" },
{ GT, "OTS$GTR_X" },
{ GE, "OTS$GEQ_X" },
{ FIX, "OTS$CVTXQ" },
{ FLOAT, "OTS$CVTQX" },
{ UNSIGNED_FLOAT, "OTS$CVTQUX" },
{ FLOAT_EXTEND, "OTS$CVT_FLOAT_T_X" },
{ FLOAT_TRUNCATE, "OTS$CVT_FLOAT_X_T" },
};
static const struct xfloating_op osf_xfloating_ops[] =
{
{ PLUS, "_OtsAddX" },
{ MINUS, "_OtsSubX" },
{ MULT, "_OtsMulX" },
{ DIV, "_OtsDivX" },
{ EQ, "_OtsEqlX" },
{ NE, "_OtsNeqX" },
{ LT, "_OtsLssX" },
{ LE, "_OtsLeqX" },
{ GT, "_OtsGtrX" },
{ GE, "_OtsGeqX" },
{ FIX, "_OtsCvtXQ" },
{ FLOAT, "_OtsCvtQX" },
{ UNSIGNED_FLOAT, "_OtsCvtQUX" },
{ FLOAT_EXTEND, "_OtsConvertFloatTX" },
{ FLOAT_TRUNCATE, "_OtsConvertFloatXT" },
};
const struct xfloating_op *ops;
const long n = ARRAY_SIZE (osf_xfloating_ops);
long i; long i;
/* How irritating. Nothing to key off for the table. Hardcode /* How irritating. Nothing to key off for the main table. */
knowledge of the G_floating routines. */ if (TARGET_FLOAT_VAX && (code == FLOAT_EXTEND || code == FLOAT_TRUNCATE))
if (TARGET_FLOAT_VAX)
{ {
if (TARGET_ABI_OPEN_VMS) ops = vax_cvt_ops;
{ n = ARRAY_SIZE (vax_cvt_ops);
if (code == FLOAT_EXTEND)
return "OTS$CVT_FLOAT_G_X";
if (code == FLOAT_TRUNCATE)
return "OTS$CVT_FLOAT_X_G";
}
else
{
if (code == FLOAT_EXTEND)
return "_OtsConvertFloatGX";
if (code == FLOAT_TRUNCATE)
return "_OtsConvertFloatXG";
}
} }
if (TARGET_ABI_OPEN_VMS) for (i = 0; i < n; ++i, ++ops)
ops = vms_xfloating_ops; if (ops->code == code)
else {
ops = osf_xfloating_ops; rtx func = ops->libcall;
if (!func)
for (i = 0; i < n; ++i) {
if (ops[i].code == code) func = init_one_libfunc (TARGET_ABI_OPEN_VMS
return ops[i].func; ? ops->vms_func : ops->osf_func);
ops->libcall = func;
}
return func;
}
abort(); abort();
} }
...@@ -3688,7 +3668,7 @@ alpha_compute_xfloating_mode_arg (enum rtx_code code, ...@@ -3688,7 +3668,7 @@ alpha_compute_xfloating_mode_arg (enum rtx_code code,
TFmode arguments are passed in two integer registers (as opposed to TFmode arguments are passed in two integer registers (as opposed to
indirect); TFmode return values appear in R16+R17. indirect); TFmode return values appear in R16+R17.
FUNC is the function name to call. FUNC is the function to call.
TARGET is where the output belongs. TARGET is where the output belongs.
OPERANDS are the inputs. OPERANDS are the inputs.
NOPERANDS is the count of inputs. NOPERANDS is the count of inputs.
...@@ -3696,7 +3676,7 @@ alpha_compute_xfloating_mode_arg (enum rtx_code code, ...@@ -3696,7 +3676,7 @@ alpha_compute_xfloating_mode_arg (enum rtx_code code,
*/ */
static void static void
alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[], alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[],
int noperands, rtx equiv) int noperands, rtx equiv)
{ {
rtx usage = NULL_RTX, tmp, reg; rtx usage = NULL_RTX, tmp, reg;
...@@ -3750,10 +3730,11 @@ alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[], ...@@ -3750,10 +3730,11 @@ alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[],
abort (); abort ();
} }
tmp = gen_rtx_MEM (QImode, init_one_libfunc (func)); tmp = gen_rtx_MEM (QImode, func);
tmp = emit_call_insn (GEN_CALL_VALUE (reg, tmp, const0_rtx, tmp = emit_call_insn (GEN_CALL_VALUE (reg, tmp, const0_rtx,
const0_rtx, const0_rtx)); const0_rtx, const0_rtx));
CALL_INSN_FUNCTION_USAGE (tmp) = usage; CALL_INSN_FUNCTION_USAGE (tmp) = usage;
CONST_OR_PURE_CALL_P (tmp) = 1;
tmp = get_insns (); tmp = get_insns ();
end_sequence (); end_sequence ();
...@@ -3766,7 +3747,7 @@ alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[], ...@@ -3766,7 +3747,7 @@ alpha_emit_xfloating_libcall (const char *func, rtx target, rtx operands[],
void void
alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[]) alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[])
{ {
const char *func; rtx func;
int mode; int mode;
rtx out_operands[3]; rtx out_operands[3];
...@@ -3786,7 +3767,7 @@ alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[]) ...@@ -3786,7 +3767,7 @@ alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[])
static rtx static rtx
alpha_emit_xfloating_compare (enum rtx_code code, rtx op0, rtx op1) alpha_emit_xfloating_compare (enum rtx_code code, rtx op0, rtx op1)
{ {
const char *func; rtx func;
rtx out, operands[2]; rtx out, operands[2];
func = alpha_lookup_xfloating_lib_func (code); func = alpha_lookup_xfloating_lib_func (code);
...@@ -3810,7 +3791,7 @@ alpha_emit_xfloating_cvt (enum rtx_code orig_code, rtx operands[]) ...@@ -3810,7 +3791,7 @@ alpha_emit_xfloating_cvt (enum rtx_code orig_code, rtx operands[])
{ {
int noperands = 1, mode; int noperands = 1, mode;
rtx out_operands[2]; rtx out_operands[2];
const char *func; rtx func;
enum rtx_code code = orig_code; enum rtx_code code = orig_code;
if (code == UNSIGNED_FIX) if (code == UNSIGNED_FIX)
......
...@@ -2630,9 +2630,12 @@ ...@@ -2630,9 +2630,12 @@
st%- %1,%0" st%- %1,%0"
[(set_attr "type" "fcpys,fld,fst")]) [(set_attr "type" "fcpys,fld,fst")])
;; Use register_operand for operand 1 to prevent compress_float_constant
;; from doing something silly. When optimizing we'll put things back
;; together anyway.
(define_expand "extendsftf2" (define_expand "extendsftf2"
[(use (match_operand:TF 0 "register_operand" "")) [(use (match_operand:TF 0 "register_operand" ""))
(use (match_operand:SF 1 "general_operand" ""))] (use (match_operand:SF 1 "register_operand" ""))]
"TARGET_HAS_XFLOATING_LIBS" "TARGET_HAS_XFLOATING_LIBS"
{ {
rtx tmp = gen_reg_rtx (DFmode); rtx tmp = gen_reg_rtx (DFmode);
...@@ -2643,7 +2646,7 @@ ...@@ -2643,7 +2646,7 @@
(define_expand "extenddftf2" (define_expand "extenddftf2"
[(use (match_operand:TF 0 "register_operand" "")) [(use (match_operand:TF 0 "register_operand" ""))
(use (match_operand:DF 1 "general_operand" ""))] (use (match_operand:DF 1 "register_operand" ""))]
"TARGET_HAS_XFLOATING_LIBS" "TARGET_HAS_XFLOATING_LIBS"
"alpha_emit_xfloating_cvt (FLOAT_EXTEND, operands); DONE;") "alpha_emit_xfloating_cvt (FLOAT_EXTEND, operands); DONE;")
......
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