use register for indexing if constant offset is too large (or too small)

Immediate indexes on ARM must be no more than 12 bits, so we must use
a temporary register for values which don't fit.
This commit is contained in:
Joel Dice
2010-11-09 11:36:38 -07:00
parent 70fcbc2788
commit 7978102cb6
2 changed files with 30 additions and 2 deletions

View File

@ -54,5 +54,11 @@ public class Arrays {
p = false;
expect(array[1] == array[p ? 0 : 1]);
}
{ int[] array = new int[1024];
array[1023] = -1;
expect(array[1023] == -1);
expect(array[1022] == 0);
}
}
}