src/cpu/sparc/vm/sparc.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
8000805 Cdiff src/cpu/sparc/vm/sparc.ad
src/cpu/sparc/vm/sparc.ad
Print this page
*** 5569,5578 ****
--- 5569,5593 ----
__ ldsb($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mask_mem);
%}
+ // Load Byte (8 bit signed) with 8-bit mask into Long Register
+ instruct loadB2L_immI8(iRegL dst, memory mem, immI8 mask) %{
+ match(Set dst (ConvI2L (AndI (LoadB mem) mask)));
+ ins_cost(MEMORY_REF_COST + DEFAULT_COST);
+
+ size(2*4);
+ format %{ "LDUB $mem,$dst\t# byte & 8-bit mask -> long\n\t"
+ "AND $dst,$mask,$dst" %}
+ ins_encode %{
+ __ ldub($mem$$Address, $dst$$Register);
+ __ and3($dst$$Register, $mask$$constant, $dst$$Register);
+ %}
+ ins_pipe(iload_mem);
+ %}
+
// Load Unsigned Byte (8bit UNsigned) into an int reg
instruct loadUB(iRegI dst, memory mem) %{
match(Set dst (LoadUB mem));
ins_cost(MEMORY_REF_COST);
*** 5650,5659 ****
--- 5665,5703 ----
__ ldsh($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mask_mem);
%}
+ // Load Short (16bit signed) with mask 0xFF into a Long Register
+ instruct loadS2L_immI_255(iRegL dst, indOffset13m7 mem, immI_255 mask) %{
+ match(Set dst (ConvI2L (AndI (LoadS mem) mask)));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+ format %{ "LDUB $mem+1,$dst\t! short & 0xFF -> long" %}
+ ins_encode %{
+ __ ldub($mem$$Address, $dst$$Register, 1); // LSB is index+1 on BE
+ %}
+ ins_pipe(iload_mem);
+ %}
+
+ // Load Short (16bit signed) with a 13-bit mask into a Long Register
+ instruct loadS2L_immI13(iRegL dst, memory mem, immI13 mask) %{
+ match(Set dst (ConvI2L (AndI (LoadS mem) mask)));
+ ins_cost(MEMORY_REF_COST + DEFAULT_COST);
+
+ size(2*4);
+ format %{ "LDUH $mem,$dst\t! short & 13-bit mask -> long\n\t"
+ "AND $dst,$mask,$dst" %}
+ ins_encode %{
+ Register Rdst = $dst$$Register;
+ __ lduh($mem$$Address, Rdst);
+ __ and3(Rdst, $mask$$constant, Rdst);
+ %}
+ ins_pipe(iload_mem);
+ %}
+
// Load Unsigned Short/Char (16bit UNsigned)
instruct loadUS(iRegI dst, memory mem) %{
match(Set dst (LoadUS mem));
ins_cost(MEMORY_REF_COST);
*** 5663,5672 ****
--- 5707,5730 ----
__ lduh($mem$$Address, $dst$$Register);
%}
ins_pipe(iload_mem);
%}
+ // Load Unsigned Short/Char (16 bit UNsigned) shifting left & right by 16-bit
+ instruct loadUS_shiftLR_16(iRegI dst, memory mem, immI_16 sixteen)
+ %{
+ match(Set dst (RShiftI (LShiftI (LoadUS mem) sixteen) sixteen));
+ ins_cost(MEMORY_REF_COST);
+
+ size(4);
+ format %{ "LDSH $mem,$dst\t! (ushort/char << 16) >> 16" %}
+ ins_encode %{
+ __ ldsh($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);
src/cpu/sparc/vm/sparc.ad
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File