<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 1 April 2014 18:33, dajones <span dir="ltr"><<a href="mailto:dajones@hotmail.com" target="_blank">dajones@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
"Manu" <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote in message<br>
news:mailman.122.1396231817.25518.digitalmars-d@puremagic.com...<br>
<div class="">> On 30 March 2014 13:39, Walter Bright <<a href="mailto:newshound2@digitalmars.com">newshound2@digitalmars.com</a>> wrote:<br>
>>><br>
</div><div class="">>>> Two pointers structs are passed in register, which is fast. If that<br>
>>> spill, that<br>
>>> spill on stack, which is hot, and prefetcher friendly.<br>
>>><br>
>><br>
>> That underestimates how precious register real estate is on the x86.<br>
><br>
><br>
</div><div class="">> This is only a concern when passing args. x86 has huge internal register<br>
> files and uses aggressive register renaming,<br>
<br>
</div>If we could use them that would be great but we cant. We have to store/load<br>
to memory, and that means aprox 3 cycle latency each way. The cpu cant guess<br>
that we're only saving it for later, it has to do the memory write, and even<br>
with the store to load forwarding mechanism, spilling and reloading is<br>
expensive.<br></blockquote><div><br></div><div>Can you detail this more?</div><div><br></div><div><div>Obviously it must perform the store to maintain memory coherency, but I was under the impression that the typical implementation would also keep the value around in a renamed register, and when it pops up again at a later time, it would use the register directly, rather than load from memory.<br>
</div><div>The store shouldn't take any significant time since there's no dependency on the stored value, it should only take as long as issuing the store instruction; latency is irrelevant, since it's never read back, there's nothing waiting on it.</div>
</div><div>Not sure what you mean by 'each way', since stored values shouldn't be read back if gets the value from a stashed register.</div><div><br></div><div>I'm not an expert on the topic, but I read about it some years back, and haven't given it much thought since.</div>
</div></div></div>