1086 // pp 135 (addc was addx in v8) |
1086 // pp 135 (addc was addx in v8) |
1087 |
1087 |
1088 inline void add( Register s1, Register s2, Register d ); |
1088 inline void add( Register s1, Register s2, Register d ); |
1089 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); |
1090 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); |
1091 inline void add( Register s1, RegisterOrConstant s2, Register d, int offset = 0); |
1092 inline void add( const Address& a, Register d, int offset = 0); |
1092 inline void add( const Address& a, Register d, int offset = 0); |
1093 |
1093 |
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) ); } |
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) ); } |
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) ); } |
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) ); } |
1096 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) ); } |
1097 void addc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } |
1097 void addc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } |
1303 inline void lduw( const Address& a, Register d, int offset = 0 ); |
1303 inline void lduw( const Address& a, Register d, int offset = 0 ); |
1304 inline void ldx( const Address& a, Register d, int offset = 0 ); |
1304 inline void ldx( const Address& a, Register d, int offset = 0 ); |
1305 inline void ld( const Address& a, Register d, int offset = 0 ); |
1305 inline void ld( const Address& a, Register d, int offset = 0 ); |
1306 inline void ldd( const Address& a, Register d, int offset = 0 ); |
1306 inline void ldd( const Address& a, Register d, int offset = 0 ); |
1307 |
1307 |
1308 inline void ldub( Register s1, RegisterConstant s2, Register d ); |
1308 inline void ldub( Register s1, RegisterOrConstant s2, Register d ); |
1309 inline void ldsb( Register s1, RegisterConstant s2, Register d ); |
1309 inline void ldsb( Register s1, RegisterOrConstant s2, Register d ); |
1310 inline void lduh( Register s1, RegisterConstant s2, Register d ); |
1310 inline void lduh( Register s1, RegisterOrConstant s2, Register d ); |
1311 inline void ldsh( Register s1, RegisterConstant s2, Register d ); |
1311 inline void ldsh( Register s1, RegisterOrConstant s2, Register d ); |
1312 inline void lduw( Register s1, RegisterConstant s2, Register d ); |
1312 inline void lduw( Register s1, RegisterOrConstant s2, Register d ); |
1313 inline void ldsw( Register s1, RegisterConstant s2, Register d ); |
1313 inline void ldsw( Register s1, RegisterOrConstant s2, Register d ); |
1314 inline void ldx( Register s1, RegisterConstant s2, Register d ); |
1314 inline void ldx( Register s1, RegisterOrConstant s2, Register d ); |
1315 inline void ld( Register s1, RegisterConstant s2, Register d ); |
1315 inline void ld( Register s1, RegisterOrConstant s2, Register d ); |
1316 inline void ldd( Register s1, RegisterConstant s2, Register d ); |
1316 inline void ldd( Register s1, RegisterOrConstant s2, Register d ); |
1317 |
1317 |
1318 // pp 177 |
1318 // pp 177 |
1319 |
1319 |
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) ); } |
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) ); } |
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) ); } |
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) ); } |
1533 inline void stw( Register d, const Address& a, int offset = 0 ); |
1533 inline void stw( Register d, const Address& a, int offset = 0 ); |
1534 inline void stx( Register d, const Address& a, int offset = 0 ); |
1534 inline void stx( Register d, const Address& a, int offset = 0 ); |
1535 inline void st( Register d, const Address& a, int offset = 0 ); |
1535 inline void st( Register d, const Address& a, int offset = 0 ); |
1536 inline void std( Register d, const Address& a, int offset = 0 ); |
1536 inline void std( Register d, const Address& a, int offset = 0 ); |
1537 |
1537 |
1538 inline void stb( Register d, Register s1, RegisterConstant s2 ); |
1538 inline void stb( Register d, Register s1, RegisterOrConstant s2 ); |
1539 inline void sth( Register d, Register s1, RegisterConstant s2 ); |
1539 inline void sth( Register d, Register s1, RegisterOrConstant s2 ); |
1540 inline void stw( Register d, Register s1, RegisterConstant s2 ); |
1540 inline void stw( Register d, Register s1, RegisterOrConstant s2 ); |
1541 inline void stx( Register d, Register s1, RegisterConstant s2 ); |
1541 inline void stx( Register d, Register s1, RegisterOrConstant s2 ); |
1542 inline void std( Register d, Register s1, RegisterConstant s2 ); |
1542 inline void std( Register d, Register s1, RegisterOrConstant s2 ); |
1543 inline void st( Register d, Register s1, RegisterConstant s2 ); |
1543 inline void st( Register d, Register s1, RegisterOrConstant s2 ); |
1544 |
1544 |
1545 // pp 177 |
1545 // pp 177 |
1546 |
1546 |
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) ); } |
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) ); } |
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) ); } |
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) ); } |
1857 } |
1857 } |
1858 |
1858 |
1859 // Functions for isolating 64 bit shifts for LP64 |
1859 // Functions for isolating 64 bit shifts for LP64 |
1860 inline void sll_ptr( Register s1, Register s2, Register d ); |
1860 inline void sll_ptr( Register s1, Register s2, Register d ); |
1861 inline void sll_ptr( Register s1, int imm6a, Register d ); |
1861 inline void sll_ptr( Register s1, int imm6a, Register d ); |
1862 inline void sll_ptr( Register s1, RegisterConstant s2, Register d ); |
1862 inline void sll_ptr( Register s1, RegisterOrConstant s2, Register d ); |
1863 inline void srl_ptr( Register s1, Register s2, Register d ); |
1863 inline void srl_ptr( Register s1, Register s2, Register d ); |
1864 inline void srl_ptr( Register s1, int imm6a, Register d ); |
1864 inline void srl_ptr( Register s1, int imm6a, Register d ); |
1865 |
1865 |
1866 // little-endian |
1866 // little-endian |
1867 inline void casl( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); } |
1867 inline void casl( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); } |
1963 // Functions for isolating 64 bit loads for LP64 |
1963 // Functions for isolating 64 bit loads for LP64 |
1964 // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's |
1964 // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's |
1965 // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's |
1965 // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's |
1966 inline void ld_ptr( Register s1, Register s2, Register d ); |
1966 inline void ld_ptr( Register s1, Register s2, Register d ); |
1967 inline void ld_ptr( Register s1, int simm13a, Register d); |
1967 inline void ld_ptr( Register s1, int simm13a, Register d); |
1968 inline void ld_ptr( Register s1, RegisterConstant s2, Register d ); |
1968 inline void ld_ptr( Register s1, RegisterOrConstant s2, Register d ); |
1969 inline void ld_ptr( const Address& a, Register d, int offset = 0 ); |
1969 inline void ld_ptr( const Address& a, Register d, int offset = 0 ); |
1970 inline void st_ptr( Register d, Register s1, Register s2 ); |
1970 inline void st_ptr( Register d, Register s1, Register s2 ); |
1971 inline void st_ptr( Register d, Register s1, int simm13a); |
1971 inline void st_ptr( Register d, Register s1, int simm13a); |
1972 inline void st_ptr( Register d, Register s1, RegisterConstant s2 ); |
1972 inline void st_ptr( Register d, Register s1, RegisterOrConstant s2 ); |
1973 inline void st_ptr( Register d, const Address& a, int offset = 0 ); |
1973 inline void st_ptr( Register d, const Address& a, int offset = 0 ); |
1974 |
1974 |
1975 // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's |
1975 // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's |
1976 // st_long will perform st for 32 bit VM's and stx for 64 bit VM's |
1976 // st_long will perform st for 32 bit VM's and stx for 64 bit VM's |
1977 inline void ld_long( Register s1, Register s2, Register d ); |
1977 inline void ld_long( Register s1, Register s2, Register d ); |
1978 inline void ld_long( Register s1, int simm13a, Register d ); |
1978 inline void ld_long( Register s1, int simm13a, Register d ); |
1979 inline void ld_long( Register s1, RegisterConstant s2, Register d ); |
1979 inline void ld_long( Register s1, RegisterOrConstant s2, Register d ); |
1980 inline void ld_long( const Address& a, Register d, int offset = 0 ); |
1980 inline void ld_long( const Address& a, Register d, int offset = 0 ); |
1981 inline void st_long( Register d, Register s1, Register s2 ); |
1981 inline void st_long( Register d, Register s1, Register s2 ); |
1982 inline void st_long( Register d, Register s1, int simm13a ); |
1982 inline void st_long( Register d, Register s1, int simm13a ); |
1983 inline void st_long( Register d, Register s1, RegisterConstant s2 ); |
1983 inline void st_long( Register d, Register s1, RegisterOrConstant s2 ); |
1984 inline void st_long( Register d, const Address& a, int offset = 0 ); |
1984 inline void st_long( Register d, const Address& a, int offset = 0 ); |
1985 |
1985 |
1986 // Loading values by size and signed-ness |
1986 // Loading values by size and signed-ness |
1987 void load_sized_value(Register s1, RegisterConstant s2, Register d, |
1987 void load_sized_value(Register s1, RegisterOrConstant s2, Register d, |
1988 int size_in_bytes, bool is_signed); |
1988 int size_in_bytes, bool is_signed); |
1989 |
1989 |
1990 // Helpers for address formation. |
1990 // Helpers for address formation. |
1991 // They update the dest in place, whether it is a register or constant. |
1991 // They update the dest in place, whether it is a register or constant. |
1992 // They emit no code at all if src is a constant zero. |
1992 // They emit no code at all if src is a constant zero. |
1993 // If dest is a constant and src is a register, the temp argument |
1993 // If dest is a constant and src is a register, the temp argument |
1994 // is required, and becomes the result. |
1994 // is required, and becomes the result. |
1995 // If dest is a register and src is a non-simm13 constant, |
1995 // If dest is a register and src is a non-simm13 constant, |
1996 // the temp argument is required, and is used to materialize the constant. |
1996 // the temp argument is required, and is used to materialize the constant. |
1997 void regcon_inc_ptr( RegisterConstant& dest, RegisterConstant src, |
1997 void regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstant src, |
1998 Register temp = noreg ); |
1998 Register temp = noreg ); |
1999 void regcon_sll_ptr( RegisterConstant& dest, RegisterConstant src, |
1999 void regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src, |
2000 Register temp = noreg ); |
2000 Register temp = noreg ); |
2001 RegisterConstant ensure_rs2(RegisterConstant rs2, Register sethi_temp) { |
2001 RegisterOrConstant ensure_rs2(RegisterOrConstant rs2, Register sethi_temp) { |
2002 guarantee(sethi_temp != noreg, "constant offset overflow"); |
2002 guarantee(sethi_temp != noreg, "constant offset overflow"); |
2003 if (is_simm13(rs2.constant_or_zero())) |
2003 if (is_simm13(rs2.constant_or_zero())) |
2004 return rs2; // register or short constant |
2004 return rs2; // register or short constant |
2005 set(rs2.as_constant(), sethi_temp); |
2005 set(rs2.as_constant(), sethi_temp); |
2006 return sethi_temp; |
2006 return sethi_temp; |