61 {
62 Label L;
63 __ load_const_optimized(Z_R0, table_addr);
64 __ z_cgr(table, Z_R0); // safety net
65 __ z_bre(L);
66 __ stop("crc_table: external word relocation required for load_absolute_address", 0x33);
67 __ bind(L);
68 }
69 {
70 Label L;
71 __ load_const_optimized(Z_R0, table_contents); // crc_table: data @ offset(4)
72 __ z_cl(Z_R0, Address(table, 4)); // safety net
73 __ z_bre(L);
74 __ z_l(Z_R0, Address(table, 4)); // Load data from memory, we know the constant we compared against.
75 __ stop("crc_table: address or contents seems to be messed up", 0x22);
76 __ bind(L);
77 }
78 #endif
79 }
80
81 void StubRoutines::zarch::generate_load_crc_table_addr(MacroAssembler* masm, Register table) {
82 const uint64_t table_contents = 0x77073096UL; // required contents of table[1]
83 generate_load_absolute_address(masm, table, StubRoutines::_crc_table_adr, table_contents);
84 }
85
86 void StubRoutines::zarch::generate_load_crc32c_table_addr(MacroAssembler* masm, Register table) {
87 const uint64_t table_contents = 0xf26b8303UL; // required contents of table[1]
88 generate_load_absolute_address(masm, table, StubRoutines::_crc32c_table_addr, table_contents);
89 }
90
91
92 // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
93 void StubRoutines::zarch::generate_load_trot_table_addr(MacroAssembler* masm, Register table) {
94
95 RelocationHolder rspec = external_word_Relocation::spec((address)_trot_table);
96 __ relocate(rspec);
97 __ load_absolute_address(table, _trot_table_addr);
98 #ifdef ASSERT
99 assert(_trot_table_addr != nullptr, "Translate table address must be initialized by now");
100 assert((p2i(_trot_table_addr) & (TROT_ALIGNMENT-1)) == 0, "Translate table alignment error");
101 for (int i = 0; i < 256; i++) {
102 assert(i == *((jshort*)(_trot_table_addr+2*i)), "trot_table[%d] = %d", i, *((jshort*)(_trot_table_addr+2*i)));
103 }
104 {
105 Label L;
106 __ load_const_optimized(Z_R0, StubRoutines::zarch::_trot_table_addr);
107 __ z_cgr(table, Z_R0); // safety net
108 __ z_bre(L);
|
61 {
62 Label L;
63 __ load_const_optimized(Z_R0, table_addr);
64 __ z_cgr(table, Z_R0); // safety net
65 __ z_bre(L);
66 __ stop("crc_table: external word relocation required for load_absolute_address", 0x33);
67 __ bind(L);
68 }
69 {
70 Label L;
71 __ load_const_optimized(Z_R0, table_contents); // crc_table: data @ offset(4)
72 __ z_cl(Z_R0, Address(table, 4)); // safety net
73 __ z_bre(L);
74 __ z_l(Z_R0, Address(table, 4)); // Load data from memory, we know the constant we compared against.
75 __ stop("crc_table: address or contents seems to be messed up", 0x22);
76 __ bind(L);
77 }
78 #endif
79 }
80
81 address StubRoutines::crc_table_addr() { return (address)StubRoutines::zarch::_crc_table; }
82 address StubRoutines::crc32c_table_addr() { return (address)StubRoutines::zarch::_crc32c_table; }
83
84 void StubRoutines::zarch::generate_load_crc_table_addr(MacroAssembler* masm, Register table) {
85 const uint64_t table_contents = 0x77073096UL; // required contents of table[1]
86 generate_load_absolute_address(masm, table, StubRoutines::crc_table_addr(), table_contents);
87 }
88
89 void StubRoutines::zarch::generate_load_crc32c_table_addr(MacroAssembler* masm, Register table) {
90 const uint64_t table_contents = 0xf26b8303UL; // required contents of table[1]
91 generate_load_absolute_address(masm, table, StubRoutines::crc32c_table_addr(), table_contents);
92 }
93
94
95 // Comapct string intrinsics: Translate table for string inflate intrinsic. Used by trot instruction.
96 void StubRoutines::zarch::generate_load_trot_table_addr(MacroAssembler* masm, Register table) {
97
98 RelocationHolder rspec = external_word_Relocation::spec((address)_trot_table);
99 __ relocate(rspec);
100 __ load_absolute_address(table, _trot_table_addr);
101 #ifdef ASSERT
102 assert(_trot_table_addr != nullptr, "Translate table address must be initialized by now");
103 assert((p2i(_trot_table_addr) & (TROT_ALIGNMENT-1)) == 0, "Translate table alignment error");
104 for (int i = 0; i < 256; i++) {
105 assert(i == *((jshort*)(_trot_table_addr+2*i)), "trot_table[%d] = %d", i, *((jshort*)(_trot_table_addr+2*i)));
106 }
107 {
108 Label L;
109 __ load_const_optimized(Z_R0, StubRoutines::zarch::_trot_table_addr);
110 __ z_cgr(table, Z_R0); // safety net
111 __ z_bre(L);
|