> 2017-11-17  Daniel Cederman  <ceder...@gaisler.com>
> 
>       * config/sparc/sparc.c (fpop_insn_p): New function.
>       (sparc_do_work_around_errata): Insert NOP instructions to
>       prevent sequences that could trigger the TN-0012 errata for
>       GR712RC.
>       (pass_work_around_errata::gate): Also test sparc_fix_gr712rc.
>       * config/sparc/sparc.md (fix_gr712rc): New attribute.
>       (in_branch_annul_delay): Prevent floating-point instructions
>       in delay slot of annulled integer branch.

Sorry, I should have been more explicit in my first reply, because:

> @@ -590,6 +594,26 @@
>          (const_string "true")
>       ] (const_string "false")))
> 
> +(define_attr "in_integer_branch_annul_delay" "false,true"
> +  (cond [(eq_attr "type"
> "uncond_branch,branch,cbcond,uncond_cbcond,call,sibcall,call_no_delay_slot,
> multi") +        (const_string "false")
> +      (and (eq_attr "fix_gr712rc" "true")
> +           (eq_attr "type" "fp,fpcmp,fpmove,fpcmove,fpmul,
> +                            fpdivs,fpsqrts,fpdivd,fpsqrtd"))
> +        (const_string "false")
> +      (and (eq_attr "fix_b2bst" "true") (eq_attr "type" "store,fpstore"))
> +        (const_string "false")
> +      (and (eq_attr "fix_ut699" "true") (eq_attr "type" "load,sload"))
> +        (const_string "false")
> +      (and (eq_attr "fix_ut699" "true")
> +           (and (eq_attr "type" "fpload,fp,fpmove,fpmul,fpdivs,fpsqrts")
> +                (ior (eq_attr "fptype" "single")
> +                     (eq_attr "fptype_ut699" "single"))))
> +        (const_string "false")
> +      (eq_attr "length" "1")
> +        (const_string "true")
> +     ] (const_string "false")))
> +
>  (define_delay (eq_attr "type" "call")
>    [(eq_attr "in_call_delay" "true") (nil) (nil)])

is barely maintainable.  So let's go back to the original version and...

> @@ -602,6 +626,10 @@
>  (define_delay (eq_attr "type" "branch")
>    [(eq_attr "in_branch_delay" "true") (nil) (eq_attr "in_branch_delay"
> "true")])
> 
> +(define_delay (and (eq_attr "type" "branch") (eq_attr "branch_type" "icc"))
> +  [(eq_attr "in_branch_delay" "true") (nil)
> +  (eq_attr "in_integer_branch_annul_delay" "true")])
> +
>  (define_delay (eq_attr "type" "uncond_branch")
>    [(eq_attr "in_branch_delay" "true") (nil) (nil)])

...add (and (.) (not (eq_attr "branch_type" "icc")) to the first define_delay.

-- 
Eric Botcazou

Reply via email to