Initial SPARC compilation test
Thomas Wuerthinger
thomas.wuerthinger at oracle.com
Tue May 28 13:28:03 PDT 2013
In general, I like the idea of representing the instructions using a Java class hierarchy. What about using a pattern like new InstructionXY(…).emit(…) to avoid the side-effecting constructor?
- thomas
On May 28, 2013, at 8:59 PM, Doug Simon <doug.simon at oracle.com> wrote:
>
> On May 28, 2013, at 7:48 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
>>
>> On May 25, 2013, at 2:07 PM, Doug Simon <doug.simon at oracle.com> wrote:
>>
>>> Hi Morris,
>>>
>>> On May 25, 2013, at 3:57 PM, Morris Meyer <morris.meyer at oracle.com> wrote:
>>>
>>>> Christian suggested that we use Fmt superclasses to contain the various SPARC instruction modes. I think his preference would be to generate the assembler w annotations but this is as far as we pushed it.
>>
>> Yes, this is my fault. Don't blame Morris :-)
>
> Blame? I had no intention of assigning blame ;-) Just trying to understand the advantage(s) of doing it this way.
>
>>> As part of the Maxine project, we had a system for generating assemblers[1] (with which we generated assemblers for SPARC and x64). This system also allowed for easy construction of disassemblers. There might something there worth leveraging if we want to pursue the generated assembler idea further. I know Christian is already aware of this work - I'm just bringing it up in case others aren't.
>>
>> Right. Remind me, why was it not used in the end?
>
> Because the port of C1 into C1X was intended to be as disconnected from existing Maxine technology as possible (to demonstrate the runtime/compiled interface designed as part of the porting process). Had we not moved onto Graal, there were thoughts of having the hand assembler in C1X be generated by the framework.
>
>>>> I started w static methods like the PTX and AMD64 assemblers but this pattern is sort of growing on me as makes asserting things easier.
>>>
>>> The assertions I see in SPARCAssembler could just as easily be placed in helper methods as opposed to super class constructors right?
>>
>> It could. It seems like a good idea to use the Java class hierarchy to represent the instruction classes of an ISA but if it causes too much trouble then we can drop it.
>
> I have no strong preference. I was just looking for the technical advantage of modeling the instructions with classes that motivated the use of side-effecting constructors.
>
> In any case, it's great to see a second backend being added to Graal.
>
> -Doug
>
>>
>> -- Chris
>>
>>>
>>>> The warning is handled in the lir.sparc package with a JDT prefs change.
>>>
>>> Unfortunately this doesn't help anyone using mx to create the Eclipse project configurations. The next time anyone runs 'mx eclipseinit' (which most of us do after a pull when we new projects added), your changes to graal/com.oracle.graal.lir.sparc/.settings/org.eclipse.jdt.core.prefs will be overwritten.
>>>
>>> For now, could you please add @SuppressWarnings("unused") where necessary and hg delete graal/com.oracle.graal.lir.sparc/.settings/org.eclipse.jdt.core.prefs. At the same time, we should consider whether to disable the unusedObjectAllocation check globally. As of now, we use the same Eclipse settings for all projects and I'm not sure this current case is a strong enough reason to deviate from that policy. Especially since it's not yet clear (to me at least) why the pattern of separate
>>>
>>> -Doug
>>>
>>> [1] https://wikis.oracle.com/display/MaxineVM/Assembler
>>>
>>>>
>>>> --mm
>>>>
>>>>
>>>> On May 25, 2013, at 5:54 AM, Doug Simon <doug.simon at oracle.com> wrote:
>>>>
>>>>> Hi Morris, Christian,
>>>>>
>>>>> Why is the SPARC assembler constructed as a set of classes, one for each instruction as opposed to a single assembler class with a bunch of methods (like AMD64Assembler)? I trust that escape analysis does the right thing so there's no overhead for the object construction but I don't see any real advantages to doing it this way. It's strange to have a constructor with a side effect. And of course, it means we need to suppress the Eclipse warnings somehow.
>>>>>
>>>>> -Doug
>>>>>
>>>>> On May 25, 2013, at 5:24 AM, Morris Meyer <morris.meyer at oracle.com> wrote:
>>>>>
>>>>>> I just pushed the initial SPARC compilation test for Graal.
>>>>>>
>>>>>> ./mx.sh --vm server unittest BasicSPARCTest
>>>>>>
>>>>>> will get you started.
>>>>>>
>>>>>> --mm
>>>>>
>>>
>>
>
More information about the graal-dev
mailing list