comparison src/share/vm/opto/divnode.cpp @ 568:30663ca5e8f4

6805724: ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant. Summary: C2, ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant. Reviewed-by: rasbold
author twisti
date Mon, 16 Feb 2009 07:19:26 -0800
parents bbef4344adb2
children 98cb887364d3
comparison
equal deleted inserted replaced
567:bbef4344adb2 568:30663ca5e8f4
1005 1005
1006 Node *hook = new (phase->C, 1) Node(1); 1006 Node *hook = new (phase->C, 1) Node(1);
1007 1007
1008 // Expand mod 1008 // Expand mod
1009 if( con >= 0 && con < max_jlong && is_power_of_2_long(con+1) ) { 1009 if( con >= 0 && con < max_jlong && is_power_of_2_long(con+1) ) {
1010 uint k = log2_long(con); // Extract k 1010 uint k = exact_log2_long(con+1); // Extract k
1011 1011
1012 // Basic algorithm by David Detlefs. See fastmod_long.java for gory details. 1012 // Basic algorithm by David Detlefs. See fastmod_long.java for gory details.
1013 // Used to help a popular random number generator which does a long-mod 1013 // Used to help a popular random number generator which does a long-mod
1014 // of 2^31-1 and shows up in SpecJBB and SciMark. 1014 // of 2^31-1 and shows up in SpecJBB and SciMark.
1015 static int unroll_factor[] = { 999, 999, 61, 30, 20, 15, 12, 10, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 /*past here we assume 1 forever*/}; 1015 static int unroll_factor[] = { 999, 999, 61, 30, 20, 15, 12, 10, 8, 7, 6, 6, 5, 5, 4, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 /*past here we assume 1 forever*/};