Request for review (L): 6797305: Add LoadUB and LoadUI opcode class

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Thu Feb 26 09:02:10 PST 2009


I haven't looked through all your changes yet but instead of using  
enc_class you can directly embed the encoding in the instruction like  
this:

+// Load Short (16bit signed)
+instruct loadS(eRegI dst, memory mem) %{
+  match(Set dst (LoadS mem));
+
+  ins_cost(125);
+  format %{ "MOVSX  $dst,$mem\t# short" %}
+
+  ins_encode %{
+    Address  Amem = Address::make_raw($mem$$base, $mem$$index, $mem$ 
$scale, $mem$$disp);
+    Register Rdst = as_Register($dst$$reg);
+
+    __ movswl(Rdst, Amem);
+  %}
+  ins_pipe(ialu_reg_mem);
+%}

This style automatically creates a MacroAssembler for you so you can  
just use __ directly.  You can also say $dst$$Register instead of  
as_Register($dst$$reg).  I have some changes somewhere that adds  
support for $mem$$Address which would make it possible to simply have:

inc_encode %{
   __ movswl($dst$$Register, $mem$$Address)
%}

I think this style is a lot more readable than the enc_class stuff.

As far as sparc goes I wouldn't mind if they were changed to use the  
MacroAssembler too.  Someday we'd like to convert all the inc_encodes  
to use MacroAssembler.  If we were really slick we could derive the  
format from the ins_encode block too but that's for another day.

tom

On Feb 26, 2009, at 8:41 AM, Christian Thalinger wrote:

> http://cr.openjdk.java.net/~twisti/6797305/webrev.00/
>
> Here is the (almost) final version of my unsigned load changes.  I  
> added
> enc_class functions for all load instructions on x86_32 and x86_64.
> Should I do the same for sparc too?
>
> -- Christian
>




More information about the hotspot-compiler-dev mailing list