comparison src/cpu/x86/vm/x86_32.ad @ 3842:c7b60b601eb4

7069452: Cleanup NodeFlags Summary: Remove flags which duplicate information in Node::NodeClasses. Reviewed-by: never
author kvn
date Wed, 27 Jul 2011 17:28:36 -0700
parents 3d42f82cd811
children f1c12354c3f7
comparison
equal deleted inserted replaced
3841:0f34fdee809e 3842:c7b60b601eb4
4494 op_attrib op_cost(0); // Required cost attribute 4494 op_attrib op_cost(0); // Required cost attribute
4495 4495
4496 //----------Instruction Attributes--------------------------------------------- 4496 //----------Instruction Attributes---------------------------------------------
4497 ins_attrib ins_cost(100); // Required cost attribute 4497 ins_attrib ins_cost(100); // Required cost attribute
4498 ins_attrib ins_size(8); // Required size attribute (in bits) 4498 ins_attrib ins_size(8); // Required size attribute (in bits)
4499 ins_attrib ins_pc_relative(0); // Required PC Relative flag
4500 ins_attrib ins_short_branch(0); // Required flag: is this instruction a 4499 ins_attrib ins_short_branch(0); // Required flag: is this instruction a
4501 // non-matching short branch variant of some 4500 // non-matching short branch variant of some
4502 // long branch? 4501 // long branch?
4503 ins_attrib ins_alignment(1); // Required alignment attribute (must be a power of 2) 4502 ins_attrib ins_alignment(1); // Required alignment attribute (must be a power of 2)
4504 // specifies the alignment that some part of the instruction (not 4503 // specifies the alignment that some part of the instruction (not
13045 ins_encode %{ 13044 ins_encode %{
13046 // Jump to Address(table_base + switch_reg) 13045 // Jump to Address(table_base + switch_reg)
13047 Address index(noreg, $switch_val$$Register, Address::times_1); 13046 Address index(noreg, $switch_val$$Register, Address::times_1);
13048 __ jump(ArrayAddress($constantaddress, index)); 13047 __ jump(ArrayAddress($constantaddress, index));
13049 %} 13048 %}
13050 ins_pc_relative(1);
13051 ins_pipe(pipe_jmp); 13049 ins_pipe(pipe_jmp);
13052 %} 13050 %}
13053 13051
13054 // Jump Direct - Label defines a relative address from JMP+1 13052 // Jump Direct - Label defines a relative address from JMP+1
13055 instruct jmpDir(label labl) %{ 13053 instruct jmpDir(label labl) %{
13060 format %{ "JMP $labl" %} 13058 format %{ "JMP $labl" %}
13061 size(5); 13059 size(5);
13062 opcode(0xE9); 13060 opcode(0xE9);
13063 ins_encode( OpcP, Lbl( labl ) ); 13061 ins_encode( OpcP, Lbl( labl ) );
13064 ins_pipe( pipe_jmp ); 13062 ins_pipe( pipe_jmp );
13065 ins_pc_relative(1);
13066 %} 13063 %}
13067 13064
13068 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13065 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13069 instruct jmpCon(cmpOp cop, eFlagsReg cr, label labl) %{ 13066 instruct jmpCon(cmpOp cop, eFlagsReg cr, label labl) %{
13070 match(If cop cr); 13067 match(If cop cr);
13074 format %{ "J$cop $labl" %} 13071 format %{ "J$cop $labl" %}
13075 size(6); 13072 size(6);
13076 opcode(0x0F, 0x80); 13073 opcode(0x0F, 0x80);
13077 ins_encode( Jcc( cop, labl) ); 13074 ins_encode( Jcc( cop, labl) );
13078 ins_pipe( pipe_jcc ); 13075 ins_pipe( pipe_jcc );
13079 ins_pc_relative(1);
13080 %} 13076 %}
13081 13077
13082 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13078 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13083 instruct jmpLoopEnd(cmpOp cop, eFlagsReg cr, label labl) %{ 13079 instruct jmpLoopEnd(cmpOp cop, eFlagsReg cr, label labl) %{
13084 match(CountedLoopEnd cop cr); 13080 match(CountedLoopEnd cop cr);
13088 format %{ "J$cop $labl\t# Loop end" %} 13084 format %{ "J$cop $labl\t# Loop end" %}
13089 size(6); 13085 size(6);
13090 opcode(0x0F, 0x80); 13086 opcode(0x0F, 0x80);
13091 ins_encode( Jcc( cop, labl) ); 13087 ins_encode( Jcc( cop, labl) );
13092 ins_pipe( pipe_jcc ); 13088 ins_pipe( pipe_jcc );
13093 ins_pc_relative(1);
13094 %} 13089 %}
13095 13090
13096 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13091 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13097 instruct jmpLoopEndU(cmpOpU cop, eFlagsRegU cmp, label labl) %{ 13092 instruct jmpLoopEndU(cmpOpU cop, eFlagsRegU cmp, label labl) %{
13098 match(CountedLoopEnd cop cmp); 13093 match(CountedLoopEnd cop cmp);
13102 format %{ "J$cop,u $labl\t# Loop end" %} 13097 format %{ "J$cop,u $labl\t# Loop end" %}
13103 size(6); 13098 size(6);
13104 opcode(0x0F, 0x80); 13099 opcode(0x0F, 0x80);
13105 ins_encode( Jcc( cop, labl) ); 13100 ins_encode( Jcc( cop, labl) );
13106 ins_pipe( pipe_jcc ); 13101 ins_pipe( pipe_jcc );
13107 ins_pc_relative(1);
13108 %} 13102 %}
13109 13103
13110 instruct jmpLoopEndUCF(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{ 13104 instruct jmpLoopEndUCF(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{
13111 match(CountedLoopEnd cop cmp); 13105 match(CountedLoopEnd cop cmp);
13112 effect(USE labl); 13106 effect(USE labl);
13115 format %{ "J$cop,u $labl\t# Loop end" %} 13109 format %{ "J$cop,u $labl\t# Loop end" %}
13116 size(6); 13110 size(6);
13117 opcode(0x0F, 0x80); 13111 opcode(0x0F, 0x80);
13118 ins_encode( Jcc( cop, labl) ); 13112 ins_encode( Jcc( cop, labl) );
13119 ins_pipe( pipe_jcc ); 13113 ins_pipe( pipe_jcc );
13120 ins_pc_relative(1);
13121 %} 13114 %}
13122 13115
13123 // Jump Direct Conditional - using unsigned comparison 13116 // Jump Direct Conditional - using unsigned comparison
13124 instruct jmpConU(cmpOpU cop, eFlagsRegU cmp, label labl) %{ 13117 instruct jmpConU(cmpOpU cop, eFlagsRegU cmp, label labl) %{
13125 match(If cop cmp); 13118 match(If cop cmp);
13129 format %{ "J$cop,u $labl" %} 13122 format %{ "J$cop,u $labl" %}
13130 size(6); 13123 size(6);
13131 opcode(0x0F, 0x80); 13124 opcode(0x0F, 0x80);
13132 ins_encode(Jcc(cop, labl)); 13125 ins_encode(Jcc(cop, labl));
13133 ins_pipe(pipe_jcc); 13126 ins_pipe(pipe_jcc);
13134 ins_pc_relative(1);
13135 %} 13127 %}
13136 13128
13137 instruct jmpConUCF(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{ 13129 instruct jmpConUCF(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{
13138 match(If cop cmp); 13130 match(If cop cmp);
13139 effect(USE labl); 13131 effect(USE labl);
13142 format %{ "J$cop,u $labl" %} 13134 format %{ "J$cop,u $labl" %}
13143 size(6); 13135 size(6);
13144 opcode(0x0F, 0x80); 13136 opcode(0x0F, 0x80);
13145 ins_encode(Jcc(cop, labl)); 13137 ins_encode(Jcc(cop, labl));
13146 ins_pipe(pipe_jcc); 13138 ins_pipe(pipe_jcc);
13147 ins_pc_relative(1);
13148 %} 13139 %}
13149 13140
13150 instruct jmpConUCF2(cmpOpUCF2 cop, eFlagsRegUCF cmp, label labl) %{ 13141 instruct jmpConUCF2(cmpOpUCF2 cop, eFlagsRegUCF cmp, label labl) %{
13151 match(If cop cmp); 13142 match(If cop cmp);
13152 effect(USE labl); 13143 effect(USE labl);
13184 emit_cc(cbuf, $secondary, $cop$$cmpcode); 13175 emit_cc(cbuf, $secondary, $cop$$cmpcode);
13185 int disp = l->loc_pos() - (cbuf.insts_size() + 4); 13176 int disp = l->loc_pos() - (cbuf.insts_size() + 4);
13186 emit_d32(cbuf, disp); 13177 emit_d32(cbuf, disp);
13187 %} 13178 %}
13188 ins_pipe(pipe_jcc); 13179 ins_pipe(pipe_jcc);
13189 ins_pc_relative(1);
13190 %} 13180 %}
13191 13181
13192 // ============================================================================ 13182 // ============================================================================
13193 // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass 13183 // The 2nd slow-half of a subtype check. Scan the subklass's 2ndary superklass
13194 // array for an instance of the superklass. Set a hidden internal cache on a 13184 // array for an instance of the superklass. Set a hidden internal cache on a
13252 format %{ "JMP,s $labl" %} 13242 format %{ "JMP,s $labl" %}
13253 size(2); 13243 size(2);
13254 opcode(0xEB); 13244 opcode(0xEB);
13255 ins_encode( OpcP, LblShort( labl ) ); 13245 ins_encode( OpcP, LblShort( labl ) );
13256 ins_pipe( pipe_jmp ); 13246 ins_pipe( pipe_jmp );
13257 ins_pc_relative(1);
13258 ins_short_branch(1); 13247 ins_short_branch(1);
13259 %} 13248 %}
13260 13249
13261 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13250 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13262 instruct jmpCon_short(cmpOp cop, eFlagsReg cr, label labl) %{ 13251 instruct jmpCon_short(cmpOp cop, eFlagsReg cr, label labl) %{
13267 format %{ "J$cop,s $labl" %} 13256 format %{ "J$cop,s $labl" %}
13268 size(2); 13257 size(2);
13269 opcode(0x70); 13258 opcode(0x70);
13270 ins_encode( JccShort( cop, labl) ); 13259 ins_encode( JccShort( cop, labl) );
13271 ins_pipe( pipe_jcc ); 13260 ins_pipe( pipe_jcc );
13272 ins_pc_relative(1);
13273 ins_short_branch(1); 13261 ins_short_branch(1);
13274 %} 13262 %}
13275 13263
13276 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13264 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13277 instruct jmpLoopEnd_short(cmpOp cop, eFlagsReg cr, label labl) %{ 13265 instruct jmpLoopEnd_short(cmpOp cop, eFlagsReg cr, label labl) %{
13282 format %{ "J$cop,s $labl\t# Loop end" %} 13270 format %{ "J$cop,s $labl\t# Loop end" %}
13283 size(2); 13271 size(2);
13284 opcode(0x70); 13272 opcode(0x70);
13285 ins_encode( JccShort( cop, labl) ); 13273 ins_encode( JccShort( cop, labl) );
13286 ins_pipe( pipe_jcc ); 13274 ins_pipe( pipe_jcc );
13287 ins_pc_relative(1);
13288 ins_short_branch(1); 13275 ins_short_branch(1);
13289 %} 13276 %}
13290 13277
13291 // Jump Direct Conditional - Label defines a relative address from Jcc+1 13278 // Jump Direct Conditional - Label defines a relative address from Jcc+1
13292 instruct jmpLoopEndU_short(cmpOpU cop, eFlagsRegU cmp, label labl) %{ 13279 instruct jmpLoopEndU_short(cmpOpU cop, eFlagsRegU cmp, label labl) %{
13297 format %{ "J$cop,us $labl\t# Loop end" %} 13284 format %{ "J$cop,us $labl\t# Loop end" %}
13298 size(2); 13285 size(2);
13299 opcode(0x70); 13286 opcode(0x70);
13300 ins_encode( JccShort( cop, labl) ); 13287 ins_encode( JccShort( cop, labl) );
13301 ins_pipe( pipe_jcc ); 13288 ins_pipe( pipe_jcc );
13302 ins_pc_relative(1);
13303 ins_short_branch(1); 13289 ins_short_branch(1);
13304 %} 13290 %}
13305 13291
13306 instruct jmpLoopEndUCF_short(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{ 13292 instruct jmpLoopEndUCF_short(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{
13307 match(CountedLoopEnd cop cmp); 13293 match(CountedLoopEnd cop cmp);
13311 format %{ "J$cop,us $labl\t# Loop end" %} 13297 format %{ "J$cop,us $labl\t# Loop end" %}
13312 size(2); 13298 size(2);
13313 opcode(0x70); 13299 opcode(0x70);
13314 ins_encode( JccShort( cop, labl) ); 13300 ins_encode( JccShort( cop, labl) );
13315 ins_pipe( pipe_jcc ); 13301 ins_pipe( pipe_jcc );
13316 ins_pc_relative(1);
13317 ins_short_branch(1); 13302 ins_short_branch(1);
13318 %} 13303 %}
13319 13304
13320 // Jump Direct Conditional - using unsigned comparison 13305 // Jump Direct Conditional - using unsigned comparison
13321 instruct jmpConU_short(cmpOpU cop, eFlagsRegU cmp, label labl) %{ 13306 instruct jmpConU_short(cmpOpU cop, eFlagsRegU cmp, label labl) %{
13326 format %{ "J$cop,us $labl" %} 13311 format %{ "J$cop,us $labl" %}
13327 size(2); 13312 size(2);
13328 opcode(0x70); 13313 opcode(0x70);
13329 ins_encode( JccShort( cop, labl) ); 13314 ins_encode( JccShort( cop, labl) );
13330 ins_pipe( pipe_jcc ); 13315 ins_pipe( pipe_jcc );
13331 ins_pc_relative(1);
13332 ins_short_branch(1); 13316 ins_short_branch(1);
13333 %} 13317 %}
13334 13318
13335 instruct jmpConUCF_short(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{ 13319 instruct jmpConUCF_short(cmpOpUCF cop, eFlagsRegUCF cmp, label labl) %{
13336 match(If cop cmp); 13320 match(If cop cmp);
13340 format %{ "J$cop,us $labl" %} 13324 format %{ "J$cop,us $labl" %}
13341 size(2); 13325 size(2);
13342 opcode(0x70); 13326 opcode(0x70);
13343 ins_encode( JccShort( cop, labl) ); 13327 ins_encode( JccShort( cop, labl) );
13344 ins_pipe( pipe_jcc ); 13328 ins_pipe( pipe_jcc );
13345 ins_pc_relative(1);
13346 ins_short_branch(1); 13329 ins_short_branch(1);
13347 %} 13330 %}
13348 13331
13349 instruct jmpConUCF2_short(cmpOpUCF2 cop, eFlagsRegUCF cmp, label labl) %{ 13332 instruct jmpConUCF2_short(cmpOpUCF2 cop, eFlagsRegUCF cmp, label labl) %{
13350 match(If cop cmp); 13333 match(If cop cmp);
13380 emit_d8(cbuf, disp); 13363 emit_d8(cbuf, disp);
13381 assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp"); 13364 assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
13382 assert(-128 <= parity_disp && parity_disp <= 127, "Displacement too large for short jmp"); 13365 assert(-128 <= parity_disp && parity_disp <= 127, "Displacement too large for short jmp");
13383 %} 13366 %}
13384 ins_pipe(pipe_jcc); 13367 ins_pipe(pipe_jcc);
13385 ins_pc_relative(1);
13386 ins_short_branch(1); 13368 ins_short_branch(1);
13387 %} 13369 %}
13388 13370
13389 // ============================================================================ 13371 // ============================================================================
13390 // Long Compare 13372 // Long Compare
13853 ins_encode( pre_call_FPU, 13835 ins_encode( pre_call_FPU,
13854 Java_Static_Call( meth ), 13836 Java_Static_Call( meth ),
13855 call_epilog, 13837 call_epilog,
13856 post_call_FPU ); 13838 post_call_FPU );
13857 ins_pipe( pipe_slow ); 13839 ins_pipe( pipe_slow );
13858 ins_pc_relative(1);
13859 ins_alignment(4); 13840 ins_alignment(4);
13860 %} 13841 %}
13861 13842
13862 // Call Java Static Instruction (method handle version) 13843 // Call Java Static Instruction (method handle version)
13863 // Note: If this code changes, the corresponding ret_addr_offset() and 13844 // Note: If this code changes, the corresponding ret_addr_offset() and
13877 Java_Static_Call( meth ), 13858 Java_Static_Call( meth ),
13878 restore_SP, 13859 restore_SP,
13879 call_epilog, 13860 call_epilog,
13880 post_call_FPU ); 13861 post_call_FPU );
13881 ins_pipe( pipe_slow ); 13862 ins_pipe( pipe_slow );
13882 ins_pc_relative(1);
13883 ins_alignment(4); 13863 ins_alignment(4);
13884 %} 13864 %}
13885 13865
13886 // Call Java Dynamic Instruction 13866 // Call Java Dynamic Instruction
13887 // Note: If this code changes, the corresponding ret_addr_offset() and 13867 // Note: If this code changes, the corresponding ret_addr_offset() and
13897 ins_encode( pre_call_FPU, 13877 ins_encode( pre_call_FPU,
13898 Java_Dynamic_Call( meth ), 13878 Java_Dynamic_Call( meth ),
13899 call_epilog, 13879 call_epilog,
13900 post_call_FPU ); 13880 post_call_FPU );
13901 ins_pipe( pipe_slow ); 13881 ins_pipe( pipe_slow );
13902 ins_pc_relative(1);
13903 ins_alignment(4); 13882 ins_alignment(4);
13904 %} 13883 %}
13905 13884
13906 // Call Runtime Instruction 13885 // Call Runtime Instruction
13907 instruct CallRuntimeDirect(method meth) %{ 13886 instruct CallRuntimeDirect(method meth) %{
13915 ins_encode( pre_call_FPU, 13894 ins_encode( pre_call_FPU,
13916 FFree_Float_Stack_All, 13895 FFree_Float_Stack_All,
13917 Java_To_Runtime( meth ), 13896 Java_To_Runtime( meth ),
13918 post_call_FPU ); 13897 post_call_FPU );
13919 ins_pipe( pipe_slow ); 13898 ins_pipe( pipe_slow );
13920 ins_pc_relative(1);
13921 %} 13899 %}
13922 13900
13923 // Call runtime without safepoint 13901 // Call runtime without safepoint
13924 instruct CallLeafDirect(method meth) %{ 13902 instruct CallLeafDirect(method meth) %{
13925 match(CallLeaf); 13903 match(CallLeaf);
13931 ins_encode( pre_call_FPU, 13909 ins_encode( pre_call_FPU,
13932 FFree_Float_Stack_All, 13910 FFree_Float_Stack_All,
13933 Java_To_Runtime( meth ), 13911 Java_To_Runtime( meth ),
13934 Verify_FPU_For_Leaf, post_call_FPU ); 13912 Verify_FPU_For_Leaf, post_call_FPU );
13935 ins_pipe( pipe_slow ); 13913 ins_pipe( pipe_slow );
13936 ins_pc_relative(1);
13937 %} 13914 %}
13938 13915
13939 instruct CallLeafNoFPDirect(method meth) %{ 13916 instruct CallLeafNoFPDirect(method meth) %{
13940 match(CallLeafNoFP); 13917 match(CallLeafNoFP);
13941 effect(USE meth); 13918 effect(USE meth);
13943 ins_cost(300); 13920 ins_cost(300);
13944 format %{ "CALL_LEAF_NOFP,runtime " %} 13921 format %{ "CALL_LEAF_NOFP,runtime " %}
13945 opcode(0xE8); /* E8 cd */ 13922 opcode(0xE8); /* E8 cd */
13946 ins_encode(Java_To_Runtime(meth)); 13923 ins_encode(Java_To_Runtime(meth));
13947 ins_pipe( pipe_slow ); 13924 ins_pipe( pipe_slow );
13948 ins_pc_relative(1);
13949 %} 13925 %}
13950 13926
13951 13927
13952 // Return Instruction 13928 // Return Instruction
13953 // Remove the return address & jump to it. 13929 // Remove the return address & jump to it.
14022 effect( TEMP tmp, TEMP scr ); 13998 effect( TEMP tmp, TEMP scr );
14023 ins_cost(300); 13999 ins_cost(300);
14024 format %{ "FASTLOCK $object, $box KILLS $tmp,$scr" %} 14000 format %{ "FASTLOCK $object, $box KILLS $tmp,$scr" %}
14025 ins_encode( Fast_Lock(object,box,tmp,scr) ); 14001 ins_encode( Fast_Lock(object,box,tmp,scr) );
14026 ins_pipe( pipe_slow ); 14002 ins_pipe( pipe_slow );
14027 ins_pc_relative(1);
14028 %} 14003 %}
14029 14004
14030 instruct cmpFastUnlock( eFlagsReg cr, eRegP object, eAXRegP box, eRegP tmp ) %{ 14005 instruct cmpFastUnlock( eFlagsReg cr, eRegP object, eAXRegP box, eRegP tmp ) %{
14031 match( Set cr (FastUnlock object box) ); 14006 match( Set cr (FastUnlock object box) );
14032 effect( TEMP tmp ); 14007 effect( TEMP tmp );
14033 ins_cost(300); 14008 ins_cost(300);
14034 format %{ "FASTUNLOCK $object, $box, $tmp" %} 14009 format %{ "FASTUNLOCK $object, $box, $tmp" %}
14035 ins_encode( Fast_Unlock(object,box,tmp) ); 14010 ins_encode( Fast_Unlock(object,box,tmp) );
14036 ins_pipe( pipe_slow ); 14011 ins_pipe( pipe_slow );
14037 ins_pc_relative(1);
14038 %} 14012 %}
14039 14013
14040 14014
14041 14015
14042 // ============================================================================ 14016 // ============================================================================