Patchwork [RS6000] LE SFmode constants in toc

login
register
mail settings
Submitter Alan Modra
Date June 4, 2013, 1:05 p.m.
Message ID <20130604130527.GA6878@bubble.grove.modra.org>
Download mbox | patch
Permalink /patch/248582/
State New
Headers show

Comments

Alan Modra - June 4, 2013, 1:05 p.m.
ppc64 SFmode constants in the TOC occupy the first word of a dword.
For little-endian, we don't need to shift left.  Bootstrapped etc. and
committed as obvious revision 199646.

	* config/rs6000/rs6000.c (output_toc): Correct little-endian float
	constant output.
David Edelsohn - June 4, 2013, 1:56 p.m.
On Tue, Jun 4, 2013 at 9:05 AM, Alan Modra <amodra@gmail.com> wrote:
> ppc64 SFmode constants in the TOC occupy the first word of a dword.
> For little-endian, we don't need to shift left.  Bootstrapped etc. and
> committed as obvious revision 199646.
>
>         * config/rs6000/rs6000.c (output_toc): Correct little-endian float
>         constant output.

Okay.

Thanks, David

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 199644)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -22574,7 +22574,10 @@  output_toc (FILE *file, rtx x, int labelno, enum m
 	    fputs (DOUBLE_INT_ASM_OP, file);
 	  else
 	    fprintf (file, "\t.tc FS_%lx[TC],", l & 0xffffffff);
-	  fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
+	  if (WORDS_BIG_ENDIAN)
+	    fprintf (file, "0x%lx00000000\n", l & 0xffffffff);
+	  else
+	    fprintf (file, "0x%lx\n", l & 0xffffffff);
 	  return;
 	}
       else