comparison src/cpu/sparc/vm/assembler_sparc.hpp @ 4114:6729bbc1fcd6

7003454: order constants in constant table by number of references in code Reviewed-by: kvn, never, bdelsart
author twisti
date Wed, 16 Nov 2011 01:39:50 -0800
parents d968f546734e
children 0382d2b469b2
comparison
equal deleted inserted replaced
4113:8c57262447d3 4114:6729bbc1fcd6
853 Sync = 1 << 6, 853 Sync = 1 << 6,
854 MemIssue = 1 << 5, 854 MemIssue = 1 << 5,
855 Lookaside = 1 << 4 855 Lookaside = 1 << 4
856 }; 856 };
857 857
858 // test if x is within signed immediate range for nbits
859 static bool is_simm(intptr_t x, int nbits) { return -( intptr_t(1) << nbits-1 ) <= x && x < ( intptr_t(1) << nbits-1 ); }
860
861 // test if -4096 <= x <= 4095
862 static bool is_simm13(intptr_t x) { return is_simm(x, 13); }
863
864 static bool is_in_wdisp_range(address a, address b, int nbits) { 858 static bool is_in_wdisp_range(address a, address b, int nbits) {
865 intptr_t d = intptr_t(b) - intptr_t(a); 859 intptr_t d = intptr_t(b) - intptr_t(a);
866 return is_simm(d, nbits + 2); 860 return is_simm(d, nbits + 2);
867 } 861 }
868 862
1201 1195
1202 bool use_cbcond(Label& L) { 1196 bool use_cbcond(Label& L) {
1203 if (!UseCBCond || cbcond_before()) return false; 1197 if (!UseCBCond || cbcond_before()) return false;
1204 intptr_t x = intptr_t(target_distance(L)) - intptr_t(pc()); 1198 intptr_t x = intptr_t(target_distance(L)) - intptr_t(pc());
1205 assert( (x & 3) == 0, "not word aligned"); 1199 assert( (x & 3) == 0, "not word aligned");
1206 return is_simm(x, 12); 1200 return is_simm12(x);
1207 } 1201 }
1208 1202
1209 // Tells assembler you know that next instruction is delayed 1203 // Tells assembler you know that next instruction is delayed
1210 Assembler* delayed() { 1204 Assembler* delayed() {
1211 #ifdef CHECK_DELAY 1205 #ifdef CHECK_DELAY