# HG changeset patch # User Lukas Stadler # Date 1366637881 -7200 # Node ID c08d340ba2bf5b7f16ea6608e1d17a9a7224caf8 # Parent 9adb07d6f07f0947bd2cb6503cda285059d2c517 remove useless /@formatter:off diff -r 9adb07d6f07f -r c08d340ba2bf graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java Mon Apr 22 10:30:07 2013 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java Mon Apr 22 15:38:01 2013 +0200 @@ -25,7 +25,6 @@ /** * Enumeration of reasons for why a deoptimization is happening. */ -// @formatter:off public enum DeoptimizationReason { None, NullCheckException, diff -r 9adb07d6f07f -r c08d340ba2bf graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java Mon Apr 22 10:30:07 2013 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_idea.java Mon Apr 22 15:38:01 2013 +0200 @@ -29,7 +29,6 @@ import com.oracle.graal.jtt.*; import org.junit.*; -//@formatter:off public class HP_idea extends JTTTest { public boolean test() { @@ -60,7 +59,7 @@ /* * buildTestData - * + * * Builds the data used for the test -- each time the test is run. */ @@ -115,10 +114,11 @@ /* * calcEncryptKey - * - * Builds the 52 16-bit encryption subkeys Z[] from the user key and stores in 32-bit int array. The routing - * corrects an error in the source code in the Schnier book. Basically, the sense of the 7- and 9-bit shifts are - * reversed. It still works reversed, but would encrypted code would not decrypt with someone else's IDEA code. + * + * Builds the 52 16-bit encryption subkeys Z[] from the user key and stores in 32-bit int array. + * The routing corrects an error in the source code in the Schnier book. Basically, the sense of + * the 7- and 9-bit shifts are reversed. It still works reversed, but would encrypted code would + * not decrypt with someone else's IDEA code. */ private void calcEncryptKey() { @@ -168,9 +168,9 @@ /* * calcDecryptKey - * - * Builds the 52 16-bit encryption subkeys DK[] from the encryption- subkeys Z[]. DK[] is a 32-bit int array holding - * 16-bit values as unsigned. + * + * Builds the 52 16-bit encryption subkeys DK[] from the encryption- subkeys Z[]. DK[] is a + * 32-bit int array holding 16-bit values as unsigned. */ private void calcDecryptKey() { @@ -215,12 +215,14 @@ /* * cipher_idea - * - * IDEA encryption/decryption algorithm. It processes plaintext in 64-bit blocks, one at a time, breaking the block - * into four 16-bit unsigned subblocks. It goes through eight rounds of processing using 6 new subkeys each time, - * plus four for last step. The source text is in array text1, the destination text goes into array text2 The - * routine represents 16-bit subblocks and subkeys as type int so that they can be treated more easily as unsigned. - * Multiplication modulo 0x10001 interprets a zero sub-block as 0x10000; it must to fit in 16 bits. + * + * IDEA encryption/decryption algorithm. It processes plaintext in 64-bit blocks, one at a time, + * breaking the block into four 16-bit unsigned subblocks. It goes through eight rounds of + * processing using 6 new subkeys each time, plus four for last step. The source text is in + * array text1, the destination text goes into array text2 The routine represents 16-bit + * subblocks and subkeys as type int so that they can be treated more easily as unsigned. + * Multiplication modulo 0x10001 interprets a zero sub-block as 0x10000; it must to fit in 16 + * bits. */ @SuppressWarnings("static-method") @@ -356,35 +358,40 @@ /* * mul - * - * Performs multiplication, modulo (2**16)+1. This code is structured on the assumption that untaken branches are - * cheaper than taken branches, and that the compiler doesn't schedule branches. Java: Must work with 32-bit int and - * one 64-bit long to keep 16-bit values and their products "unsigned." The routine assumes that both a and b could - * fit in 16 bits even though they come in as 32-bit ints. Lots of "& 0xFFFF" masks here to keep things 16-bit. - * Also, because the routine stores mod (2**16)+1 results in a 2**16 space, the result is truncated to zero whenever - * the result would zero, be 2**16. And if one of the multiplicands is 0, the result is not zero, but (2**16) + 1 - * minus the other multiplicand (sort of an additive inverse mod 0x10001). - * - * NOTE: The java conversion of this routine works correctly, but is half the speed of using Java's modulus division - * function (%) on the multiplication with a 16-bit masking of the result--running in the Symantec Caje IDE. So it's - * not called for now; the test uses Java % instead. + * + * Performs multiplication, modulo (2**16)+1. This code is structured on the assumption that + * untaken branches are cheaper than taken branches, and that the compiler doesn't schedule + * branches. Java: Must work with 32-bit int and one 64-bit long to keep 16-bit values and their + * products "unsigned." The routine assumes that both a and b could fit in 16 bits even though + * they come in as 32-bit ints. Lots of "& 0xFFFF" masks here to keep things 16-bit. Also, + * because the routine stores mod (2**16)+1 results in a 2**16 space, the result is truncated to + * zero whenever the result would zero, be 2**16. And if one of the multiplicands is 0, the + * result is not zero, but (2**16) + 1 minus the other multiplicand (sort of an additive inverse + * mod 0x10001). + * + * NOTE: The java conversion of this routine works correctly, but is half the speed of using + * Java's modulus division function (%) on the multiplication with a 16-bit masking of the + * result--running in the Symantec Caje IDE. So it's not called for now; the test uses Java % + * instead. */ /* - * private int mul(int a, int b) throws ArithmeticException { long p; // Large enough to catch 16-bit multiply // - * without hitting sign bit. if (a != 0) { if (b != 0) { p = (long) a * b; b = (int) p & 0xFFFF; // Lower 16 bits. a - * = (int) p >>> 16; // Upper 16 bits. - * - * return (b - a + (b < a ? 1 : 0) & 0xFFFF); } else return ((1 - a) & 0xFFFF); // If b = 0, then same as // 0x10001 - * - a. } else // If a = 0, then return return((1 - b) & 0xFFFF); // same as 0x10001 - b. } + * private int mul(int a, int b) throws ArithmeticException { long p; // Large enough to catch + * 16-bit multiply // without hitting sign bit. if (a != 0) { if (b != 0) { p = (long) a * b; b + * = (int) p & 0xFFFF; // Lower 16 bits. a = (int) p >>> 16; // Upper 16 bits. + * + * return (b - a + (b < a ? 1 : 0) & 0xFFFF); } else return ((1 - a) & 0xFFFF); // If b = 0, + * then same as // 0x10001 - a. } else // If a = 0, then return return((1 - b) & 0xFFFF); // + * same as 0x10001 - b. } */ /* * inv - * - * Compute multiplicative inverse of x, modulo (2**16)+1 using extended Euclid's GCD (greatest common divisor) - * algorithm. It is unrolled twice to avoid swapping the meaning of the registers. And some subtracts are changed to - * adds. Java: Though it uses signed 32-bit ints, the interpretation of the bits within is strictly unsigned 16-bit. + * + * Compute multiplicative inverse of x, modulo (2**16)+1 using extended Euclid's GCD (greatest + * common divisor) algorithm. It is unrolled twice to avoid swapping the meaning of the + * registers. And some subtracts are changed to adds. Java: Though it uses signed 32-bit ints, + * the interpretation of the bits within is strictly unsigned 16-bit. */ @SuppressWarnings("static-method") @@ -432,7 +439,7 @@ /* * freeTestData - * + * * Nulls arrays and forces garbage collection to free up memory. */