--- gcc/config/i860.h 2018/04/24 17:51:33 1.1 +++ gcc/config/i860.h 2018/04/24 18:04:33 1.1.1.4 @@ -75,9 +75,15 @@ extern int target_flags; /* Define this if most significant word of a multiword number is the lowest numbered. */ /* For the i860 this goes with BYTES_BIG_ENDIAN. */ +/* NOTE: GCC probably cannot support a big-endian i860 + because GCC fundamentally assumes that the order of words + in memory as the same as the order in registers. + That's not true for the big-endian i860. + The big-endian i860 isn't important enough to + justify the trouble of changing this assumption. */ #define WORDS_BIG_ENDIAN 0 -/* number of bits in an addressible storage unit */ +/* number of bits in an addressable storage unit */ #define BITS_PER_UNIT 8 /* Width in bits of a "word", which is the contents of a machine register. @@ -117,9 +123,9 @@ extern int target_flags; boundaries. */ #define BIGGEST_ALIGNMENT 128 -/* Define this if move instructions will actually fail to work +/* Set this nonzero if move instructions will actually fail to work when given unaligned data. */ -#define STRICT_ALIGNMENT +#define STRICT_ALIGNMENT 1 /* If bit field type is int, dont let it cross an int, and give entire struct the alignment of an int. */ @@ -201,7 +207,7 @@ extern int target_flags; */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ (((REGNO) < 32) \ - || ((MODE) == VOIDmode) \ + || (MODE) == VOIDmode || (MODE) == BLKmode \ || REGNO_MODE_ALIGNED (REGNO, MODE)) /* Value is 1 if it is a good idea to tie two pseudo registers @@ -350,10 +356,16 @@ enum reg_class { NO_REGS, GENERAL_REGS, integer register to an FP register. If we are trying to put a non-zero floating-point constant into some register, use an integer register if the constant is SFmode and GENERAL_REGS is one of our options. - Otherwise, put the constant intoo memory. */ + Otherwise, put the constant into memory. + + When reloading something smaller than a word, use a general reg + rather than an FP reg. */ #define PREFERRED_RELOAD_CLASS(X,CLASS) \ ((CLASS) == ALL_REGS && GET_CODE (X) == CONST_INT ? GENERAL_REGS \ + : ((GET_MODE (X) == HImode || GET_MODE (X) == QImode) \ + && (CLASS) == ALL_REGS) \ + ? GENERAL_REGS \ : (GET_CODE (X) == CONST_DOUBLE \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! CONST_DOUBLE_OK_FOR_LETTER_P (X, 'G')) \ @@ -896,7 +908,7 @@ struct cumulative_args { int ints, float of a switch statement. If the code is computed here, return it with a return statement. Otherwise, break from the switch. */ -#define CONST_COSTS(RTX,CODE) \ +#define CONST_COSTS(RTX,CODE, OUTER_CODE) \ case CONST_INT: \ if (INTVAL (RTX) == 0) \ return 0; \ @@ -904,9 +916,9 @@ struct cumulative_args { int ints, float case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ - return 2; \ + return 4; \ case CONST_DOUBLE: \ - return 4; + return 6; /* Specify the cost of a branch insn; roughly the number of extra insns that should be added to avoid a branch. @@ -1049,8 +1061,11 @@ struct cumulative_args { int ints, float /* This is how to output an internal numbered label which labels a jump table. */ -#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \ - fprintf (FILE, "\t.align\t4\n.%s%d:\n", PREFIX, NUM) +#undef ASM_OUTPUT_CASE_LABEL +#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \ +do { ASM_OUTPUT_ALIGN ((FILE), 2); \ + ASM_OUTPUT_INTERNAL_LABEL ((FILE), PREFIX, NUM); \ + } while (0) /* Output at the end of a jump table. */ @@ -1207,7 +1222,7 @@ struct cumulative_args { int ints, float `H' The operand is a numeric constant, a constant address, or a memory ref to a constant address. Print the correct notation to yield the high part of the given value or - address or the high part of the address of the refered + address or the high part of the address of the referred to memory object. `h' The operand is a numeric constant, a constant address, or @@ -1271,26 +1286,26 @@ extern unsigned long sfmode_constant_to_ else if ((CODE) == 'm') \ output_address (XEXP (X, 0)); \ else if ((CODE) == 'L') \ - if (GET_CODE (X) == MEM) \ - PRINT_OPERAND_PART (FILE, XEXP (X, 0), OPERAND_LOW_PART); \ - else \ - PRINT_OPERAND_PART (FILE, X, OPERAND_LOW_PART); \ + { \ + if (GET_CODE (X) == MEM) \ + PRINT_OPERAND_PART (FILE, XEXP (X, 0), OPERAND_LOW_PART); \ + else \ + PRINT_OPERAND_PART (FILE, X, OPERAND_LOW_PART); \ + } \ else if ((CODE) == 'H') \ - if (GET_CODE (X) == MEM) \ - PRINT_OPERAND_PART (FILE, XEXP (X, 0), OPERAND_HIGH_PART); \ - else \ - PRINT_OPERAND_PART (FILE, X, OPERAND_HIGH_PART); \ + { \ + if (GET_CODE (X) == MEM) \ + PRINT_OPERAND_PART (FILE, XEXP (X, 0), OPERAND_HIGH_PART); \ + else \ + PRINT_OPERAND_PART (FILE, X, OPERAND_HIGH_PART); \ + } \ else if ((CODE) == 'h') \ - if (GET_CODE (X) == MEM) \ - PRINT_OPERAND_PART (FILE, XEXP (X, 0), \ - const_int_operand (XEXP (X, 0)) \ - ? OPERAND_HIGH_PART \ - : OPERAND_HIGH_ADJ_PART); \ - else \ - PRINT_OPERAND_PART (FILE, X, \ - const_int_operand (X) \ - ? OPERAND_HIGH_PART \ - : OPERAND_HIGH_ADJ_PART); \ + { \ + if (GET_CODE (X) == MEM) \ + PRINT_OPERAND_PART (FILE, XEXP (X, 0), OPERAND_HIGH_ADJ_PART); \ + else \ + PRINT_OPERAND_PART (FILE, X, OPERAND_HIGH_ADJ_PART); \ + } \ else if (GET_CODE (X) == MEM) \ output_address (XEXP (X, 0)); \ else if ((CODE) == 'r' && (X) == const0_rtx) \ @@ -1347,7 +1362,7 @@ extern unsigned long sfmode_constant_to_ libgcc1.c routines in such a way that they know the actual types of their formal arguments and the actual types of their return values. Otherwise, gcc will generate calls to the libgcc1.c - routines, passing argumenst in in the floating-point registers, + routines, passing arguments in the floating-point registers, but the libgcc1.c routines will expect their arguments on the stack (where the i860 calling conventions require structs & unions to be passed). */ @@ -1361,7 +1376,7 @@ extern unsigned long sfmode_constant_to_ /* Optionally define this if you have added predicates to `MACHINE.c'. This macro is called within an initializer of an array of structures. The first field in the structure is the - name of a predicate and the second field is an arrary of rtl + name of a predicate and the second field is an array of rtl codes. For each predicate, list all rtl codes that can be in expressions matched by the predicate. The list should have a trailing comma. Here is an example of two entries in the list