[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lightning] Floating point branches
From: |
Mike Spivey |
Subject: |
[Lightning] Floating point branches |
Date: |
Tue, 17 Feb 2009 08:32:24 +0000 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20090105) |
I encountered three problems with floating point branches on i386 with
the GIT version of lightning. The patches shown below seem to work for
me, but I haven't made extensive tests.
-- Mike
(i) Instructions beqr_f, ... are not defined, but only beqr_d, ... On
i386, they are the same, but maybe not on other architectures.
Solution:
#ifndef jit_beqr_f
#define jit_beqr_f(lab, a, b) jit_beqr_d(lab, a, b)
#define jit_bner_f(lab, a, b) jit_bner_d(lab, a, b)
#define jit_bgtr_f(lab, a, b) jit_bgtr_d(lab, a, b)
#define jit_bger_f(lab, a, b) jit_bger_d(lab, a, b)
#define jit_bltr_f(lab, a, b) jit_bltr_d(lab, a, b)
#define jit_bler_f(lab, a, b) jit_bler_d(lab, a, b)
#endif
(ii) The floating point branches depend on the existence of operations
JCm and JNCm that don't exist. They should be synonyms for JBm and
JNBm. Solution:
#ifndef JCm
#define JCm JBm
#define JNCm JNBm
#endif
(iii) The macro jit_fp_btest wrongly ends with a call to
res ((d), 0, 0, 0). This should read res (d). Solution:
#undef jit_fp_btest
#define jit_fp_btest(d, s1, s2, n, _and, cmp, res) \
(((s1) == 0 ? FUCOMr((s2)) : (FLDr((s1)), FUCOMPr((s2) + 1))), \
PUSHLr(_EAX), \
FNSTSWr(_EAX), \
SHRLir(n, _EAX), \
((_and) ? ANDLir ((_and), _EAX) : 0), \
((cmp) ? CMPLir ((cmp), _AL) : 0), \
POPLr(_EAX), \
res (d), \
_jit.x.pc)
- [Lightning] Floating point branches,
Mike Spivey <=