|
#11
|
||||
|
||||
![]()
Been trying to get z64gl w/ GLEW32 dev building on GNU GCC and having issues with all the libraries. Took a break from that and overlooked some legacy statements in the current plugin.. seems there is a more direct approach to decode sign-extended immediate offsets for the transactions between data memory and the vector register file.
The old method (not current, but used in most applications) was the if-else scan: Code:
offset = inst & 0x0000FFFF; if (offset & 0x0040) offset |= ~0x007F; -0x0040 = ~0x0040 + 1 = 0xFFBF + 1 = 0xFFC0, it would be much faster to say: Code:
offset = inst & 0x0000FFFF; offset |= -(inst &= 0x0040); Code:
offset = inst & 0x0000FFFF; offset |= -1 * !!(inst &= 0x0040); /* ((inst &= 0x0040) != 0x0000 */ ![]()
__________________
http://theoatmeal.com/comics/cat_vs_internet Last edited by HatCat; 18th April 2013 at 11:02 PM. |