[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 253/437: IA64: Correct some wrong checks value range che
From: |
Andy Wingo |
Subject: |
[Guile-commits] 253/437: IA64: Correct some wrong checks value range checks. |
Date: |
Mon, 2 Jul 2018 05:14:31 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit ae6101f66234068f67c86ef5bbfa8edf0379ae39
Author: pcpa <address@hidden>
Date: Wed Sep 25 00:30:42 2013 -0300
IA64: Correct some wrong checks value range checks.
* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
off by one range checks (that were only accepting values
one less than the maximum allowed) and an invalid test
condition check that was forcing it to always use
indirect jumps even when reachable with an immediate
displacement.
---
ChangeLog | 9 +++++++++
lib/jit_ia64-cpu.c | 24 ++++++++++++------------
lib/jit_ia64-fpu.c | 4 ++--
3 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1ea6cc1..034cb07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-10-25 Paulo Andrade <address@hidden>
+
+ * lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
+ off by one range checks (that were only accepting values
+ one less than the maximum allowed) and an invalid test
+ condition check that was forcing it to always use
+ indirect jumps even when reachable with an immediate
+ displacement.
+
2013-10-24 Paulo Andrade <address@hidden>
* lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
diff --git a/lib/jit_ia64-cpu.c b/lib/jit_ia64-cpu.c
index abc9699..ae197ea 100644
--- a/lib/jit_ia64-cpu.c
+++ b/lib/jit_ia64-cpu.c
@@ -2139,7 +2139,7 @@ _A3(jit_state_t *_jit, jit_word_t _p,
assert(!(x4 & ~0xfL));
assert(!(x2 & ~0x3L));
assert(!(r3 & ~0x7fL));
- assert(im >= -128 && im < 127);
+ assert(im >= -128 && im <= 127);
assert(!(r1 & ~0x7f));
TSTREG1(r3);
TSTPRED(_p);
@@ -2156,7 +2156,7 @@ _A4(jit_state_t *_jit, jit_word_t _p,
assert(!(_p & ~0x3fL));
assert(!(x2 & ~0x3L));
assert(!(r3 & ~0x7fL));
- assert(im >= -8192 && im < 8191);
+ assert(im >= -8192 && im <= 8191);
assert(!(r1 & ~0x7f));
TSTREG1(r3);
TSTPRED(_p);
@@ -2173,7 +2173,7 @@ _A5(jit_state_t *_jit, jit_word_t _p,
jit_word_t s, i5, i9, i7;
assert(!(_p & ~0x3fL));
assert(!(r3 & ~0x3L));
- assert(im >= -2097152 && im < 2097151);
+ assert(im >= -2097152 && im <= 2097151);
assert(!(r1 & ~0x7fL));
/* imm22 = sign_ext(s << 21 | imm5c << 16 | imm9d << 7 | imm7b, 22) */
s = (im & 0x200000) >> 21;
@@ -2810,7 +2810,7 @@ _M3(jit_state_t *_jit, jit_word_t _p,
assert(!(x6 & ~0x3fL));
assert(!(ht & ~0x3L));
assert(!(r3 & ~0x7fL));
- assert(im > -256 && im < 255);
+ assert(im > -256 && im <= 255);
assert(!(r1 & ~0x7fL));
TSTREG1(r3);
TSTPRED(_p);
@@ -2830,7 +2830,7 @@ _M5(jit_state_t *_jit, jit_word_t _p,
assert(!(ht & ~0x3L));
assert(!(r3 & ~0x7fL));
assert(!(r2 & ~0x7fL));
- assert(im > -256 && im < 255);
+ assert(im > -256 && im <= 255);
TSTREG2(r2, r3);
TSTPRED(_p);
inst((5L<<37)|(((im>>8)&1L)<<36)|(x6<<30)|(ht<<28)|
@@ -3261,7 +3261,7 @@ _B1(jit_state_t *_jit, jit_word_t _p,
assert(!(_p & ~0x3fL));
assert(!(d & ~0x1L));
assert(!(wh & ~0x3L));
- assert(im >= -1048576 && im < 1048575);
+ assert(im >= -1048576 && im <= 1048575);
assert(!(p & ~0x1L));
assert(!(tp & ~0x7L));
TSTPRED(_p);
@@ -3276,7 +3276,7 @@ _B3(jit_state_t *_jit, jit_word_t _p,
assert(!(_p & ~0x3fL));
assert(!(d & ~0x1L));
assert(!(wh & ~0x3L));
- assert(im >= -1048576 && im < 1048575);
+ assert(im >= -1048576 && im <= 1048575);
assert(!(p & ~0x1L));
assert(!(b & ~0x3L));
TSTPRED(_p);
@@ -3371,7 +3371,7 @@ _X1(jit_state_t *_jit, jit_word_t _p,
{
jit_word_t i41, i1, i20;
assert(!(_p & ~0x3fL));
- assert(im > -0x2000000000000000 && im < 0x1fffffffffffffff);
+ assert(im > -0x2000000000000000 && im <= 0x1fffffffffffffff);
i41 = (im >> 22) & 0x1ffffffffffL;
i1 = (im >> 21) & 0x1L;
i20 = im & 0xfffffL;
@@ -3429,7 +3429,7 @@ _X5(jit_state_t *_jit, jit_word_t _p,
{
jit_word_t i41, i1, i20;
assert(!(_p & ~0x3fL));
- assert(im > -0x2000000000000000 && im < 0x1fffffffffffffff);
+ assert(im > -0x2000000000000000 && im <= 0x1fffffffffffffff);
i41 = (im >> 22) & 0x1ffffffffffL;
i1 = (im >> 21) & 0x1L;
i20 = im & 0xfffffL;
@@ -3455,7 +3455,7 @@ _movi(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
if (r0 >= 120)
r0 = _jitc->rout + (r0 - 120);
- if (i0 >= -2097152 && i0 < 2097151)
+ if (i0 >= -2097152 && i0 <= 2097151)
MOVI(r0, i0);
else
MOVL(r0, i0);
@@ -3477,7 +3477,7 @@ _addi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1,
jit_word_t i0)
jit_int32_t reg;
if (i0 >= -8192 && i0 <= 8191)
ADDS(r0, i0, r1);
- else if (!(r1 & ~3) && i0 >= -2097152 && i0 < 2097151)
+ else if (!(r1 & ~3) && i0 >= -2097152 && i0 <= 2097151)
ADDL(r1, i0, r0);
else {
reg = jit_get_reg(jit_class_gpr);
@@ -5061,7 +5061,7 @@ _jmpi(jit_state_t *_jit, jit_word_t i0)
jit_word_t d;
sync();
d = ((jit_word_t)i0 - _jit->pc.w) >> 4;
- if (d < -16777216 && d > 16777215)
+ if (d >= -16777216 && d <= 16777215)
BRI(d);
else
BRL(d);
diff --git a/lib/jit_ia64-fpu.c b/lib/jit_ia64-fpu.c
index ee6c5ee..f902df1 100644
--- a/lib/jit_ia64-fpu.c
+++ b/lib/jit_ia64-fpu.c
@@ -740,7 +740,7 @@ _M8(jit_state_t *_jit, jit_word_t _p,
assert(!(x6 & ~0x3fL));
assert(!(ht & ~0x3L));
assert(!(r3 & ~0x7fL));
- assert(im > -256 && im < 255);
+ assert(im > -256 && im <= 255);
assert(!(f1 & ~0x7fL));
TSTREG1(r3);
TSTPRED(_p);
@@ -776,7 +776,7 @@ _M10(jit_state_t *_jit, jit_word_t _p,
assert(!(ht & ~0x3L));
assert(!(r3 & ~0x7fL));
assert(!(f2 & ~0x7fL));
- assert(im > -256 && im < 255);
+ assert(im > -256 && im <= 255);
TSTREG1(r3);
TSTFREG1(f2);
TSTPRED(_p);
- [Guile-commits] 234/437: GNU lightning 2.0.0 release, (continued)
- [Guile-commits] 234/437: GNU lightning 2.0.0 release, Andy Wingo, 2018/07/02
- [Guile-commits] 256/437: X86: %r12 may be used as an index register., Andy Wingo, 2018/07/02
- [Guile-commits] 229/437: Do not assume cast of nan or inf double to float always work., Andy Wingo, 2018/07/02
- [Guile-commits] 231/437: Cosmetic removal of white spaces in end of lines., Andy Wingo, 2018/07/02
- [Guile-commits] 232/437: Correct off by one bug on s390x subi., Andy Wingo, 2018/07/02
- [Guile-commits] 123/437: Revert change aliasing jit_movi_p to jit_movi_ul., Andy Wingo, 2018/07/02
- [Guile-commits] 248/437: Correct wrong example and mt unsafe code in the arm backend., Andy Wingo, 2018/07/02
- [Guile-commits] 236/437: Correct build and make check on gcc111 - AIX 7.1., Andy Wingo, 2018/07/02
- [Guile-commits] 237/437: Correct build and check on NetBSD amd64., Andy Wingo, 2018/07/02
- [Guile-commits] 213/437: Finish Itanium port, correcting remaining failing test cases., Andy Wingo, 2018/07/02
- [Guile-commits] 253/437: IA64: Correct some wrong checks value range checks.,
Andy Wingo <=
- [Guile-commits] 254/437: ARM: Correct build when disassembler is disabled., Andy Wingo, 2018/07/02
- [Guile-commits] 251/437: Add code to calculate code buffer size based on devel time information., Andy Wingo, 2018/07/02
- [Guile-commits] 144/437: Add new ldst variant test cases to check base/index register clobber., Andy Wingo, 2018/07/02
- [Guile-commits] 212/437: Correct remaining test cases, but not yet ones with stack arguments., Andy Wingo, 2018/07/02
- [Guile-commits] 179/437: Add heuristic code to estimate space and resize if required jit buffer., Andy Wingo, 2018/07/02
- [Guile-commits] 265/437: PPC: Correct wrong ldxi_l simplification in 64 bit mode, Andy Wingo, 2018/07/02
- [Guile-commits] 155/437: Add support to test different/alternate code generation setups., Andy Wingo, 2018/07/02
- [Guile-commits] 241/437: Add fallback logic instead of error if cannot figure __WORDSIZE., Andy Wingo, 2018/07/02
- [Guile-commits] 220/437: Update ia64 port to work on HP-UX., Andy Wingo, 2018/07/02
- [Guile-commits] 247/437: Add the jit_callee_save_p interface and extra register definitions., Andy Wingo, 2018/07/02