Commit be7560ea by Richard Henderson Committed by Richard Henderson

alpha.c (get_trap_mode_suffix): New.

        * config/alpha/alpha.c (get_trap_mode_suffix): New.
        (get_round_mode_suffix): New.
        (print_operand): Use them for [/].  Remove support for [&'`()+].
        * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Update.
        * config/alpha/alpha.md (attr round_suffix): New.
        (attr trap_suffix): New.
        (all insns): Set them appropriately.  Use %/ instead of the
        myriad punctuators.

From-SVN: r44242
parent e5d4fff4
2001-07-22 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.c (get_trap_mode_suffix): New.
(get_round_mode_suffix): New.
(print_operand): Use them for [/]. Remove support for [&'`()+].
* config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Update.
* config/alpha/alpha.md (attr round_suffix): New.
(attr trap_suffix): New.
(all insns): Set them appropriately. Use %/ instead of the
myriad punctuators.
2001-07-22 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* dbxout.c, sdbout.c, varasm.c: Revert most recent debug patch.
......
......@@ -119,6 +119,10 @@ static int alpha_does_function_need_gp
PARAMS ((void));
static int alpha_ra_ever_killed
PARAMS ((void));
static const char *get_trap_mode_suffix
PARAMS ((void));
static const char *get_round_mode_suffix
PARAMS ((void));
static rtx set_frame_related_p
PARAMS ((void));
static const char *alpha_lookup_xfloating_lib_func
......@@ -3719,132 +3723,141 @@ alpha_ra_ever_killed ()
}
/* Print an operand. Recognize special options, documented below. */
/* Return the trap mode suffix applicable to the current
instruction, or NULL. */
void
print_operand (file, x, code)
FILE *file;
rtx x;
int code;
static const char *
get_trap_mode_suffix ()
{
int i;
enum attr_trap_suffix s = get_attr_trap_suffix (current_output_insn);
switch (code)
switch (s)
{
case '~':
/* Print the assembler name of the current function. */
assemble_name (file, alpha_fnname);
break;
case '&':
/* Generates fp-rounding mode suffix: nothing for normal, 'c' for
chopped, 'm' for minus-infinity, and 'd' for dynamic rounding
mode. alpha_fprm controls which suffix is generated. */
switch (alpha_fprm)
{
case ALPHA_FPRM_NORM:
break;
case ALPHA_FPRM_MINF:
fputc ('m', file);
break;
case ALPHA_FPRM_CHOP:
fputc ('c', file);
break;
case ALPHA_FPRM_DYN:
fputc ('d', file);
break;
default:
abort ();
}
break;
case TRAP_SUFFIX_NONE:
return NULL;
case '\'':
/* Generates trap-mode suffix for instructions that accept the su
suffix only (cmpt et al). */
case TRAP_SUFFIX_SU:
if (alpha_fptm >= ALPHA_FPTM_SU)
fputs ("su", file);
break;
return "su";
return NULL;
case '`':
/* Generates trap-mode suffix for instructions that accept the
v and sv suffix. The only instruction that needs this is cvtql. */
case TRAP_SUFFIX_SUI:
if (alpha_fptm >= ALPHA_FPTM_SUI)
return "sui";
return NULL;
case TRAP_SUFFIX_V_SV:
switch (alpha_fptm)
{
case ALPHA_FPTM_N:
break;
return NULL;
case ALPHA_FPTM_U:
fputs ("v", file);
break;
return "v";
case ALPHA_FPTM_SU:
case ALPHA_FPTM_SUI:
fputs ("sv", file);
break;
return "sv";
}
break;
case '(':
/* Generates trap-mode suffix for instructions that accept the
v, sv, and svi suffix. The only instruction that needs this
is cvttq. */
case TRAP_SUFFIX_V_SV_SVI:
switch (alpha_fptm)
{
case ALPHA_FPTM_N:
break;
return NULL;
case ALPHA_FPTM_U:
fputs ("v", file);
break;
return "v";
case ALPHA_FPTM_SU:
fputs ("sv", file);
break;
return "sv";
case ALPHA_FPTM_SUI:
fputs ("svi", file);
break;
return "svi";
}
break;
case ')':
/* Generates trap-mode suffix for instructions that accept the u, su,
and sui suffix. This is the bulk of the IEEE floating point
instructions (addt et al). */
case TRAP_SUFFIX_U_SU_SUI:
switch (alpha_fptm)
{
case ALPHA_FPTM_N:
break;
return NULL;
case ALPHA_FPTM_U:
fputc ('u', file);
break;
return "u";
case ALPHA_FPTM_SU:
fputs ("su", file);
break;
return "su";
case ALPHA_FPTM_SUI:
fputs ("sui", file);
break;
return "sui";
}
break;
}
abort ();
}
case '+':
/* Generates trap-mode suffix for instructions that accept the sui
suffix (cvtqt and cvtqs). */
switch (alpha_fptm)
/* Return the rounding mode suffix applicable to the current
instruction, or NULL. */
static const char *
get_round_mode_suffix ()
{
enum attr_round_suffix s = get_attr_round_suffix (current_output_insn);
switch (s)
{
case ROUND_SUFFIX_NONE:
return NULL;
case ROUND_SUFFIX_NORMAL:
switch (alpha_fprm)
{
case ALPHA_FPTM_N:
case ALPHA_FPTM_U:
case ALPHA_FPTM_SU: /* cvtqt/cvtqs can't cause underflow */
break;
case ALPHA_FPTM_SUI:
fputs ("sui", file);
break;
case ALPHA_FPRM_NORM:
return NULL;
case ALPHA_FPRM_MINF:
return "m";
case ALPHA_FPRM_CHOP:
return "c";
case ALPHA_FPRM_DYN:
return "d";
}
break;
case ROUND_SUFFIX_C:
return "c";
}
abort ();
}
/* Print an operand. Recognize special options, documented below. */
void
print_operand (file, x, code)
FILE *file;
rtx x;
int code;
{
int i;
switch (code)
{
case '~':
/* Print the assembler name of the current function. */
assemble_name (file, alpha_fnname);
break;
case '/':
{
const char *trap = get_trap_mode_suffix ();
const char *round = get_round_mode_suffix ();
if (trap || round)
fprintf (file, "/%s%s", (trap ? trap : ""), (round ? round : ""));
break;
}
case ',':
/* Generates single precision instruction suffix. */
fprintf (file, "%c", (TARGET_FLOAT_VAX ? 'f' : 's'));
fputc ((TARGET_FLOAT_VAX ? 'f' : 's'), file);
break;
case '-':
/* Generates double precision instruction suffix. */
fprintf (file, "%c", (TARGET_FLOAT_VAX ? 'g' : 't'));
fputc ((TARGET_FLOAT_VAX ? 'g' : 't'), file);
break;
case 'r':
......
......@@ -2234,26 +2234,8 @@ do { \
~ Generates the name of the current function.
& Generates fp-rounding mode suffix: nothing for normal, 'c' for
chopped, 'm' for minus-infinity, and 'd' for dynamic rounding
mode. alpha_fprm controls which suffix is generated.
' Generates trap-mode suffix for instructions that accept the
su suffix only (cmpt et al).
` Generates trap-mode suffix for instructions that accept the
v and sv suffix. The only instruction that needs this is cvtql.
( Generates trap-mode suffix for instructions that accept the
v, sv, and svi suffix. The only instruction that needs this
is cvttq.
) Generates trap-mode suffix for instructions that accept the
u, su, and sui suffix. This is the bulk of the IEEE floating
point instructions (addt et al).
+ Generates trap-mode suffix for instructions that accept the
sui suffix (cvtqt and cvtqs).
/ Generates the instruction suffix. The TRAP_SUFFIX and ROUND_SUFFIX
attributes are examined to determine what is appropriate.
, Generates single precision suffix for floating point
instructions (s for IEEE, f for VAX)
......@@ -2262,10 +2244,8 @@ do { \
instructions (t for IEEE, g for VAX)
*/
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '&' || (CODE) == '`' || (CODE) == '\'' || (CODE) == '(' \
|| (CODE) == ')' || (CODE) == '+' || (CODE) == ',' || (CODE) == '-' \
|| (CODE) == '~')
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '/' || (CODE) == ',' || (CODE) == '-' || (CODE) == '~')
/* Print a memory address as an operand to reference that memory location. */
......
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