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?

Hi Dibyendu,

> 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
        ...

Mark Stoodley 8200 Warden Avenue
Senior Software Developer Markham, L6G 1C7
IBM Runtime Technologies Canada
Phone:+1-905-413-5831 
e-mail:mstoodle@xxxxxxxxxx 

We cannot solve our problems with the same thinking we used when we created them - Albert Einstein
 
 



Back to the top