comparison src/cpu/x86/vm/assembler_x86.hpp @ 3363:167b70ff3abc

6939861: JVM should handle more conversion operations Reviewed-by: twisti, jrose
author never
date Fri, 06 May 2011 16:33:13 -0700
parents 2e038ad0c1d0
children 07c2e7ffd1fc
comparison
equal deleted inserted replaced
3362:d4c1fbc3de95 3363:167b70ff3abc
232 Address plus_disp(int disp) const { 232 Address plus_disp(int disp) const {
233 Address a = (*this); 233 Address a = (*this);
234 a._disp += disp; 234 a._disp += disp;
235 return a; 235 return a;
236 } 236 }
237 Address plus_disp(RegisterOrConstant disp, ScaleFactor scale = times_1) const {
238 Address a = (*this);
239 a._disp += disp.constant_or_zero() * scale_size(scale);
240 if (disp.is_register()) {
241 assert(!a.index()->is_valid(), "competing indexes");
242 a._index = disp.as_register();
243 a._scale = scale;
244 }
245 return a;
246 }
247 bool is_same_address(Address a) const {
248 // disregard _rspec
249 return _base == a._base && _disp == a._disp && _index == a._index && _scale == a._scale;
250 }
237 251
238 // The following two overloads are used in connection with the 252 // The following two overloads are used in connection with the
239 // ByteSize type (see sizes.hpp). They simplify the use of 253 // ByteSize type (see sizes.hpp). They simplify the use of
240 // ByteSize'd arguments in assembly code. Note that their equivalent 254 // ByteSize'd arguments in assembly code. Note that their equivalent
241 // for the optimized build are the member functions with int disp 255 // for the optimized build are the member functions with int disp
2027 void addptr(Address dst, Register src); 2041 void addptr(Address dst, Register src);
2028 2042
2029 void addptr(Register dst, Address src) { LP64_ONLY(addq(dst, src)) NOT_LP64(addl(dst, src)); } 2043 void addptr(Register dst, Address src) { LP64_ONLY(addq(dst, src)) NOT_LP64(addl(dst, src)); }
2030 void addptr(Register dst, int32_t src); 2044 void addptr(Register dst, int32_t src);
2031 void addptr(Register dst, Register src); 2045 void addptr(Register dst, Register src);
2046 void addptr(Register dst, RegisterOrConstant src) {
2047 if (src.is_constant()) addptr(dst, (int) src.as_constant());
2048 else addptr(dst, src.as_register());
2049 }
2032 2050
2033 void andptr(Register dst, int32_t src); 2051 void andptr(Register dst, int32_t src);
2034 void andptr(Register src1, Register src2) { LP64_ONLY(andq(src1, src2)) NOT_LP64(andl(src1, src2)) ; } 2052 void andptr(Register src1, Register src2) { LP64_ONLY(andq(src1, src2)) NOT_LP64(andl(src1, src2)) ; }
2035 2053
2036 void cmp8(AddressLiteral src1, int imm); 2054 void cmp8(AddressLiteral src1, int imm);
2088 void subptr(Address dst, int32_t src) { LP64_ONLY(subq(dst, src)) NOT_LP64(subl(dst, src)); } 2106 void subptr(Address dst, int32_t src) { LP64_ONLY(subq(dst, src)) NOT_LP64(subl(dst, src)); }
2089 2107
2090 void subptr(Register dst, Address src) { LP64_ONLY(subq(dst, src)) NOT_LP64(subl(dst, src)); } 2108 void subptr(Register dst, Address src) { LP64_ONLY(subq(dst, src)) NOT_LP64(subl(dst, src)); }
2091 void subptr(Register dst, int32_t src); 2109 void subptr(Register dst, int32_t src);
2092 void subptr(Register dst, Register src); 2110 void subptr(Register dst, Register src);
2093 2111 void subptr(Register dst, RegisterOrConstant src) {
2112 if (src.is_constant()) subptr(dst, (int) src.as_constant());
2113 else subptr(dst, src.as_register());
2114 }
2094 2115
2095 void sbbptr(Address dst, int32_t src) { LP64_ONLY(sbbq(dst, src)) NOT_LP64(sbbl(dst, src)); } 2116 void sbbptr(Address dst, int32_t src) { LP64_ONLY(sbbq(dst, src)) NOT_LP64(sbbl(dst, src)); }
2096 void sbbptr(Register dst, int32_t src) { LP64_ONLY(sbbq(dst, src)) NOT_LP64(sbbl(dst, src)); } 2117 void sbbptr(Register dst, int32_t src) { LP64_ONLY(sbbq(dst, src)) NOT_LP64(sbbl(dst, src)); }
2097 2118
2098 void xchgptr(Register src1, Register src2) { LP64_ONLY(xchgq(src1, src2)) NOT_LP64(xchgl(src1, src2)) ; } 2119 void xchgptr(Register src1, Register src2) { LP64_ONLY(xchgq(src1, src2)) NOT_LP64(xchgl(src1, src2)) ; }
2285 void movptr(Register dst, intptr_t src); 2306 void movptr(Register dst, intptr_t src);
2286 void movptr(Register dst, Register src); 2307 void movptr(Register dst, Register src);
2287 void movptr(Address dst, intptr_t src); 2308 void movptr(Address dst, intptr_t src);
2288 2309
2289 void movptr(Address dst, Register src); 2310 void movptr(Address dst, Register src);
2311
2312 void movptr(Register dst, RegisterOrConstant src) {
2313 if (src.is_constant()) movptr(dst, src.as_constant());
2314 else movptr(dst, src.as_register());
2315 }
2290 2316
2291 #ifdef _LP64 2317 #ifdef _LP64
2292 // Generally the next two are only used for moving NULL 2318 // Generally the next two are only used for moving NULL
2293 // Although there are situations in initializing the mark word where 2319 // Although there are situations in initializing the mark word where
2294 // they could be used. They are dangerous. 2320 // they could be used. They are dangerous.