head: MIPS: A workaround for the R4000 divide/shift errata

Maciej W. Rozycki macro@ds2.pg.gda.pl
Thu Feb 19 21:49:00 GMT 2004


On Thu, 19 Feb 2004, Richard Sandiford wrote:

> This is OK, modulo use of TARGET_FIX_R4000, or whatever.

 OK -- I'll add an explicit macro to trigger both workarounds.  I'm only a 
bit hesitant to invent an externally visible option at this stage -- once 
agreed upon a name I wouldn't want to change it.

> I'd prefer:
> 
> 	  (eq_attr "type" "idiv")
> 	  (cond [(ne (symbol_ref "TARGET_CHECK_ZERO_DIV") (const_int 0))
>                  (if_then_else (ne (symbol_ref "TARGET_MIPS16") (const_int 0))
>                                (const_int 12)
>                                (const_int 16))
>                  (ne (symbol_ref "TARGET_FIX_R4000") (const_int 0))
>                  (const_int 8)]
>                 (const_int 4))
> 
> ...which follows the same structure as mips_output_division.

 Of course -- it looks much saner.  I think I just lack some experience to
make a fluent use of these expressions.

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +



More information about the Gcc-patches mailing list