diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6085a4245bf..d5a3ce4aa0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2004-02-13 Ulrich Weigand + + * config/s390/s390-protos.h (s390_output_symbolic_const): Remove. + (s390_output_addr_const_extra): Declare. + (s390_output_pool_entry): Remove FILE * argument. + * config/s390/s390.c (s390_output_symbolic_const): Remove. + (s390_output_addr_const_extra): New function. + (print_operand_address): Call output_addr_const instead of + s390_output_symbolic_const. + (print_operand): Likewise. + (s390_output_pool_entry): Use assemble_integer for symbolic constants. + Remove FILE * argument. + * config/s390/s390.h (OUTPUT_ADDR_CONST_EXTRA): Define. + * config/s390/s390.md ("*pool_entry"): Adapt s390_output_pool_entry + call. + 2004-02-13 Zdenek Dvorak * cfgloopanal.c (mark_irreducible_loops): Rewriten. diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h index 90815a87938..49dad24b5e7 100644 --- a/gcc/config/s390/s390-protos.h +++ b/gcc/config/s390/s390-protos.h @@ -78,12 +78,11 @@ extern void s390_expand_clrstr (rtx, rtx); extern void s390_expand_cmpmem (rtx, rtx, rtx, rtx); extern rtx s390_return_addr_rtx (int, rtx); -extern void s390_output_symbolic_const (FILE *, rtx); +extern bool s390_output_addr_const_extra (FILE*, rtx); extern void print_operand_address (FILE *, rtx); extern void print_operand (FILE *, rtx, int); extern void s390_output_constant_pool (rtx, rtx); -extern void s390_output_pool_entry (FILE *, rtx, enum machine_mode, - unsigned int); +extern void s390_output_pool_entry (rtx, enum machine_mode, unsigned int); extern void s390_trampoline_template (FILE *); extern void s390_initialize_trampoline (rtx, rtx, rtx); extern rtx s390_gen_rtx_const_DI (int, int); diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 03585a813f8..914e261c474 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3301,98 +3301,63 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) return 0; } -/* Output symbolic constant X in assembler syntax to - stdio stream FILE. */ +/* Output machine-dependent UNSPECs occurring in address constant X + in assembler syntax to stdio stream FILE. Returns true if the + constant X could be recognized, false otherwise. */ -void -s390_output_symbolic_const (FILE *file, rtx x) +bool +s390_output_addr_const_extra (FILE *file, rtx x) { - switch (GET_CODE (x)) - { - case CONST: - case ZERO_EXTEND: - case SIGN_EXTEND: - s390_output_symbolic_const (file, XEXP (x, 0)); - break; + if (GET_CODE (x) == UNSPEC && XVECLEN (x, 0) == 1) + switch (XINT (x, 1)) + { + case UNSPEC_GOTENT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTENT"); + return true; + case UNSPEC_GOT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOT"); + return true; + case UNSPEC_GOTOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTOFF"); + return true; + case UNSPEC_PLT: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@PLT"); + return true; + case UNSPEC_PLTOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@PLTOFF"); + return true; + case UNSPEC_TLSGD: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@TLSGD"); + return true; + case UNSPEC_TLSLDM: + assemble_name (file, get_some_local_dynamic_name ()); + fprintf (file, "@TLSLDM"); + return true; + case UNSPEC_DTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@DTPOFF"); + return true; + case UNSPEC_NTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@NTPOFF"); + return true; + case UNSPEC_GOTNTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOTNTPOFF"); + return true; + case UNSPEC_INDNTPOFF: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@INDNTPOFF"); + return true; + } - case PLUS: - s390_output_symbolic_const (file, XEXP (x, 0)); - fprintf (file, "+"); - s390_output_symbolic_const (file, XEXP (x, 1)); - break; - - case MINUS: - s390_output_symbolic_const (file, XEXP (x, 0)); - fprintf (file, "-"); - s390_output_symbolic_const (file, XEXP (x, 1)); - break; - - case CONST_INT: - case LABEL_REF: - case CODE_LABEL: - case SYMBOL_REF: - output_addr_const (file, x); - break; - - case UNSPEC: - if (XVECLEN (x, 0) != 1) - output_operand_lossage ("invalid UNSPEC as operand (1)"); - switch (XINT (x, 1)) - { - case UNSPEC_GOTENT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTENT"); - break; - case UNSPEC_GOT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOT"); - break; - case UNSPEC_GOTOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTOFF"); - break; - case UNSPEC_PLT: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@PLT"); - break; - case UNSPEC_PLTOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@PLTOFF"); - break; - case UNSPEC_TLSGD: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@TLSGD"); - break; - case UNSPEC_TLSLDM: - assemble_name (file, get_some_local_dynamic_name ()); - fprintf (file, "@TLSLDM"); - break; - case UNSPEC_DTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@DTPOFF"); - break; - case UNSPEC_NTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@NTPOFF"); - break; - case UNSPEC_GOTNTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@GOTNTPOFF"); - break; - case UNSPEC_INDNTPOFF: - s390_output_symbolic_const (file, XVECEXP (x, 0, 0)); - fprintf (file, "@INDNTPOFF"); - break; - default: - output_operand_lossage ("invalid UNSPEC as operand (2)"); - break; - } - break; - - default: - fatal_insn ("UNKNOWN in s390_output_symbolic_const !?", x); - break; - } + return false; } /* Output address operand ADDR in assembler syntax to @@ -3409,7 +3374,7 @@ print_operand_address (FILE *file, rtx addr) output_operand_lossage ("Cannot decompose address."); if (ad.disp) - s390_output_symbolic_const (file, ad.disp); + output_addr_const (file, ad.disp); else fprintf (file, "0"); @@ -3483,7 +3448,7 @@ print_operand (FILE *file, rtx x, int code) abort (); if (ad.disp) - s390_output_symbolic_const (file, ad.disp); + output_addr_const (file, ad.disp); else fprintf (file, "0"); } @@ -3543,7 +3508,7 @@ print_operand (FILE *file, rtx x, int code) case CODE_LABEL: case LABEL_REF: case SYMBOL_REF: - s390_output_symbolic_const (file, x); + output_addr_const (file, x); break; case CONST_INT: @@ -4915,12 +4880,10 @@ s390_chunkify_cancel (struct constant_pool *pool_list) } -/* Output to FILE the constant pool entry EXP in mode MODE - with alignment ALIGN. */ +/* Output the constant pool entry EXP in mode MODE with alignment ALIGN. */ void -s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode, - unsigned int align) +s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) { REAL_VALUE_TYPE r; @@ -4935,18 +4898,7 @@ s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode, break; case MODE_INT: - if (GET_CODE (exp) == CONST - || GET_CODE (exp) == SYMBOL_REF - || GET_CODE (exp) == LABEL_REF) - { - fputs (integer_asm_op (GET_MODE_SIZE (mode), TRUE), file); - s390_output_symbolic_const (file, exp); - fputc ('\n', file); - } - else - { - assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); - } + assemble_integer (exp, GET_MODE_SIZE (mode), align, 1); break; default: diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 90a4d2c1622..f1386a7edcc 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -970,6 +970,13 @@ extern int flag_pic; #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) +/* Output machine-dependent UNSPECs in address constants. */ +#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \ +do { \ + if (!s390_output_addr_const_extra (FILE, (X))) \ + goto FAIL; \ +} while (0); + /* Output an element of a case-vector that is absolute. */ #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ do { \ diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 2ee15733171..874b19b681f 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -7403,7 +7403,7 @@ { enum machine_mode mode = GET_MODE (PATTERN (insn)); unsigned int align = GET_MODE_BITSIZE (mode); - s390_output_pool_entry (asm_out_file, operands[0], mode, align); + s390_output_pool_entry (operands[0], mode, align); return ""; } [(set_attr "op_type" "NN")