3878 // rscratch1: r10 3879 const Register crc = c_rarg0; // crc 3880 const Register buf = c_rarg1; // source java byte array address 3881 const Register len = c_rarg2; // length 3882 const Register table = c_rarg3; // crc_table address (reuse register) 3883 const Register tmp = r11; 3884 assert_different_registers(crc, buf, len, table, tmp, rax); 3885 3886 BLOCK_COMMENT("Entry:"); 3887 __ enter(); // required for proper stackwalking of RuntimeStub frame 3888 3889 __ kernel_crc32(crc, buf, len, table, tmp); 3890 3891 __ movl(rax, crc); 3892 __ leave(); // required for proper stackwalking of RuntimeStub frame 3893 __ ret(0); 3894 3895 return start; 3896 } 3897 3898 3899 /** 3900 * Arguments: 3901 * 3902 * Input: 3903 * c_rarg0 - x address 3904 * c_rarg1 - x length 3905 * c_rarg2 - y address 3906 * c_rarg3 - y lenth 3907 * not Win64 3908 * c_rarg4 - z address 3909 * c_rarg5 - z length 3910 * Win64 3911 * rsp+40 - z address 3912 * rsp+48 - z length 3913 */ 3914 address generate_multiplyToLen() { 3915 __ align(CodeEntryAlignment); 3916 StubCodeMark mark(this, "StubRoutines", "multiplyToLen"); 3917 4221 4222 StubRoutines::_handler_for_unsafe_access_entry = 4223 generate_handler_for_unsafe_access(); 4224 4225 // platform dependent 4226 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp(); 4227 StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp(); 4228 4229 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr(); 4230 4231 // Build this early so it's available for the interpreter. 4232 StubRoutines::_throw_StackOverflowError_entry = 4233 generate_throw_exception("StackOverflowError throw_exception", 4234 CAST_FROM_FN_PTR(address, 4235 SharedRuntime:: 4236 throw_StackOverflowError)); 4237 if (UseCRC32Intrinsics) { 4238 // set table address before stub generation which use it 4239 StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; 4240 StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32(); 4241 } 4242 } 4243 4244 void generate_all() { 4245 // Generates all stubs and initializes the entry points 4246 4247 // These entry points require SharedInfo::stack0 to be set up in 4248 // non-core builds and need to be relocatable, so they each 4249 // fabricate a RuntimeStub internally. 4250 StubRoutines::_throw_AbstractMethodError_entry = 4251 generate_throw_exception("AbstractMethodError throw_exception", 4252 CAST_FROM_FN_PTR(address, 4253 SharedRuntime:: 4254 throw_AbstractMethodError)); 4255 4256 StubRoutines::_throw_IncompatibleClassChangeError_entry = 4257 generate_throw_exception("IncompatibleClassChangeError throw_exception", 4258 CAST_FROM_FN_PTR(address, 4259 SharedRuntime:: 4260 throw_IncompatibleClassChangeError)); | 3878 // rscratch1: r10 3879 const Register crc = c_rarg0; // crc 3880 const Register buf = c_rarg1; // source java byte array address 3881 const Register len = c_rarg2; // length 3882 const Register table = c_rarg3; // crc_table address (reuse register) 3883 const Register tmp = r11; 3884 assert_different_registers(crc, buf, len, table, tmp, rax); 3885 3886 BLOCK_COMMENT("Entry:"); 3887 __ enter(); // required for proper stackwalking of RuntimeStub frame 3888 3889 __ kernel_crc32(crc, buf, len, table, tmp); 3890 3891 __ movl(rax, crc); 3892 __ leave(); // required for proper stackwalking of RuntimeStub frame 3893 __ ret(0); 3894 3895 return start; 3896 } 3897 3898 /** 3899 * Arguments: 3900 * 3901 * Inputs: 3902 * c_rarg0 - int crc 3903 * c_rarg1 - byte* buf 3904 * c_rarg2 - long length 3905 * c_rarg3 - table_start - optional (present only when doing a library_calll, 3906 * not used by x86 algorithm) 3907 * 3908 * Ouput: 3909 * rax - int crc result 3910 */ 3911 address generate_updateBytesCRC32C(bool IsPclmulqdqSupported) { 3912 assert(UseCRC32CIntrinsics, "need SSE4_2"); 3913 __ align(CodeEntryAlignment); 3914 StubCodeMark mark(this, "StubRoutines", "updateBytesCRC32C"); 3915 address start = __ pc(); 3916 //reg.arg int#0 int#1 int#2 int#3 int#4 int#5 float regs 3917 //Windows RCX RDX R8 R9 none none XMM0..XMM3 3918 //Lin / Sol RDI RSI RDX RCX R8 R9 XMM0..XMM7 3919 const Register crc = c_rarg0; // crc 3920 const Register buf = c_rarg1; // source java byte array address 3921 const Register len = c_rarg2; // length 3922 const Register A = rax; 3923 const Register J = r9; 3924 const Register K = r10; 3925 const Register L = r11; 3926 #ifdef _WIN64 3927 const Register Y = rdi; 3928 const Register Z = rsi; 3929 #else 3930 const Register Y = rcx; 3931 const Register Z = r8; 3932 #endif 3933 assert_different_registers(crc, buf, len, A, J, K, L, Y, Z); 3934 3935 BLOCK_COMMENT("Entry:"); 3936 __ enter(); // required for proper stackwalking of RuntimeStub frame 3937 #ifdef _WIN64 3938 __ push(Y); 3939 __ push(Z); 3940 #endif 3941 __ crc32c_IPL_Alg2Alt2Fast(crc, buf, len, 3942 A, J, K, 3943 L, Y, Z, 3944 c_farg0, c_farg1, c_farg2, 3945 IsPclmulqdqSupported); 3946 __ movl(rax, crc); 3947 #ifdef _WIN64 3948 __ pop(Z); 3949 __ pop(Y); 3950 #endif 3951 __ leave(); // required for proper stackwalking of RuntimeStub frame 3952 __ ret(0); 3953 3954 return start; 3955 } 3956 3957 /** 3958 * Arguments: 3959 * 3960 * Input: 3961 * c_rarg0 - x address 3962 * c_rarg1 - x length 3963 * c_rarg2 - y address 3964 * c_rarg3 - y lenth 3965 * not Win64 3966 * c_rarg4 - z address 3967 * c_rarg5 - z length 3968 * Win64 3969 * rsp+40 - z address 3970 * rsp+48 - z length 3971 */ 3972 address generate_multiplyToLen() { 3973 __ align(CodeEntryAlignment); 3974 StubCodeMark mark(this, "StubRoutines", "multiplyToLen"); 3975 4279 4280 StubRoutines::_handler_for_unsafe_access_entry = 4281 generate_handler_for_unsafe_access(); 4282 4283 // platform dependent 4284 StubRoutines::x86::_get_previous_fp_entry = generate_get_previous_fp(); 4285 StubRoutines::x86::_get_previous_sp_entry = generate_get_previous_sp(); 4286 4287 StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr(); 4288 4289 // Build this early so it's available for the interpreter. 4290 StubRoutines::_throw_StackOverflowError_entry = 4291 generate_throw_exception("StackOverflowError throw_exception", 4292 CAST_FROM_FN_PTR(address, 4293 SharedRuntime:: 4294 throw_StackOverflowError)); 4295 if (UseCRC32Intrinsics) { 4296 // set table address before stub generation which use it 4297 StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; 4298 StubRoutines::_updateBytesCRC32 = generate_updateBytesCRC32(); 4299 } 4300 4301 if (UseCRC32CIntrinsics) { 4302 bool supports_clmul; 4303 StubRoutines::x86::GenerateCRC32CTable(supports_clmul = VM_Version::supports_clmul()); 4304 StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table; 4305 StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul); 4306 } 4307 } 4308 4309 void generate_all() { 4310 // Generates all stubs and initializes the entry points 4311 4312 // These entry points require SharedInfo::stack0 to be set up in 4313 // non-core builds and need to be relocatable, so they each 4314 // fabricate a RuntimeStub internally. 4315 StubRoutines::_throw_AbstractMethodError_entry = 4316 generate_throw_exception("AbstractMethodError throw_exception", 4317 CAST_FROM_FN_PTR(address, 4318 SharedRuntime:: 4319 throw_AbstractMethodError)); 4320 4321 StubRoutines::_throw_IncompatibleClassChangeError_entry = 4322 generate_throw_exception("IncompatibleClassChangeError throw_exception", 4323 CAST_FROM_FN_PTR(address, 4324 SharedRuntime:: 4325 throw_IncompatibleClassChangeError)); |