On 11/12/2013 08:33 AM, Martin Schreiber wrote:
>
> The C-like syntax
> "
>   FIELDNAME ':' FIELDTYPE [':' BITSIZE] ';'
> "
> is accepted?
Seems useful and nicely readable for me (of course I do have a strong C 
background).
> Is a record with BITSIZE automatically bitpacked?
I gather this does make sense.


> Defining of little/big-endian could be useful too.
>

The position of the bits needs to be documented. With "low endian" archs 
c starts with the lowest order bits. This seems to make sense for 
mseLang, as well, even though when transporting data (e.g. via TCP/IP") 
the usual definition is "high endian" (aka high Byte first, high bit 
first). I did get burned on than behalf several times.

For this an alternate "high endian bit packed" keyword might come handy.

Moreover:

If it's really bit packed you might get numerical values that require 
rather complex handling by the compiler:

record tr
   x1: int64: 2;
   x2: int64: 63;
end

var t1, t2: tr

   t1 := t1.x2 + t2.x2;

A 32 bit compiler would need to load 64 bit values that cover three 32 
words, shift them into a double register and mask out the upper bit 
before doing the add. Then it needs to shift, mask and "or" the stuff 
for storing.

Nice :-)

-Michael




------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to