public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Arbitrary precision representation for numeric constants?
@ 1999-10-17 13:19 Peter Gerwinski
  1999-10-18  9:05 ` Joern Rennecke
  1999-10-31 23:35 ` Peter Gerwinski
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Gerwinski @ 1999-10-17 13:19 UTC (permalink / raw)
  To: gcc

Hello,

in `fold-const.c' there is the following comment:

    /*@@ This file should be rewritten to use an arbitrary precision
      @@ representation for "struct tree_int_cst" and "struct tree_real_cst".
      @@ Perhaps the routines could also be used for bc/dc, and made a lib.
      @@ The routines that translate from the ap rep should
      @@ warn if precision et. al. is lost.  
      @@ This would also make life easier when this technology is used
      @@ for cross-compilers.  */

Is there anyone actually working on this (or planning to work on this)?

    Peter

-- 
http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118
GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422
keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net

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

* Re: Arbitrary precision representation for numeric constants?
  1999-10-17 13:19 Arbitrary precision representation for numeric constants? Peter Gerwinski
@ 1999-10-18  9:05 ` Joern Rennecke
  1999-10-31 23:35   ` Joern Rennecke
  2000-01-30 15:49   ` Peter Gerwinski
  1999-10-31 23:35 ` Peter Gerwinski
  1 sibling, 2 replies; 8+ messages in thread
From: Joern Rennecke @ 1999-10-18  9:05 UTC (permalink / raw)
  To: Peter Gerwinski; +Cc: gcc

> in `fold-const.c' there is the following comment:
> 
>     /*@@ This file should be rewritten to use an arbitrary precision
>       @@ representation for "struct tree_int_cst" and "struct tree_real_cst".
>       @@ Perhaps the routines could also be used for bc/dc, and made a lib.
>       @@ The routines that translate from the ap rep should
>       @@ warn if precision et. al. is lost.  
>       @@ This would also make life easier when this technology is used
>       @@ for cross-compilers.  */
> 
> Is there anyone actually working on this (or planning to work on this)?

At least for floating point values this comment is out of date -
the REAL_ARITHMENTIC stuff in gcc is actually better than arbitrary
precision, because it can do floating point operations the way the
target system does.

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

* Re: Arbitrary precision representation for numeric constants?
  1999-10-18  9:05 ` Joern Rennecke
@ 1999-10-31 23:35   ` Joern Rennecke
  2000-01-30 15:49   ` Peter Gerwinski
  1 sibling, 0 replies; 8+ messages in thread
From: Joern Rennecke @ 1999-10-31 23:35 UTC (permalink / raw)
  To: Peter Gerwinski; +Cc: gcc

> in `fold-const.c' there is the following comment:
> 
>     /*@@ This file should be rewritten to use an arbitrary precision
>       @@ representation for "struct tree_int_cst" and "struct tree_real_cst".
>       @@ Perhaps the routines could also be used for bc/dc, and made a lib.
>       @@ The routines that translate from the ap rep should
>       @@ warn if precision et. al. is lost.  
>       @@ This would also make life easier when this technology is used
>       @@ for cross-compilers.  */
> 
> Is there anyone actually working on this (or planning to work on this)?

At least for floating point values this comment is out of date -
the REAL_ARITHMENTIC stuff in gcc is actually better than arbitrary
precision, because it can do floating point operations the way the
target system does.

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

* Arbitrary precision representation for numeric constants?
  1999-10-17 13:19 Arbitrary precision representation for numeric constants? Peter Gerwinski
  1999-10-18  9:05 ` Joern Rennecke
@ 1999-10-31 23:35 ` Peter Gerwinski
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Gerwinski @ 1999-10-31 23:35 UTC (permalink / raw)
  To: gcc

Hello,

in `fold-const.c' there is the following comment:

    /*@@ This file should be rewritten to use an arbitrary precision
      @@ representation for "struct tree_int_cst" and "struct tree_real_cst".
      @@ Perhaps the routines could also be used for bc/dc, and made a lib.
      @@ The routines that translate from the ap rep should
      @@ warn if precision et. al. is lost.  
      @@ This would also make life easier when this technology is used
      @@ for cross-compilers.  */

Is there anyone actually working on this (or planning to work on this)?

    Peter

-- 
http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118
GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422
keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net

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

* Re: Arbitrary precision representation for numeric constants?
  1999-10-18  9:05 ` Joern Rennecke
  1999-10-31 23:35   ` Joern Rennecke
@ 2000-01-30 15:49   ` Peter Gerwinski
  2000-01-30 20:39     ` Richard Henderson
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Gerwinski @ 2000-01-30 15:49 UTC (permalink / raw)
  To: gcc

Hello,

in October 1999, Joern Rennecke answered to my question:
> 
> > in `fold-const.c' there is the following comment:
> > 
> >     /*@@ This file should be rewritten to use an arbitrary precision
> >       @@ representation for "struct tree_int_cst" and "struct tree_real_cst".
> >       @@ Perhaps the routines could also be used for bc/dc, and made a lib.
> >       @@ The routines that translate from the ap rep should
> >       @@ warn if precision et. al. is lost.  
> >       @@ This would also make life easier when this technology is used
> >       @@ for cross-compilers.  */
> > 
> > Is there anyone actually working on this (or planning to work on this)?
> 
> At least for floating point values this comment is out of date -
> the REAL_ARITHMENTIC stuff in gcc is actually better than arbitrary
> precision, because it can do floating point operations the way the
> target system does.

So what about the integer part?  Any news about this?

    Peter

-- 
http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118
GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422
keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net

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

* Re: Arbitrary precision representation for numeric constants?
  2000-01-30 15:49   ` Peter Gerwinski
@ 2000-01-30 20:39     ` Richard Henderson
  2000-01-31  6:39       ` Peter Gerwinski
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Henderson @ 2000-01-30 20:39 UTC (permalink / raw)
  To: Peter Gerwinski; +Cc: gcc

On Mon, Jan 31, 2000 at 12:48:28AM +0100, Peter Gerwinski wrote:
> So what about the integer part?  Any news about this?

We support integers up to twice the host word width.  We can
force the "host word" to "long long" for cross compiles.

This works out ok for every target we've seen so far.


r~

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

* Re: Arbitrary precision representation for numeric constants?
  2000-01-30 20:39     ` Richard Henderson
@ 2000-01-31  6:39       ` Peter Gerwinski
  2000-02-13  3:37         ` Peter Gerwinski
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Gerwinski @ 2000-01-31  6:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc

Richard Henderson wrote:
> 
> We support integers up to twice the host word width.  We can
> force the "host word" to "long long" for cross compiles.
> 
> This works out ok for every target we've seen so far.

My problem is the following:  When I multiply two `unsigned long long'
constants using fold() (called from build_binary_op()), the result does
not get the "overflow" bit set.

`fold()'ing this:

   <mult_expr 0x827fb94
      type <integer_type 0x8262e24 Longestcard allocated from permanent_obstack
          unsigned permanent DI
          size <integer_cst 0x825e570 constant permanent 64>
          align 32 symtab 0 alias set -1 precision 64
          min <integer_cst 0x8262e84 constant permanent 0>
          max <integer_cst 0x8262e9c constant permanent -1>>
      allocated from permanent_obstack
      permanent
      arg 0 <integer_cst 0x827fb50 type <integer_type 0x8262e24 Longestcard> constant unsigned permanent 0x8000000000000000>
      arg 1 <integer_cst 0x827fb7c type <integer_type 0x8262e24 Longestcard> constant unsigned permanent 2>>

results in this:

   <integer_cst 0x827fbac type <integer_type 0x8262e24 Longestcard> constant permanent 0>

In other situations, such an overflow is recognized in the
`overflow' bit of the result.  But with `unsigned long long' the
frontend gets no chance to notice the overflow and to output an
error message.

    Peter

-- 
http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118
GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422
keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net

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

* Re: Arbitrary precision representation for numeric constants?
  2000-01-31  6:39       ` Peter Gerwinski
@ 2000-02-13  3:37         ` Peter Gerwinski
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Gerwinski @ 2000-02-13  3:37 UTC (permalink / raw)
  To: gcc

Hello again,

I wrote:
> `fold()'ing this:
>    <mult_expr 0x827fb94 [...]
> results in this:
>    <integer_cst 0x827fbac type <integer_type 0x8262e24 Longestcard> constant permanent 0>

Okay, maybe the tree node dump was too complicated. ;-)

So once more:

When I use fold() to multiply two `unsigned long long'
constants, the result does not get the "overflow" bit set
(even if it overflows).

Anything that can be done about this?

    Peter

-- 
http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118
GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422
keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net

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

end of thread, other threads:[~2000-02-13  3:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-17 13:19 Arbitrary precision representation for numeric constants? Peter Gerwinski
1999-10-18  9:05 ` Joern Rennecke
1999-10-31 23:35   ` Joern Rennecke
2000-01-30 15:49   ` Peter Gerwinski
2000-01-30 20:39     ` Richard Henderson
2000-01-31  6:39       ` Peter Gerwinski
2000-02-13  3:37         ` Peter Gerwinski
1999-10-31 23:35 ` Peter Gerwinski

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).