Request for review (L): 6797305: Add LoadUB and LoadUI opcode class
Vladimir Kozlov
Vladimir.Kozlov at Sun.COM
Thu Feb 26 10:30:54 PST 2009
Looks good.
I did not look on .ad files since you will rewrite them as Tom suggested.
But the rest of changes are good.
Thanks,
Vladimir
Christian Thalinger wrote:
> On Thu, 2009-02-26 at 09:02 -0800, Tom Rodriguez wrote:
>> 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.
>
> Much better :-) I'll change that.
>
>> As far as sparc goes I wouldn't mind if they were changed to use the
>> MacroAssembler too.
>
> Well, I could change that, at least for the loads.
>
>> 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.
>
> Yeah, that would be nice too.
>
> -- Christian
>
More information about the hotspot-compiler-dev
mailing list