< prev index next >

src/cpu/ppc/vm/ppc.ad

Print this page
rev 12400 : 8170991: PPC64: Bad code for initialization of short arrays
Summary: Implement special ClearArray nodes to improve initialization.
Reviewed-by: goetz

*** 963,976 **** // Compute padding required for nodes which need alignment. The padding // is the number of bytes (not instructions) which will be inserted before // the instruction. The padding must match the size of a NOP instruction. ! int inlineCallClearArrayNode::compute_padding(int current_offset) const { ! int desired_padding = (2*4-current_offset)&31; // see MacroAssembler::clear_memory_doubleword ! return (desired_padding <= 3*4) ? desired_padding : 0; ! } //============================================================================= // Indicate if the safepoint node needs the polling page as an input. bool SafePointNode::needs_polling_address_input() { --- 963,973 ---- // Compute padding required for nodes which need alignment. The padding // is the number of bytes (not instructions) which will be inserted before // the instruction. The padding must match the size of a NOP instruction. ! // Currently not used on this platform. //============================================================================= // Indicate if the safepoint node needs the polling page as an input. bool SafePointNode::needs_polling_address_input() {
*** 4064,4073 **** --- 4061,4078 ---- op_cost(40); format %{ %} interface(CONST_INTER); %} + operand immLmax30() %{ + predicate((n->get_long() <= 30)); + match(ConL); + op_cost(0); + format %{ %} + interface(CONST_INTER); + %} + // Long Immediate: 16-bit operand immL16() %{ predicate(Assembler::is_simm(n->get_long(), 16)); match(ConL); op_cost(0);
*** 11733,11754 **** __ subf($dst$$Register, $start$$Register, $end$$Register); %} ins_pipe(pipe_class_default); %} ! // Clear-array with dynamic array-size. instruct inlineCallClearArray(rarg1RegL cnt, rarg2RegP base, Universe dummy, regCTR ctr) %{ match(Set dummy (ClearArray cnt base)); effect(USE_KILL cnt, USE_KILL base, KILL ctr); ! ins_cost(MEMORY_REF_COST); ! ! ins_alignment(4); // 'compute_padding()' gets called, up to this number-1 nops will get inserted. format %{ "ClearArray $cnt, $base" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); ! __ clear_memory_doubleword($base$$Register, $cnt$$Register); // kills cnt, base, R0 %} ins_pipe(pipe_class_default); %} instruct string_compareL(rarg1RegP str1, rarg2RegP str2, rarg3RegI cnt1, rarg4RegI cnt2, iRegIdst result, --- 11738,11785 ---- __ subf($dst$$Register, $start$$Register, $end$$Register); %} ins_pipe(pipe_class_default); %} ! // Clear-array with constant short array length. The versions below can use dcbz with cnt > 30. ! instruct inlineCallClearArrayShort(immLmax30 cnt, rarg2RegP base, Universe dummy, regCTR ctr) %{ ! match(Set dummy (ClearArray cnt base)); ! effect(USE_KILL base, KILL ctr); ! ins_cost(2 * MEMORY_REF_COST); ! ! format %{ "ClearArray $cnt, $base" %} ! ins_encode %{ ! // TODO: PPC port $archOpcode(ppc64Opcode_compound); ! __ clear_memory_constlen($base$$Register, $cnt$$constant, R0); // kills base, R0 ! %} ! ins_pipe(pipe_class_default); ! %} ! ! // Clear-array with constant large array length. ! instruct inlineCallClearArrayLarge(immL cnt, rarg2RegP base, Universe dummy, iRegLdst tmp, regCTR ctr) %{ ! match(Set dummy (ClearArray cnt base)); ! effect(USE_KILL base, TEMP tmp, KILL ctr); ! ins_cost(3 * MEMORY_REF_COST); ! ! format %{ "ClearArray $cnt, $base \t// KILL $tmp" %} ! ins_encode %{ ! // TODO: PPC port $archOpcode(ppc64Opcode_compound); ! __ clear_memory_doubleword($base$$Register, $tmp$$Register, R0, $cnt$$constant); // kills base, R0 ! %} ! ins_pipe(pipe_class_default); ! %} ! ! // Clear-array with dynamic array length. instruct inlineCallClearArray(rarg1RegL cnt, rarg2RegP base, Universe dummy, regCTR ctr) %{ match(Set dummy (ClearArray cnt base)); effect(USE_KILL cnt, USE_KILL base, KILL ctr); ! ins_cost(4 * MEMORY_REF_COST); format %{ "ClearArray $cnt, $base" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); ! __ clear_memory_doubleword($base$$Register, $cnt$$Register, R0); // kills cnt, base, R0 %} ins_pipe(pipe_class_default); %} instruct string_compareL(rarg1RegP str1, rarg2RegP str2, rarg3RegI cnt1, rarg4RegI cnt2, iRegIdst result,
< prev index next >