This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
FP bugs and conditional move
- To: egcs at cygnus dot com
- Subject: FP bugs and conditional move
- From: hjl at lucon dot org (H.J. Lu)
- Date: Fri, 13 Mar 1998 14:30:12 -0800 (PST)
Hi,
Enabling fp constant conditional move in egcs exposes many egcs bugs in
fp constant handling. One bug is fold_rtx () tries to change
(insn 39 38 29 (set (reg:DF 23)
(if_then_else:DF (ge (cc0)
(const_int 0))
(mem/u:DF (symbol_ref/u:SI ("*.LC1")))
(mem/u:DF (symbol_ref/u:SI ("*.LC0"))))) -1 (nil)
(nil))
into
(insn 39 38 29 (set (reg:DF 23)
(if_then_else:DF (ge (cc0)
(const_int 0))
(const_double:DF (cc0) 0 0 1073709056)
(const_double:DF (const_int 0) 0 0 -1073774592))) 380 {movdfcc_1} (nil)
(nil))
The first one is ok on x87, but not the second one. x87 only allows
a limited number of fp constants which can be loaded into fp
regsiter directly. I believe that may be also true on many other
CPUs. A new macro, IMMEDIATE_CONST_DOUBLE_OK, can be used to
indicate if we can use it as an immediate double constant. On
x87, it is defined as
#define IMMEDIATE_CONST_DOUBLE_OK(V) standard_80387_constant_p(v)
Then we use it in fold_rtx ().
Thanks.
--
H.J. Lu (hjl@gnu.org)