--- gcc/config/m88k/m88k.c 2018/04/24 18:10:23 1.1 +++ gcc/config/m88k/m88k.c 2018/04/24 18:13:59 1.1.1.2 @@ -868,14 +868,20 @@ output_call (operands, addr) If we loose, we must use the non-delay form. This is unlikely to ever happen. If it becomes a problem, claim that a call has two delay slots and only the second can be filled with - a jump. */ + a jump. + + The 88110 can lose when a jsr.n r1 is issued and a page fault + occurs accessing the delay slot. So don't use jsr.n form when + jumping thru r1. + */ #ifdef AS_BUG_IMMEDIATE_LABEL /* The assembler restricts immediate values. */ if (optimize < 2 - || ! ADD_INTVAL (delta * 2)) + || ! ADD_INTVAL (delta * 2) #else if (optimize < 2 - || ! ADD_INTVAL (delta)) + || ! ADD_INTVAL (delta) #endif + || (REG_P (addr) && REGNO (addr) == 1)) { operands[1] = dest; return (REG_P (addr) @@ -1335,6 +1341,17 @@ real_or_0_operand (op, mode) && op == CONST0_RTX (mode))); } +/* Return true if OP is valid to use in the context of logic aritmethic + on condition codes. */ + +int +partial_ccmode_register_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + return register_operand (op, CCmode) || register_operand (op, CCEVENmode); +} + /* Return true if OP is a relational operator. */ int @@ -1360,6 +1377,42 @@ relop (op, mode) } } +int +even_relop (op, mode) + rtx op; + enum machine_mode mode; +{ + switch (GET_CODE (op)) + { + case EQ: + case LT: + case GT: + case LTU: + case GTU: + return 1; + default: + return 0; + } +} + +int +odd_relop (op, mode) + rtx op; + enum machine_mode mode; +{ + switch (GET_CODE (op)) + { + case NE: + case LE: + case GE: + case LEU: + case GEU: + return 1; + default: + return 0; + } +} + /* Return true if OP is a relational operator, and is not an unsigned relational operator. */ @@ -2555,7 +2608,7 @@ m88k_builtin_saveregs (arglist) change_address (addr, Pmode, plus_constant (XEXP (addr, 0), fixed * UNITS_PER_WORD)), - 8 - fixed); + 8 - fixed, (8 - fixed) * UNITS_PER_WORD); /* Return the address of the va_list constructor, but don't put it in a register. This fails when not optimizing and produces worse code when @@ -2687,6 +2740,13 @@ print_operand (file, x, code) The mechanism below is completed by having CC_STATUS_INIT set the code to the unknown value. */ + /* + hassey 6/30/93 + A problem with 88110 4.1 & 4.2 makes the use of fldcr for + this purpose undesirable. Instead we will use tb1, this will + cause serialization on the 88100 but such is life. + */ + static rtx last_addr = 0; if (code == 'V' /* Only need to serialize before a load. */ && m88k_volatile_code != 'V' /* Loads complete in FIFO order. */ @@ -2694,12 +2754,16 @@ print_operand (file, x, code) && GET_CODE (XEXP (x, 0)) == LO_SUM && rtx_equal_p (XEXP (XEXP (x, 0), 1), last_addr))) fprintf (file, +#if 0 #ifdef AS_BUG_FLDCR "fldcr\t %s,%scr63\n\t", #else "fldcr\t %s,%sfcr63\n\t", #endif reg_names[0], m88k_pound_sign); +#else /* 0 */ + "tb1\t 1,%s,0xff\n\t", reg_names[0]); +#endif /* 0 */ m88k_volatile_code = code; last_addr = (GET_CODE (XEXP (x, 0)) == LO_SUM ? XEXP (XEXP (x, 0), 1) : 0); @@ -2786,6 +2850,10 @@ print_operand (file, x, code) ? ".n\t" : "\t", file); return; + case '!': /* Reverse the following condition. */ + sequencep++; + reversep = 1; + return; case 'R': /* reverse the condition of the next print_operand if operand is a label_ref. */ sequencep++;