Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [omr-dev] Does a constant value need a Load instruction?

On 11 June 2018 at 15:15, Mark Stoodley <mstoodle@xxxxxxxxxx> wrote:
>> Suppose I am generating IL for something simple such as:
>>
>> return 42
>>
>> Here 42 is an integer constant - does this need to be Loaded when
>> supplying as an argument to return?
>
> You need to generate some kind of const node (bconst 42, sconst 42, iconst
> 42, lconst 42, fconst 42.0 dconst 42.0) and then feed that to a consistently
> typed return node :
>         breturn
>            bconst 42
>
> or, for floating point values, ...
>         freturn
>            fconst 42.0
>
> or
>         ...

Okay thank you.

Regards
Dibyendu


Back to the top