src/cpu/sparc/vm/sparc.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/sparc/vm/sparc.ad Tue May 12 02:53:18 2009
--- new/src/cpu/sparc/vm/sparc.ad Tue May 12 02:53:17 2009
*** 1891,1905 ****
--- 1891,1907 ----
// The intptr_t operand types, defined by textual substitution.
// (Cf. opto/type.hpp. This lets us avoid many, many other ifdefs.)
#ifdef _LP64
#define immX immL
#define immX13 immL13
+ #define immX13m7 immL13m7
#define iRegX iRegL
#define g1RegX g1RegL
#else
#define immX immI
#define immX13 immI13
+ #define immX13m7 immI13m7
#define iRegX iRegI
#define g1RegX g1RegI
#endif
//----------ENCODING BLOCK-----------------------------------------------------
*** 3452,3461 ****
--- 3454,3473 ----
format %{ %}
interface(CONST_INTER);
%}
+ // Integer Immediate: 13-bit minus 7
+ operand immI13m7() %{
+ predicate(Assembler::is_simm13(n->get_int() + 7));
+ match(ConI);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
// Unsigned (positive) Integer Immediate: 13-bit
operand immU13() %{
predicate((0 <= n->get_int()) && Assembler::is_simm13(n->get_int()));
match(ConI);
op_cost(0);
*** 3530,3549 ****
--- 3542,3593 ----
format %{ %}
interface(CONST_INTER);
%}
+ // Immediates for special shifts (sign extend)
+
+ // Integer Immediate: the value 16
+ operand immI_16() %{
+ predicate(n->get_int() == 16);
+ match(ConI);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
+ // Integer Immediate: the value 24
+ operand immI_24() %{
+ predicate(n->get_int() == 24);
+ match(ConI);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
// Integer Immediate: the value 255
operand immI_255() %{
predicate( n->get_int() == 255 );
match(ConI);
op_cost(0);
format %{ %}
interface(CONST_INTER);
%}
+ // Integer Immediate: the value 65535
+ operand immI_65535() %{
+ predicate(n->get_int() == 65535);
+ match(ConI);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
// Long Immediate: the value FF
operand immL_FF() %{
predicate( n->get_long() == 0xFFL );
match(ConL);
op_cost(0);
*** 3645,3654 ****
--- 3689,3708 ----
format %{ %}
interface(CONST_INTER);
%}
+ // Long Immediate: 13-bit minus 7
+ operand immL13m7() %{
+ predicate((-4096L < (n->get_long() + 7L)) && ((n->get_long() + 7L) <= 4095L));
+ match(ConL);
+ op_cost(0);
+
+ format %{ %}
+ interface(CONST_INTER);
+ %}
+
// Long Immediate: low 32-bit mask
operand immL_32bits() %{
predicate(n->get_long() == 0xFFFFFFFFL);
match(ConL);
op_cost(0);
*** 4082,4092 ****
--- 4136,4146 ----
scale(0x0);
disp(0x0);
%}
%}
! // Indirect with simm13 Offset
operand indOffset13(sp_ptr_RegP reg, immX13 offset) %{
constraint(ALLOC_IN_RC(sp_ptr_reg));
match(AddP reg offset);
op_cost(100);
*** 4097,4106 ****
--- 4151,4175 ----
scale(0x0);
disp($offset);
%}
%}
+ // Indirect with simm13 Offset minus 7
+ operand indOffset13m7(sp_ptr_RegP reg, immX13m7 offset) %{
+ constraint(ALLOC_IN_RC(sp_ptr_reg));
+ match(AddP reg offset);
+
+ op_cost(100);
+ format %{ "[$reg + $offset]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x0);
+ scale(0x0);
+ disp($offset);
+ %}
+ %}
+
// Note: Intel has a swapped version also, like this:
//operand indOffsetX(iRegI reg, immP offset) %{
// constraint(ALLOC_IN_RC(int_reg));
// match(AddP offset reg);
//
*** 5502,5511 ****
--- 5571,5594 ----
__ ldsh($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mask_mem);
%}
+ // Load Short (16 bit signed) to Byte (8 bit signed)
+ instruct loadS2B(iRegI dst, indOffset13m7 mem, immI_24 twentyfour) %{
+ match(Set dst (RShiftI (LShiftI (LoadS mem) twentyfour) twentyfour));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+
+ format %{ "LDSB $mem+1,$dst\t! short -> byte" %}
+ ins_encode %{
+ __ ldsb($mem$$Address, $dst$$Register, 1);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
// Load Short (16bit signed) into a Long Register
instruct loadS2L(iRegL dst, memory mem) %{
match(Set dst (ConvI2L (LoadS mem)));
ins_cost(MEMORY_REF_COST);
*** 5528,5537 ****
--- 5611,5633 ----
__ lduh($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mask_mem);
%}
+ // Load Unsigned Short/Char (16 bit UNsigned) to Byte (8 bit signed)
+ instruct loadUS2B(iRegI dst, indOffset13m7 mem, immI_24 twentyfour) %{
+ match(Set dst (RShiftI (LShiftI (LoadUS mem) twentyfour) twentyfour));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+ format %{ "LDSB $mem+1,$dst\t! ushort -> byte" %}
+ ins_encode %{
+ __ ldsb($mem$$Address, $dst$$Register, 1);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
// Load Unsigned Short/Char (16bit UNsigned) into a Long Register
instruct loadUS2L(iRegL dst, memory mem) %{
match(Set dst (ConvI2L (LoadUS mem)));
ins_cost(MEMORY_REF_COST);
*** 5554,5563 ****
--- 5650,5715 ----
__ lduw($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mem);
%}
+ // Load Integer to Byte (8 bit signed)
+ instruct loadI2B(iRegI dst, indOffset13m7 mem, immI_24 twentyfour) %{
+ match(Set dst (RShiftI (LShiftI (LoadI mem) twentyfour) twentyfour));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+
+ format %{ "LDSB $mem+3,$dst\t! int -> byte" %}
+ ins_encode %{
+ __ ldsb($mem$$Address, $dst$$Register, 3);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
+ // Load Integer to Unsigned Byte (8 bit UNsigned)
+ instruct loadI2UB(iRegI dst, indOffset13m7 mem, immI_255 mask) %{
+ match(Set dst (AndI (LoadI mem) mask));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+
+ format %{ "LDUB $mem+3,$dst\t! int -> ubyte" %}
+ ins_encode %{
+ __ ldub($mem$$Address, $dst$$Register, 3);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
+ // Load Integer to Short (16 bit signed)
+ instruct loadI2S(iRegI dst, indOffset13m7 mem, immI_16 sixteen) %{
+ match(Set dst (RShiftI (LShiftI (LoadI mem) sixteen) sixteen));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+
+ format %{ "LDSH $mem+2,$dst\t! int -> short" %}
+ ins_encode %{
+ __ ldsh($mem$$Address, $dst$$Register, 2);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
+ // Load Integer to Unsigned Short (16 bit UNsigned)
+ instruct loadI2US(iRegI dst, indOffset13m7 mem, immI_65535 mask) %{
+ match(Set dst (AndI (LoadI mem) mask));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+
+ format %{ "LDUH $mem+2,$dst\t! int -> ushort/char" %}
+ ins_encode %{
+ __ lduh($mem$$Address, $dst$$Register, 2);
+ %}
+ ins_pipe(iload_mask_mem);
+ %}
+
// Load Integer into a Long Register
instruct loadI2L(iRegL dst, memory mem) %{
match(Set dst (ConvI2L (LoadI mem)));
ins_cost(MEMORY_REF_COST);
src/cpu/sparc/vm/sparc.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File