< prev index next >

test/compiler/codegen/IntRotateWithImmediate.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke

*** 26,39 **** * @test * @bug 8080190 * @bug 8154537 * @key regression * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f ! * @run main/othervm -Xbatch -XX:-UseOnStackReplacement IntRotateWithImmediate * @author volker.simonis@gmail.com */ public class IntRotateWithImmediate { // This is currently the same as Integer.rotateRight() static int rotateRight1(int i, int distance) { // On some architectures (i.e. x86_64 and ppc64) the following computation is --- 26,42 ---- * @test * @bug 8080190 * @bug 8154537 * @key regression * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f ! * ! * @run main/othervm -Xbatch -XX:-UseOnStackReplacement compiler.codegen.IntRotateWithImmediate * @author volker.simonis@gmail.com */ + package compiler.codegen; + public class IntRotateWithImmediate { // This is currently the same as Integer.rotateRight() static int rotateRight1(int i, int distance) { // On some architectures (i.e. x86_64 and ppc64) the following computation is
*** 44,54 **** // 'rotlwi' instruction on Power only encodes a 5-bit immediate. return ((i >>> distance) | (i << -distance)); } static int rotateRight2(int i, int distance) { ! return ((i >>> distance) | (i << (32-distance))); } static int compute1(int x) { return rotateRight1(x, 3); } --- 47,57 ---- // 'rotlwi' instruction on Power only encodes a 5-bit immediate. return ((i >>> distance) | (i << -distance)); } static int rotateRight2(int i, int distance) { ! return ((i >>> distance) | (i << (32 - distance))); } static int compute1(int x) { return rotateRight1(x, 3); }
< prev index next >