This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PPro conditional move problem
- To: john at feith dot com
- Subject: PPro conditional move problem
- From: hjl at lucon dot org (H.J. Lu)
- Date: Fri, 5 Jun 1998 09:20:38 -0700 (PDT)
- Cc: law at cygnus dot com, egcs-patches at cygnus dot com
Hi,
I took a look at the PPro FP conditional move. Whoever designed it
assumed we only use it in
double x, y;
if (y > 0.0)
x = 1.0;
It won't work with
double x;
int y;
if (y > 0)
x = 1.0;
since no FP conditional move insn checks sign or overflow bit in CC.
It is kind of braindead. Anyway, I think we can change all non-FP CC
setting insns to
[(parallel [(set (cc0)
..............
(clobber (match_scratch:HI 1 ""))])]
[(set (cc0)
......
(clobber (match_scratch:HI 3 "=a"))]
When we output the CC setting insn, we check if the next cc user is the
FP conditional move. If yes and code is LT/GE/GT/LE, we emit a pproper
setxx %ax
before the FP conditional move and emit an corresponding
fmovxx xx,xx
for the FP conditional move. output_fp_conditional_move () will tell
final_scan_insn to restore the test insn for LT/GE/GT/LE.
Is this reasonable? If yes, I will try to implement it this weekend.
Thanks.
--
H.J. Lu (hjl@gnu.org)