This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Correct m68k float flag logic
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Ben Elliston <bje at au1 dot ibm dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 19 May 2006 11:17:39 +0100
- Subject: Correct m68k float flag logic
I've installed this patch (as obvious), for a problem with the m68k's float
format logic. The -mfloat flag is used for both m68k and cf floats, which to
target is determined by the target cpu. That check should be done _before_
testing whether we've been given flags for both m68k & cf architectures.
We've been using this on the binutils-csl-2_17-branch for some time (and we're
just going through making sure things get back to mainline).
Ben, do you want this on the binutils-2_17-branch too?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2006-05-19 Nathan Sidwell <nathan@codesourcery.com>
* gas/config/tc-m68k.c (m68k_init_arch): Move checking of
cfloat/m68881 to correct architecture before using it.
Index: config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.75
diff -c -3 -p -r1.75 tc-m68k.c
*** config/tc-m68k.c 28 Mar 2006 07:21:49 -0000 1.75
--- config/tc-m68k.c 19 May 2006 10:12:58 -0000
*************** m68k_init_arch (void)
*** 7233,7238 ****
--- 7233,7247 ----
current_architecture &= ~not_current_architecture;
+ if ((current_architecture & (cfloat | m68881)) == (cfloat | m68881))
+ {
+ /* Determine which float is really meant. */
+ if (current_architecture & (m68k_mask & ~m68881))
+ current_architecture ^= cfloat;
+ else
+ current_architecture ^= m68881;
+ }
+
if (selected_cpu)
{
control_regs = selected_cpu->control_regs;
*************** m68k_init_arch (void)
*** 7244,7258 ****
}
}
- if ((current_architecture & (cfloat | m68881)) == (cfloat | m68881))
- {
- /* Determine which float is really meant. */
- if (current_architecture & (m68k_mask & ~m68881))
- current_architecture ^= cfloat;
- else
- current_architecture ^= m68881;
- }
-
if ((current_architecture & m68k_mask)
&& (current_architecture & ~m68k_mask))
{
--- 7253,7258 ----