[M3devel] bit field operations for insert/extract

Jay K jay.krell at cornell.edu
Tue Nov 23 09:33:00 CET 2010


Tony, I'm going to try again to use bitfield operations for extract_mn.
And insert_mn.
I think I know what went wrong before for extract_mn: just remove the endian check in m3front.
But I'm going to be sure test p240 covers it well.

The easy part, duh, your original extract_mn was correct I think, just, again, missing the m3front change.

Insert_mn is less obvious.
I started writing it... bitfield_ref..modify_expr...uh, seems suspicious, to be modifying an existing value.

I guess it's more like, that, but with a temp that starts with the full value of x:
 create temp
 modify(temp, x)
 modify(bitfield_ref(temp, count, offset), y);
 m3_load(temp) 

?

I'll try something like that.
It seems unfortunate.
Maybe we can know if x is already a value and not a variable?


 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101123/159ee83a/attachment-0001.html>


More information about the M3devel mailing list