[M3devel] hand.c/set_singleton?

Tony Hosking hosking at cs.purdue.edu
Wed Feb 24 04:33:54 CET 2010


We don't want this in m3front.

On 23 Feb 2010, at 18:14, Jay K wrote:

> I think hand.c is worth shrinking.
>   And converting where easy to Modula-3.
> Agreed?
> It is "exercise" at least -- learn and get comfortable making changes, as long as they don't make anything worse.
>  
>  
> With that in mind, any hints on this:
>  
>  
> void set_singleton(size_t a, size_t* s)
> {
>   size_t a_word = a / SET_GRAIN;
>   size_t a_bit  = a % SET_GRAIN;
>   s[a_word] |= (1UL << a_bit);
> }
> 
>  
> Leave it alone? It works, not worth changing?
> Deal with it in m3front?
> In parse.c?
>  
>  
> I changed m3back to generate a bts instruction, which achieves "all four" operations in one instruction -- div (shift), mod (and), shift, or. The semantic mapping seems to be 100%. If set_singleton were a common operation, which I doubt, it seems like a major gain.
>  
>  
>  - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100223/7c4c7bd0/attachment-0002.html>


More information about the M3devel mailing list