src/cpu/x86/vm/x86_32.ad
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 5091921 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/x86_32.ad

Print this page




12972 //  expand %{
12973 //    eFlagsReg cr;
12974 //    compI_eReg(cr,op1,op2);
12975 //    cmovI_reg_gt(op2,op1,cr);
12976 //  %}
12977 //%}
12978 
12979 // Max Register with Register (generic version)
12980 instruct maxI_eReg(eRegI dst, eRegI src, eFlagsReg flags) %{
12981   match(Set dst (MaxI dst src));
12982   effect(KILL flags);
12983   ins_cost(300);
12984 
12985   format %{ "MAX    $dst,$src" %}
12986   opcode(0xCC);
12987   ins_encode( max_enc(dst,src) );
12988   ins_pipe( pipe_slow );
12989 %}
12990 
12991 // ============================================================================















































12992 // Branch Instructions
12993 // Jump Table
12994 instruct jumpXtnd(eRegI switch_val) %{
12995   match(Jump switch_val);
12996   ins_cost(350);
12997   format %{  "JMP    [$constantaddress](,$switch_val,1)\n\t" %}
12998   ins_encode %{
12999     // Jump to Address(table_base + switch_reg)
13000     Address index(noreg, $switch_val$$Register, Address::times_1);
13001     __ jump(ArrayAddress($constantaddress, index));
13002   %}
13003   ins_pc_relative(1);
13004   ins_pipe(pipe_jmp);
13005 %}
13006 
13007 // Jump Direct - Label defines a relative address from JMP+1
13008 instruct jmpDir(label labl) %{
13009   match(Goto);
13010   effect(USE labl);
13011 




12972 //  expand %{
12973 //    eFlagsReg cr;
12974 //    compI_eReg(cr,op1,op2);
12975 //    cmovI_reg_gt(op2,op1,cr);
12976 //  %}
12977 //%}
12978 
12979 // Max Register with Register (generic version)
12980 instruct maxI_eReg(eRegI dst, eRegI src, eFlagsReg flags) %{
12981   match(Set dst (MaxI dst src));
12982   effect(KILL flags);
12983   ins_cost(300);
12984 
12985   format %{ "MAX    $dst,$src" %}
12986   opcode(0xCC);
12987   ins_encode( max_enc(dst,src) );
12988   ins_pipe( pipe_slow );
12989 %}
12990 
12991 // ============================================================================
12992 // Counted Loop limit node which represents exact final iterator value.
12993 // Note: the resulting value should fit into integer range since
12994 // counted loops have limit check on overflow.
12995 instruct loopLimit_eReg(eAXRegI limit, nadxRegI init, immI stride, eDXRegI limit_hi, nadxRegI tmp, eFlagsReg flags) %{
12996   match(Set limit (LoopLimit (Binary init limit) stride));
12997   effect(TEMP limit_hi, TEMP tmp, KILL flags);
12998   ins_cost(300);
12999 
13000   format %{ "loopLimit $init,$limit,$stride  # $limit = $init + $stride *( $limit - $init + $stride -1)/ $stride, kills $limit_hi" %}
13001   ins_encode %{
13002     int strd = (int)$stride$$constant;
13003     assert(strd != 1 && strd != -1, "sanity");
13004     int m1 = (strd > 0) ? 1 : -1;
13005     // Convert limit to long (EAX:EDX)
13006     __ cdql();
13007     // Convert init to long (init:tmp)
13008     __ movl($tmp$$Register, $init$$Register);
13009     __ sarl($tmp$$Register, 31);
13010     // $limit - $init
13011     __ subl($limit$$Register, $init$$Register);
13012     __ sbbl($limit_hi$$Register, $tmp$$Register);
13013     // + ($stride - 1)
13014     if (strd > 0) {
13015       __ addl($limit$$Register, (strd - 1));
13016       __ adcl($limit_hi$$Register, 0);
13017       __ movl($tmp$$Register, strd);
13018     } else {
13019       __ addl($limit$$Register, (strd + 1));
13020       __ adcl($limit_hi$$Register, -1);
13021       __ lneg($limit_hi$$Register, $limit$$Register);
13022       __ movl($tmp$$Register, -strd);
13023     }
13024     // signed devision: (EAX:EDX) / pos_stride
13025     __ idivl($tmp$$Register);
13026     if (strd < 0) {
13027       // restore sign
13028       __ negl($tmp$$Register);
13029     }
13030     // (EAX) * stride
13031     __ mull($tmp$$Register);
13032     // + init (ignore upper bits)
13033     __ addl($limit$$Register, $init$$Register);
13034   %}
13035   ins_pipe( pipe_slow );
13036 %}
13037 
13038 // ============================================================================
13039 // Branch Instructions
13040 // Jump Table
13041 instruct jumpXtnd(eRegI switch_val) %{
13042   match(Jump switch_val);
13043   ins_cost(350);
13044   format %{  "JMP    [$constantaddress](,$switch_val,1)\n\t" %}
13045   ins_encode %{
13046     // Jump to Address(table_base + switch_reg)
13047     Address index(noreg, $switch_val$$Register, Address::times_1);
13048     __ jump(ArrayAddress($constantaddress, index));
13049   %}
13050   ins_pc_relative(1);
13051   ins_pipe(pipe_jmp);
13052 %}
13053 
13054 // Jump Direct - Label defines a relative address from JMP+1
13055 instruct jmpDir(label labl) %{
13056   match(Goto);
13057   effect(USE labl);
13058 


src/cpu/x86/vm/x86_32.ad
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File