Fixed a corner case of range optimization in JIT.

This commit is contained in:
zherczeg 2015-08-26 13:35:58 +00:00
parent 20680900f0
commit 7c2c7e84b7
3 changed files with 5 additions and 0 deletions

View File

@ -160,6 +160,8 @@ III).
44. Fix bug in RunTest.bat for new test 14, and adjust the script for the added
test (there are now 20 in total).
45. Fixed a corner case of range optimization in JIT.
Version 10.20 30-June-2015
--------------------------

View File

@ -4997,8 +4997,10 @@ switch(length)
case 4:
if ((ranges[1] - ranges[0]) == (ranges[3] - ranges[2])
&& (ranges[0] | (ranges[2] - ranges[0])) == ranges[2]
&& (ranges[1] & (ranges[2] - ranges[0])) == 0
&& is_powerof2(ranges[2] - ranges[0]))
{
SLJIT_ASSERT((ranges[0] & (ranges[2] - ranges[0])) == 0 && (ranges[2] & ranges[3] & (ranges[2] - ranges[0])) != 0);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, ranges[2] - ranges[0]);
if (ranges[2] + 1 != ranges[3])
{

View File

@ -188,6 +188,7 @@ static struct regression_test_case regression_test_cases[] = {
{ CMUP, A, 0, 0, "\xf0\x90\x90\x80{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
{ CMUP, A, 0, 0, "\xf0\x90\x90\xa8{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
{ CMUP, A, 0, 0, "\xe1\xbd\xb8\xe1\xbf\xb8", "\xe1\xbf\xb8\xe1\xbd\xb8" },
{ M, A, 0, 0, "[3-57-9]", "5" },
/* Assertions. */
{ MU, A, 0, 0, "\\b[^A]", "A_B#" },