From: Martin Aberg Date: Wed, 29 Nov 2017 15:41:45 +0000 (+0000) Subject: [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f9bc5a70fb1066611e42efea9547fa36f398065;p=gcc.git [SPARC] Prevent -mfix-ut699 from generating b2bst errata sequences The sequence st fdivd / fsqrtd std was generated in some cases with -mfix-ut699 when there was a st before the div/sqrt. This sequence could trigger the b2bst errata. Now the following safe sequence is generated instead: st nop fdivd / fsqrtd std 2017-11-29 Martin Aberg gcc/ * config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length to prevent b2bst errata sequence. (sqrtdf2_fix): Likewise. From-SVN: r255238 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c12d02b4e4..a00174a3db8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-11-29 Martin Aberg + + * config/sparc/sparc.md (divdf3_fix): Add NOP and adjust length + to prevent b2bst errata sequence. + (sqrtdf2_fix): Likewise. + 2017-11-29 Daniel Cederman * config/sparc/sparc.c (fpop_reg_depend_p): New function. diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index d1af68034dd..4753c9bde3c 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -6212,10 +6212,10 @@ visl") (div:DF (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU && sparc_fix_ut699" - "fdivd\t%1, %2, %0\n\tstd\t%0, [%%sp-8]\n\tnop" + "fdivd\t%1, %2, %0\n\tnop\n\tstd\t%0, [%%sp-8]\n\tnop" [(set_attr "type" "fpdivd") (set_attr "fptype" "double") - (set_attr "length" "3")]) + (set_attr "length" "4")]) (define_insn "divsf3" [(set (match_operand:SF 0 "register_operand" "=f") @@ -6464,10 +6464,10 @@ visl") [(set (match_operand:DF 0 "register_operand" "=e") (sqrt:DF (match_operand:DF 1 "register_operand" "e")))] "TARGET_FPU && sparc_fix_ut699" - "fsqrtd\t%1, %0\n\tstd\t%0, [%%sp-8]\n\tnop" + "fsqrtd\t%1, %0\n\tnop\n\tstd\t%0, [%%sp-8]\n\tnop" [(set_attr "type" "fpsqrtd") (set_attr "fptype" "double") - (set_attr "length" "3")]) + (set_attr "length" "4")]) (define_insn "sqrtsf2" [(set (match_operand:SF 0 "register_operand" "=f")