Just to see, I just dug into how <font face="courier new, monospace">##u8vector-ref</font> works, and what I got is that in code with or without 
<span style="font-family:'courier new',monospace">(declare (standard-bindings) (extended-bindings))</span> ,  <span style="font-family:'courier new',monospace">##u8vector-ref</span> and also 
<span style="font-family:'courier new',monospace">##fxnum+</span>  are not inlined in the output code.<div><br></div><div>Is this correct Marc?<br><div><br></div><div><div>(I suppose I did not get this right, bc Gambit's performance goals are to keep those kind of as fast as in C, and for that inlining is required?)</div>

<div><br></div><div><br></div><div>Also I checked what assembly is actually generated from resolving the memory address of a u8vector ___SCMOBJ in the C world, and it's only two assembly operations, neat!</div><div><br>

</div><div>(an AND -4 and an ADD 4 to the register with the ___SCMOBJ value in it, to get the contained pointer value)<br><div><div><br></div><div>Mikael<br><br><div class="gmail_quote">2012/8/9 Mikael More <span dir="ltr"><<a href="mailto:mikael.more@gmail.com" target="_blank">mikael.more@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah, I just realized:<div><br></div><div>In order for <span style="color:rgb(34,34,34);font-size:13px;font-family:'courier new',monospace">##sysmem-byteref</span><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"> </span> and  <span style="color:rgb(34,34,34);font-size:13px;font-family:'courier new',monospace">##sysmem-byte-set!</span>  to be implementable as single CPU instruction operations, the pointer argument must be required to be fixnum only.<div>


<br></div><div>This is really fine.<div><div><br><div class="gmail_quote"><div class="im">2012/8/9 Alex Queiroz <span dir="ltr"><<a href="mailto:asandroq@gmail.com" target="_blank">asandroq@gmail.com</a>></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


This is not really Scheme, it is C, which can be done via a very short<br>
C extension.<br></blockquote><div><br></div></div><div>Well, it can certainly be Scheme if you want it to be Scheme, and I'm at a point where I really want this to be Scheme.</div><div><br></div><div>I don't want it to be a C extension, at least not in the ordinary sense where there's some kind of FFI barrier between the Scheme and C code, that at least makes a C function call out of the operation and thus adds a <font face="courier new, monospace">CALL addr</font> and a <font face="courier new, monospace">RET</font> (= 2 ops!) to the <font face="courier new, monospace">MOV sth,[sth]</font> op. Also, I'd happy that the compiler would inline this when in compiled mode by itself, just like it does with <font face="courier new, monospace">##u8vector-ref/set!</font>.</div>


<div><br></div><div>I.e., I just want direct, unprotected access straight to the RAM at the CPU's ordinary speed for it.</div><div><br></div></div></div></div></div></div>
</blockquote></div><br></div></div></div></div></div>