comparison src/cpu/sparc/vm/assembler_sparc.hpp @ 622:56aae7be60d4

6812678: macro assembler needs delayed binding of a few constants (for 6655638) Summary: minor assembler enhancements preparing for method handles Reviewed-by: kvn
author jrose
date Wed, 04 Mar 2009 09:58:39 -0800
parents a1980da045cc
children 9adddb8c0fc8
comparison
equal deleted inserted replaced
621:19f25e603e7b 622:56aae7be60d4
382 return offset == 0 ? _rspec : _rspec.plus(offset); 382 return offset == 0 ? _rspec : _rspec.plus(offset);
383 } 383 }
384 384
385 inline bool is_simm13(int offset = 0); // check disp+offset for overflow 385 inline bool is_simm13(int offset = 0); // check disp+offset for overflow
386 386
387 Address plus_disp(int disp) const { // bump disp by a small amount
388 Address a = (*this);
389 a._disp += disp;
390 return a;
391 }
392
387 Address split_disp() const { // deal with disp overflow 393 Address split_disp() const { // deal with disp overflow
388 Address a = (*this); 394 Address a = (*this);
389 int hi_disp = _disp & ~0x3ff; 395 int hi_disp = _disp & ~0x3ff;
390 if (hi_disp != 0) { 396 if (hi_disp != 0) {
391 a._disp -= hi_disp; 397 a._disp -= hi_disp;
1080 // pp 135 (addc was addx in v8) 1086 // pp 135 (addc was addx in v8)
1081 1087
1082 inline void add( Register s1, Register s2, Register d ); 1088 inline void add( Register s1, Register s2, Register d );
1083 inline void add( Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none); 1089 inline void add( Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none);
1084 inline void add( Register s1, int simm13a, Register d, RelocationHolder const& rspec); 1090 inline void add( Register s1, int simm13a, Register d, RelocationHolder const& rspec);
1091 inline void add( Register s1, RegisterConstant s2, Register d, int offset = 0);
1085 inline void add( const Address& a, Register d, int offset = 0); 1092 inline void add( const Address& a, Register d, int offset = 0);
1086 1093
1087 void addcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } 1094 void addcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
1088 void addcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1095 void addcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1089 void addc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); } 1096 void addc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); }
1295 inline void lduh( const Address& a, Register d, int offset = 0 ); 1302 inline void lduh( const Address& a, Register d, int offset = 0 );
1296 inline void lduw( const Address& a, Register d, int offset = 0 ); 1303 inline void lduw( const Address& a, Register d, int offset = 0 );
1297 inline void ldx( const Address& a, Register d, int offset = 0 ); 1304 inline void ldx( const Address& a, Register d, int offset = 0 );
1298 inline void ld( const Address& a, Register d, int offset = 0 ); 1305 inline void ld( const Address& a, Register d, int offset = 0 );
1299 inline void ldd( const Address& a, Register d, int offset = 0 ); 1306 inline void ldd( const Address& a, Register d, int offset = 0 );
1307
1308 inline void ldub( Register s1, RegisterConstant s2, Register d );
1309 inline void ldsb( Register s1, RegisterConstant s2, Register d );
1310 inline void lduh( Register s1, RegisterConstant s2, Register d );
1311 inline void ldsh( Register s1, RegisterConstant s2, Register d );
1312 inline void lduw( Register s1, RegisterConstant s2, Register d );
1313 inline void ldsw( Register s1, RegisterConstant s2, Register d );
1314 inline void ldx( Register s1, RegisterConstant s2, Register d );
1315 inline void ld( Register s1, RegisterConstant s2, Register d );
1316 inline void ldd( Register s1, RegisterConstant s2, Register d );
1300 1317
1301 // pp 177 1318 // pp 177
1302 1319
1303 void ldsba( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } 1320 void ldsba( Register s1, Register s2, int ia, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
1304 void ldsba( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1321 void ldsba( Register s1, int simm13a, Register d ) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1516 inline void stw( Register d, const Address& a, int offset = 0 ); 1533 inline void stw( Register d, const Address& a, int offset = 0 );
1517 inline void stx( Register d, const Address& a, int offset = 0 ); 1534 inline void stx( Register d, const Address& a, int offset = 0 );
1518 inline void st( Register d, const Address& a, int offset = 0 ); 1535 inline void st( Register d, const Address& a, int offset = 0 );
1519 inline void std( Register d, const Address& a, int offset = 0 ); 1536 inline void std( Register d, const Address& a, int offset = 0 );
1520 1537
1538 inline void stb( Register d, Register s1, RegisterConstant s2 );
1539 inline void sth( Register d, Register s1, RegisterConstant s2 );
1540 inline void stw( Register d, Register s1, RegisterConstant s2 );
1541 inline void stx( Register d, Register s1, RegisterConstant s2 );
1542 inline void std( Register d, Register s1, RegisterConstant s2 );
1543 inline void st( Register d, Register s1, RegisterConstant s2 );
1544
1521 // pp 177 1545 // pp 177
1522 1546
1523 void stba( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } 1547 void stba( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
1524 void stba( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1548 void stba( Register d, Register s1, int simm13a ) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
1525 void stha( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } 1549 void stha( Register d, Register s1, Register s2, int ia ) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); }
1938 // Functions for isolating 64 bit loads for LP64 1962 // Functions for isolating 64 bit loads for LP64
1939 // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's 1963 // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's
1940 // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's 1964 // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's
1941 inline void ld_ptr( Register s1, Register s2, Register d ); 1965 inline void ld_ptr( Register s1, Register s2, Register d );
1942 inline void ld_ptr( Register s1, int simm13a, Register d); 1966 inline void ld_ptr( Register s1, int simm13a, Register d);
1967 inline void ld_ptr( Register s1, RegisterConstant s2, Register d );
1943 inline void ld_ptr( const Address& a, Register d, int offset = 0 ); 1968 inline void ld_ptr( const Address& a, Register d, int offset = 0 );
1944 inline void st_ptr( Register d, Register s1, Register s2 ); 1969 inline void st_ptr( Register d, Register s1, Register s2 );
1945 inline void st_ptr( Register d, Register s1, int simm13a); 1970 inline void st_ptr( Register d, Register s1, int simm13a);
1971 inline void st_ptr( Register d, Register s1, RegisterConstant s2 );
1946 inline void st_ptr( Register d, const Address& a, int offset = 0 ); 1972 inline void st_ptr( Register d, const Address& a, int offset = 0 );
1947 1973
1948 // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's 1974 // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's
1949 // st_long will perform st for 32 bit VM's and stx for 64 bit VM's 1975 // st_long will perform st for 32 bit VM's and stx for 64 bit VM's
1950 inline void ld_long( Register s1, Register s2, Register d ); 1976 inline void ld_long( Register s1, Register s2, Register d );
1951 inline void ld_long( Register s1, int simm13a, Register d ); 1977 inline void ld_long( Register s1, int simm13a, Register d );
1978 inline void ld_long( Register s1, RegisterConstant s2, Register d );
1952 inline void ld_long( const Address& a, Register d, int offset = 0 ); 1979 inline void ld_long( const Address& a, Register d, int offset = 0 );
1953 inline void st_long( Register d, Register s1, Register s2 ); 1980 inline void st_long( Register d, Register s1, Register s2 );
1954 inline void st_long( Register d, Register s1, int simm13a ); 1981 inline void st_long( Register d, Register s1, int simm13a );
1982 inline void st_long( Register d, Register s1, RegisterConstant s2 );
1955 inline void st_long( Register d, const Address& a, int offset = 0 ); 1983 inline void st_long( Register d, const Address& a, int offset = 0 );
1984
1985 // Loading values by size and signed-ness
1986 void load_sized_value(Register s1, RegisterConstant s2, Register d,
1987 int size_in_bytes, bool is_signed);
1956 1988
1957 // -------------------------------------------------- 1989 // --------------------------------------------------
1958 1990
1959 public: 1991 public:
1960 // traps as per trap.h (SPARC ABI?) 1992 // traps as per trap.h (SPARC ABI?)
2279 2311
2280 // Writes to stack successive pages until offset reached to check for 2312 // Writes to stack successive pages until offset reached to check for
2281 // stack overflow + shadow pages. Clobbers tsp and scratch registers. 2313 // stack overflow + shadow pages. Clobbers tsp and scratch registers.
2282 void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch); 2314 void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch);
2283 2315
2316 virtual RegisterConstant delayed_value(intptr_t* delayed_value_addr, Register tmp, int offset);
2317
2284 void verify_tlab(); 2318 void verify_tlab();
2285 2319
2286 Condition negate_condition(Condition cond); 2320 Condition negate_condition(Condition cond);
2287 2321
2288 // Helper functions for statistics gathering. 2322 // Helper functions for statistics gathering.