public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] ARM fixed-point support [2/6]: assembler format for fixed-point constants
@ 2011-05-13 14:46 Julian Brown
  2011-06-30 13:40 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Julian Brown @ 2011-05-13 14:46 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]

This patch changes the format used to print fixed-point constants from
hex to decimal. For instance a negative "short fract" fixed-point
constant may be represented as a signed HOST_WIDE_INT from -1 to -128,
which would currently be printed as e.g. 0xfff....ffxx, resulting in a
"bignum truncated to fit" warning from the assembler. This trouble is
avoided if we just print using integers instead, similarly to the way
signed character-constants are emitted elsewhere in the compiler.

Tested along with the rest of the patch series. OK to apply?

Julian

ChangeLog

    * final.c (output_addr_const): Print fixed-point constants as
    decimal not hex (avoiding an assembler overflow warning for
    negative byte constants).

[-- Attachment #2: fixed-point-constant-format-2.diff --]
[-- Type: text/x-patch, Size: 602 bytes --]

commit 7c169485b6e5b153af02c83e8b858b8613ed7664
Author: Julian Brown <julian@henry8.codesourcery.com>
Date:   Fri May 13 05:44:19 2011 -0700

    Tweak fixed-point constant format.

diff --git a/gcc/final.c b/gcc/final.c
index 7e1ae90..b147ddf 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3633,8 +3633,7 @@ output_addr_const (FILE *file, rtx x)
       break;
 
     case CONST_FIXED:
-      fprintf (file, HOST_WIDE_INT_PRINT_HEX,
-	       (unsigned HOST_WIDE_INT) CONST_FIXED_VALUE_LOW (x));
+      fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_FIXED_VALUE_LOW (x));
       break;
 
     case PLUS:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM fixed-point support [2/6]: assembler format for fixed-point constants
  2011-05-13 14:46 [PATCH] ARM fixed-point support [2/6]: assembler format for fixed-point constants Julian Brown
@ 2011-06-30 13:40 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2011-06-30 13:40 UTC (permalink / raw)
  To: Julian Brown; +Cc: gcc-patches

On 13/05/11 14:57, Julian Brown wrote:
> This patch changes the format used to print fixed-point constants from
> hex to decimal. For instance a negative "short fract" fixed-point
> constant may be represented as a signed HOST_WIDE_INT from -1 to -128,
> which would currently be printed as e.g. 0xfff....ffxx, resulting in a
> "bignum truncated to fit" warning from the assembler. This trouble is
> avoided if we just print using integers instead, similarly to the way
> signed character-constants are emitted elsewhere in the compiler.
> 
> Tested along with the rest of the patch series. OK to apply?
> 
> Julian
> 
> ChangeLog
> 
>     * final.c (output_addr_const): Print fixed-point constants as
>     decimal not hex (avoiding an assembler overflow warning for
>     negative byte constants).
> 

OK (but remove the parenthetical part of the ChangeLog).

R.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-30 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 14:46 [PATCH] ARM fixed-point support [2/6]: assembler format for fixed-point constants Julian Brown
2011-06-30 13:40 ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).