Question: "backwards" adressing
Ulf Zibis
Ulf.Zibis at gmx.de
Mon Aug 24 08:37:20 PDT 2009
Am 24.08.2009 16:43, Christian Thalinger schrieb:
> Ulf Zibis wrote:
>
>> Thanks for clarifying.
>> ... But isn't using the index register faster, than 2 times
>> load-with-offset ?
>>
>> forwards:
>> accumlator = pop // codePoint
>> index register = pop // dst
>> index register += pop // index
>> save highSurrogate(accumulator) (ix++)
>> save lowSurrogate(accumulator) (ix)
>>
>> backwards:
>> accumlator = pop // codePoint
>> index register = pop // dst
>> index register += pop // index
>> push index register // dst + index
>> save lowSurrogate(accumulator) (++ix)
>> index register = pop // dst + index
>> save highSurrogate(accumulator) (ix)
>>
>
> We are talking here about a register machine here, not a stack machine.
> The generated code is more like:
>
> move lowSurrogate(accumulator),[base+index + 0]
> move highSurrogate(accumulator),[base+index + 1]
>
> And you can exchange the two stores as you like.
>
> -- Christian
>
>
Hm, I'm wondering, that CPU move instruction can determine target
address from 3 operands at same time.
Anyway, the base+index part must be calculated 2 times here, where 2nd
seems redundant to me.
> a register machine here, not a stack machine
I'm too wondering, how method parameters were passed by register,
especially if they were more.
-Ulf
More information about the hotspot-compiler-dev
mailing list