Commit b409761a by Zack Weinberg

varasm.c (assemble_real): Use real_to_target directly...

	* varasm.c (assemble_real): Use real_to_target directly,
	calculate the number of significant elements of the result
	array and write them out in a loop, instead of using a giant
	switch statement to pick the correct REAL_VALUE_TO_TARGET_*
	macro.

From-SVN: r71917
parent f820b0cf
2003-09-29 Zack Weinberg <zack@codesourcery.com>
* varasm.c (assemble_real): Use real_to_target directly,
calculate the number of significant elements of the result
array and write them out in a loop, instead of using a giant
switch statement to pick the correct REAL_VALUE_TO_TARGET_*
macro.
Mon Sep 29 22:59:05 CEST 2003 Jan Hubicka <jh@suse.cz> Mon Sep 29 22:59:05 CEST 2003 Jan Hubicka <jh@suse.cz>
PR c++/12175 PR c++/12175
...@@ -397,7 +405,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -397,7 +405,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
PR pch/12112 PR pch/12112
* gcc/cppfiles.c (pch_open_file): Return based on combined * gcc/cppfiles.c (pch_open_file): Return based on combined
result of all files. result of all files.
(validate_pch): Return validate flag for current file. (validate_pch): Return validate flag for current file.
2003-09-24 Roger Sayle <roger@eyesopen.com> 2003-09-24 Roger Sayle <roger@eyesopen.com>
...@@ -1007,7 +1015,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -1007,7 +1015,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
* cgraph.c: Fix typo in debugging output. * cgraph.c: Fix typo in debugging output.
2003-09-19 T. Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> 2003-09-19 T. Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
Eric Botcazou <ebotcazou@libertysurf.fr> Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/12166 PR target/12166
* config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1. * config/sparc/sol2-c1.asm (start): Set __Argv if GCRT1.
...@@ -1265,10 +1273,10 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -1265,10 +1273,10 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2003-09-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* doc/invoke.texi (Warning Options): Add missing hyphen before * doc/invoke.texi (Warning Options): Add missing hyphen before
"Wimport". Change "-Wno-endif-labels" to "-Wendif-labels". "Wimport". Change "-Wno-endif-labels" to "-Wendif-labels".
Move "-Wold-style-definition" to the C-only section. Move "-Wold-style-definition" to the C-only section.
Fix the ordering of the warning options. Fix the ordering of the warning options.
2003-09-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> 2003-09-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Jeff Law <law@redhat.com> Jeff Law <law@redhat.com>
...@@ -1301,7 +1309,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -1301,7 +1309,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
of choose_ready for non-dfa insn scheduling. of choose_ready for non-dfa insn scheduling.
2003-09-15 Andreas Jaeger <aj@suse.de> 2003-09-15 Andreas Jaeger <aj@suse.de>
Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* doc/invoke.texi (Warning Options): Describe -Wold-style-definition. * doc/invoke.texi (Warning Options): Describe -Wold-style-definition.
* c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition. * c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition.
...@@ -1630,7 +1638,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -1630,7 +1638,7 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
* Makefile.in: Revert yesterday's change. * Makefile.in: Revert yesterday's change.
2003-09-08 Bernardo Innocenti <bernie@develer.com> 2003-09-08 Bernardo Innocenti <bernie@develer.com>
Peter Barada <peter@baradas.org> Peter Barada <peter@baradas.org>
* config/m68k/coff.h (REGISTER_NAMES): Add fake register `argptr' * config/m68k/coff.h (REGISTER_NAMES): Add fake register `argptr'
* config/m68k/hp320.h (REGISTER_NAMES): Likewise. * config/m68k/hp320.h (REGISTER_NAMES): Likewise.
...@@ -1990,10 +1998,10 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz> ...@@ -1990,10 +1998,10 @@ Mon Sep 29 19:05:46 CEST 2003 Jan Hubicka <jh@suse.cz>
2003-09-04 Nick Clifton <nickc@redhat.com> 2003-09-04 Nick Clifton <nickc@redhat.com>
* config.gcc (v850e-*-*): Use t-v850e makefile fragment. * config.gcc (v850e-*-*): Use t-v850e makefile fragment.
* config/v850/t-v850: Only produce one extra multilib - for * config/v850/t-v850: Only produce one extra multilib - for
the v850e. the v850e.
* config/v850/t-v850e: New file: Only produce one extra * config/v850/t-v850e: New file: Only produce one extra
multilib - for the v850. multilib - for the v850.
2003-09-04 Jakub Jelinek <jakub@redhat.com> 2003-09-04 Jakub Jelinek <jakub@redhat.com>
......
...@@ -1890,77 +1890,34 @@ void ...@@ -1890,77 +1890,34 @@ void
assemble_real (REAL_VALUE_TYPE d, enum machine_mode mode, unsigned int align) assemble_real (REAL_VALUE_TYPE d, enum machine_mode mode, unsigned int align)
{ {
long data[4]; long data[4];
long l; int i;
unsigned int nalign = min_align (align, 32); int bitsize, nelts, nunits, units_per;
switch (BITS_PER_UNIT) /* This is hairy. We have a quantity of known bitsize. real_to_target
will put it into an array of *host* longs, 32 bits per element
(even if long is more than 32 bits). We need to determine the
number of array elements that are occupied (nelts) and the number
of *target* min-addressable units that will be occupied in the
object file (nunits). We can assume that BITS_PER_UNIT divides
the mode's bitsize evenly, but we can not assume that 32 does. */
bitsize = GET_MODE_BITSIZE (mode);
nunits = bitsize / BITS_PER_UNIT;
nelts = CEIL (bitsize, 32);
units_per = 32 / BITS_PER_UNIT;
real_to_target (data, &d, mode);
/* Put out the first word with the specified alignment. */
assemble_integer (GEN_INT (data[0]), MIN (nunits, units_per), align, 1);
nunits -= units_per;
/* Subsequent words need only 32-bit alignment. */
align = min_align (align, 32);
for (i = 1; i < nelts; i++)
{ {
case 8: assemble_integer (GEN_INT (data[i]), MIN (nunits, units_per), align, 1);
switch (mode) nunits -= units_per;
{
case SFmode:
REAL_VALUE_TO_TARGET_SINGLE (d, l);
assemble_integer (GEN_INT (l), 4, align, 1);
break;
case DFmode:
REAL_VALUE_TO_TARGET_DOUBLE (d, data);
assemble_integer (GEN_INT (data[0]), 4, align, 1);
assemble_integer (GEN_INT (data[1]), 4, nalign, 1);
break;
case XFmode:
REAL_VALUE_TO_TARGET_LONG_DOUBLE (d, data);
assemble_integer (GEN_INT (data[0]), 4, align, 1);
assemble_integer (GEN_INT (data[1]), 4, nalign, 1);
assemble_integer (GEN_INT (data[2]), 4, nalign, 1);
break;
case TFmode:
REAL_VALUE_TO_TARGET_LONG_DOUBLE (d, data);
assemble_integer (GEN_INT (data[0]), 4, align, 1);
assemble_integer (GEN_INT (data[1]), 4, nalign, 1);
assemble_integer (GEN_INT (data[2]), 4, nalign, 1);
assemble_integer (GEN_INT (data[3]), 4, nalign, 1);
break;
default:
abort ();
}
break;
case 16:
switch (mode)
{
case HFmode:
REAL_VALUE_TO_TARGET_SINGLE (d, l);
assemble_integer (GEN_INT (l), 2, align, 1);
break;
case TQFmode:
REAL_VALUE_TO_TARGET_DOUBLE (d, data);
assemble_integer (GEN_INT (data[0]), 2, align, 1);
assemble_integer (GEN_INT (data[1]), 1, nalign, 1);
break;
default:
abort ();
}
break;
case 32:
switch (mode)
{
case QFmode:
REAL_VALUE_TO_TARGET_SINGLE (d, l);
assemble_integer (GEN_INT (l), 1, align, 1);
break;
case HFmode:
REAL_VALUE_TO_TARGET_DOUBLE (d, data);
assemble_integer (GEN_INT (data[0]), 1, align, 1);
assemble_integer (GEN_INT (data[1]), 1, nalign, 1);
break;
default:
abort ();
}
break;
default:
abort ();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment