gas, sparc: Allow non-fpop2 instructions before floating point branches
authorDaniel Cederman <cederman@gaisler.com>
Tue, 4 Sep 2018 13:25:52 +0000 (06:25 -0700)
committerjemarch <jemarch@wcoekaer-srv5.us.oracle.com>
Tue, 4 Sep 2018 13:25:52 +0000 (06:25 -0700)
commit618a8fdba6fc86a6ed88df257bf5f44d85e9071b
treeb0c71fc60347b458e89589b116f943091957abab
parent6c9d681b07e32d07f7ca0774360be62bbf065b82
gas, sparc: Allow non-fpop2 instructions before floating point branches

Sparc V8 does not allow fpop2 instructions (floating point
comparisons) immediately before floating point branches.  From the
SPARC Architecture Manual Version 8, section B.22 "Branch on
Floating-point Condition Codes Instructions":

"If the instruction executed immediately before an FBfcc is an FPop2
instruction, the result of the FBfcc is undefined.  Therefore, at
least one non FPop2 instruction should be executed between the FPop2
instruction and the FBfcc instruction."

The existing check in GAS, however, does not allow any kind of
floating point instruction before the branch.  This patch adds an
extra condition to only disallow fpop2 instructions.

gas/ChangeLog:

2018-09-04  Daniel Cederman  <cederman@gaisler.com>

* config/tc-sparc.c (md_assemble): Allow non-fpop2 instructions
            before floating point branches for Sparc V8 and earlier.
* testsuite/gas/sparc/sparc.exp: Execute the new test.
* testsuite/gas/sparc/v8branch.d: New test.
* testsuite/gas/sparc/v8branch.s: New test.
gas/ChangeLog
gas/config/tc-sparc.c
gas/testsuite/gas/sparc/sparc.exp
gas/testsuite/gas/sparc/v8branch.d [new file with mode: 0644]
gas/testsuite/gas/sparc/v8branch.s [new file with mode: 0644]