summaryrefslogtreecommitdiff
path: root/gcc/config/mmix
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/mmix')
-rw-r--r--gcc/config/mmix/mmix-protos.h1
-rw-r--r--gcc/config/mmix/mmix.c74
-rw-r--r--gcc/config/mmix/mmix.h42
3 files changed, 50 insertions, 67 deletions
diff --git a/gcc/config/mmix/mmix-protos.h b/gcc/config/mmix/mmix-protos.h
index e1b11a3aaf2..0a3aca1ca80 100644
--- a/gcc/config/mmix/mmix-protos.h
+++ b/gcc/config/mmix/mmix-protos.h
@@ -122,7 +122,6 @@ extern void mmix_canonicalize_comparison PARAMS ((RTX_CODE *, rtx *, rtx *));
extern int mmix_rtx_cost_recalculated
PARAMS ((rtx, RTX_CODE, RTX_CODE, int *));
extern int mmix_address_cost PARAMS ((rtx));
-extern void mmix_asm_output_double_int PARAMS ((FILE *, rtx, int));
extern void mmix_print_operand PARAMS ((FILE *, rtx, int));
extern void mmix_print_operand_address PARAMS ((FILE *, rtx));
extern int mmix_valid_comparison PARAMS ((RTX_CODE, enum machine_mode, rtx));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 6d1c72d2e90..9ba6c2d2b40 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -87,6 +87,7 @@ static void mmix_output_shifted_value PARAMS ((FILE *, HOST_WIDEST_INT));
static void mmix_output_condition PARAMS ((FILE *, rtx, int));
static HOST_WIDEST_INT mmix_intval PARAMS ((rtx));
static void mmix_output_octa PARAMS ((FILE *, HOST_WIDEST_INT, int));
+static bool mmix_assemble_integer PARAMS ((rtx, unsigned int, int));
static void mmix_init_machine_status PARAMS ((struct function *));
extern void mmix_target_asm_function_prologue
@@ -100,6 +101,17 @@ extern void mmix_target_asm_function_epilogue
/* Node: Function Entry */
+#undef TARGET_ASM_BYTE_OP
+#define TARGET_ASM_BYTE_OP NULL
+#undef TARGET_ASM_ALIGNED_HI_OP
+#define TARGET_ASM_ALIGNED_HI_OP NULL
+#undef TARGET_ASM_ALIGNED_SI_OP
+#define TARGET_ASM_ALIGNED_SI_OP NULL
+#undef TARGET_ASM_ALIGNED_DI_OP
+#define TARGET_ASM_ALIGNED_DI_OP NULL
+#undef TARGET_ASM_INTEGER
+#define TARGET_ASM_INTEGER mmix_assemble_integer
+
#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE mmix_target_asm_function_prologue
@@ -1911,31 +1923,45 @@ mmix_asm_output_float (stream, valuep)
+ 1)));
}
-/* ASM_OUTPUT_DOUBLE_INT. */
+/* Target hook for assembling integer objects. Use mmix_print_operand
+ for WYDE and TETRA. Use mmix_output_octa to output 8-byte
+ CONST_DOUBLEs. */
-void
-mmix_asm_output_double_int (stream, value, do_begin_end)
- FILE * stream;
- rtx value;
- int do_begin_end;
+static bool
+mmix_assemble_integer (x, size, aligned_p)
+ rtx x;
+ unsigned int size;
+ int aligned_p;
{
- if (do_begin_end)
- fprintf (stream, "\tOCTA ");
-
- if (GET_CODE (value) == CONST_DOUBLE)
- {
- /* Get the bit representation of this number. */
- HOST_WIDE_INT wval = mmix_intval (value);
- mmix_output_octa (stream, wval, 0);
- }
- else
- /* FIXME: We scrap the '@' symbol-modifier since it's not used
- anymore; we used to jump through lots of hoops, attempting to get
- mmixal-compatible symbols; defined before use (still failed). */
- output_addr_const (stream, value);
-
- if (do_begin_end)
- fprintf (stream, "\n");
+ if (aligned_p)
+ switch (size)
+ {
+ case 1:
+ fputs ("\tBYTE\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'B');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 2:
+ fputs ("\tWYDE\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'W');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 4:
+ fputs ("\tTETRA\t", asm_out_file);
+ mmix_print_operand (asm_out_file, x, 'L');
+ fputc ('\n', asm_out_file);
+ return true;
+
+ case 8:
+ if (GET_CODE (x) == CONST_DOUBLE)
+ mmix_output_octa (asm_out_file, mmix_intval (x), 0);
+ else
+ assemble_integer_with_op ("\tOCTA\t", x);
+ return true;
+ }
+ return default_assemble_integer (x, size, aligned_p);
}
/* ASM_OUTPUT_ASCII. */
@@ -2301,7 +2327,7 @@ mmix_print_operand (stream, x, code)
case CONST_DOUBLE:
/* Do somewhat as CONST_INT. */
- mmix_asm_output_double_int (stream, modified_x, 0);
+ mmix_output_octa (stream, mmix_intval (modified_x), 0);
return;
case CONST:
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 4fcc27ec2f9..8cb14e29f8a 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -972,42 +972,6 @@ const_section () \
#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
mmix_asm_output_float (STREAM, &VALUE)
-#define ASM_OUTPUT_DOUBLE_INT(STREAM, EXP) \
- mmix_asm_output_double_int (STREAM, EXP, 1)
-
-#define ASM_OUTPUT_INT(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tTETRA "); \
- mmix_print_operand (STREAM, EXP, 'L'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_SHORT(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tWYDE "); \
- mmix_print_operand (STREAM, EXP, 'W'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_CHAR(STREAM, EXP) \
- do { \
- fprintf (STREAM, "\tBYTE "); \
- mmix_print_operand (STREAM, EXP, 'B'); \
- fprintf (STREAM, "\n"); \
- } while (0)
-
-#define ASM_OUTPUT_BYTE(STREAM, VALUE) \
- fprintf (STREAM, "\tBYTE %d\n", (int) (VALUE) & 255)
-
-#define ASM_BYTE_OP "\tBYTE\t"
-
-/* We need these for DWARF2 EH data. If we don't define them, the
- ordinary BYTE, WYDE, TETRA and OCTA will be used, and those are
- aligning. */
-#define UNALIGNED_SHORT_ASM_OP "\t.2byte\t"
-#define UNALIGNED_INT_ASM_OP "\t.4byte\t"
-#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.8byte\t"
-
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
mmix_asm_output_ascii (STREAM, PTR, LEN)
@@ -1150,12 +1114,6 @@ const_section () \
mmix_asm_output_addr_vec_elt (STREAM, VALUE)
-/* FIXME: Add to docs; It is not mentioned at all that
- ASM_OUTPUT_ADDR_VEC_ELT is used if relative elements are
- used, and that the default expects an undocumented macro
- "ASM_LONG". */
-#define ASM_LONG "OCTA"
-
/* Node: Exception Region Output */
/* (empty) */