Commit 80f33d06 by Graham Stott

i386.c (ix86_asm_dialect): Fix enum type.


        * config/i386/i386.c (ix86_asm_dialect): Fix enum type.

        (override_options): Delete abs macro unused.

        (output_pic_addr_const): Use ASM_ATT/ASM_INTEL enumerations
        when testing ASSEMBLER_DIALECT.

        (print_reg): Likewise.
        (print_operand): Likewise.
        (print_operand_address): Likewise.
        (print_operand): abort if ASSEMBLER_DIALECT is unknown dialect.

        * config/i386/i386.h (ix86_asm_dialect): Fix enum type.

        (FIND_BASE_TERM): Fix typo.

From-SVN: r48393
parent 0023400b
...@@ -590,11 +590,11 @@ struct ix86_frame ...@@ -590,11 +590,11 @@ struct ix86_frame
const char *ix86_debug_arg_string, *ix86_debug_addr_string; const char *ix86_debug_arg_string, *ix86_debug_addr_string;
/* Code model option as passed by user. */ /* Code model option as passed by user. */
const char *ix86_cmodel_string; const char *ix86_cmodel_string;
/* Asm dialect. */
const char *ix86_asm_string;
enum cmodel ix86_asm_dialect = ASM_ATT;
/* Parsed value. */ /* Parsed value. */
enum cmodel ix86_cmodel; enum cmodel ix86_cmodel;
/* Asm dialect. */
const char *ix86_asm_string;
enum asm_dialect ix86_asm_dialect = ASM_ATT;
/* which cpu are we scheduling for */ /* which cpu are we scheduling for */
enum processor_type ix86_cpu; enum processor_type ix86_cpu;
...@@ -1062,7 +1062,6 @@ override_options () ...@@ -1062,7 +1062,6 @@ override_options ()
} }
/* Default align_* from the processor table. */ /* Default align_* from the processor table. */
#define abs(n) (n < 0 ? -n : n)
if (align_loops == 0) if (align_loops == 0)
{ {
align_loops = processor_target_table[ix86_cpu].align_loop; align_loops = processor_target_table[ix86_cpu].align_loop;
...@@ -5288,11 +5287,11 @@ output_pic_addr_const (file, x, code) ...@@ -5288,11 +5287,11 @@ output_pic_addr_const (file, x, code)
break; break;
case MINUS: case MINUS:
putc (ASSEMBLER_DIALECT ? '(' : '[', file); putc (ASSEMBLER_DIALECT == ASM_INTEL ? '(' : '[', file);
output_pic_addr_const (file, XEXP (x, 0), code); output_pic_addr_const (file, XEXP (x, 0), code);
putc ('-', file); putc ('-', file);
output_pic_addr_const (file, XEXP (x, 1), code); output_pic_addr_const (file, XEXP (x, 1), code);
putc (ASSEMBLER_DIALECT ? ')' : ']', file); putc (ASSEMBLER_DIALECT == ASM_INTEL ? ')' : ']', file);
break; break;
case UNSPEC: case UNSPEC:
...@@ -5488,7 +5487,7 @@ print_reg (x, code, file) ...@@ -5488,7 +5487,7 @@ print_reg (x, code, file)
|| REGNO (x) == FPSR_REG) || REGNO (x) == FPSR_REG)
abort (); abort ();
if (ASSEMBLER_DIALECT == 0 || USER_LABEL_PREFIX[0] == 0) if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0)
putc ('%', file); putc ('%', file);
if (code == 'w' || MMX_REG_P (x)) if (code == 'w' || MMX_REG_P (x))
...@@ -5600,14 +5599,14 @@ print_operand (file, x, code) ...@@ -5600,14 +5599,14 @@ print_operand (file, x, code)
switch (code) switch (code)
{ {
case '*': case '*':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('*', file); putc ('*', file);
return; return;
case 'A': case 'A':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('*', file); putc ('*', file);
else if (ASSEMBLER_DIALECT == 1) else if (ASSEMBLER_DIALECT == ASM_INTEL)
{ {
/* Intel syntax. For absolute addresses, registers should not /* Intel syntax. For absolute addresses, registers should not
be surrounded by braces. */ be surrounded by braces. */
...@@ -5619,38 +5618,40 @@ print_operand (file, x, code) ...@@ -5619,38 +5618,40 @@ print_operand (file, x, code)
return; return;
} }
} }
else
abort ();
PRINT_OPERAND (file, x, 0); PRINT_OPERAND (file, x, 0);
return; return;
case 'L': case 'L':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('l', file); putc ('l', file);
return; return;
case 'W': case 'W':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('w', file); putc ('w', file);
return; return;
case 'B': case 'B':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('b', file); putc ('b', file);
return; return;
case 'Q': case 'Q':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('l', file); putc ('l', file);
return; return;
case 'S': case 'S':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('s', file); putc ('s', file);
return; return;
case 'T': case 'T':
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('t', file); putc ('t', file);
return; return;
...@@ -5833,7 +5834,7 @@ print_operand (file, x, code) ...@@ -5833,7 +5834,7 @@ print_operand (file, x, code)
else if (GET_CODE (x) == MEM) else if (GET_CODE (x) == MEM)
{ {
/* No `byte ptr' prefix for call instructions. */ /* No `byte ptr' prefix for call instructions. */
if (ASSEMBLER_DIALECT != 0 && code != 'X' && code != 'P') if (ASSEMBLER_DIALECT == ASM_INTEL && code != 'X' && code != 'P')
{ {
const char * size; const char * size;
switch (GET_MODE_SIZE (GET_MODE (x))) switch (GET_MODE_SIZE (GET_MODE (x)))
...@@ -5879,7 +5880,7 @@ print_operand (file, x, code) ...@@ -5879,7 +5880,7 @@ print_operand (file, x, code)
REAL_VALUE_FROM_CONST_DOUBLE (r, x); REAL_VALUE_FROM_CONST_DOUBLE (r, x);
REAL_VALUE_TO_TARGET_SINGLE (r, l); REAL_VALUE_TO_TARGET_SINGLE (r, l);
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('$', file); putc ('$', file);
fprintf (file, "0x%lx", l); fprintf (file, "0x%lx", l);
} }
...@@ -5911,13 +5912,13 @@ print_operand (file, x, code) ...@@ -5911,13 +5912,13 @@ print_operand (file, x, code)
{ {
if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
{ {
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('$', file); putc ('$', file);
} }
else if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF else if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF
|| GET_CODE (x) == LABEL_REF) || GET_CODE (x) == LABEL_REF)
{ {
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('$', file); putc ('$', file);
else else
fputs ("OFFSET FLAT:", file); fputs ("OFFSET FLAT:", file);
...@@ -5957,7 +5958,7 @@ print_operand_address (file, addr) ...@@ -5957,7 +5958,7 @@ print_operand_address (file, addr)
if (GET_CODE (disp) == CONST_INT) if (GET_CODE (disp) == CONST_INT)
{ {
if (ASSEMBLER_DIALECT != 0) if (ASSEMBLER_DIALECT == ASM_INTEL)
{ {
if (USER_LABEL_PREFIX[0] == 0) if (USER_LABEL_PREFIX[0] == 0)
putc ('%', file); putc ('%', file);
...@@ -5976,7 +5977,7 @@ print_operand_address (file, addr) ...@@ -5976,7 +5977,7 @@ print_operand_address (file, addr)
} }
else else
{ {
if (ASSEMBLER_DIALECT == 0) if (ASSEMBLER_DIALECT == ASM_ATT)
{ {
if (disp) if (disp)
{ {
......
...@@ -3118,8 +3118,8 @@ enum asm_dialect { ...@@ -3118,8 +3118,8 @@ enum asm_dialect {
ASM_INTEL ASM_INTEL
}; };
extern const char *ix86_asm_string; extern const char *ix86_asm_string;
extern enum cmodel ix86_asm_dialect; extern enum asm_dialect ix86_asm_dialect;
/* Valud of -mcmodel specified by user. */ /* Value of -mcmodel specified by user. */
extern const char *ix86_cmodel_string; extern const char *ix86_cmodel_string;
extern enum cmodel ix86_cmodel; extern enum cmodel ix86_cmodel;
......
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