

Yikes.
I've tried all manner of things to correct the syntax or find a workaround, but
I can't even get the parser to recognize the expressions
#declare F1 = function {bitwise_and (x, y, z)}
#declare F2 = function {bitwise_or (x, y, z)}
#declare F3 = function {bitwise_xor (x, y, z)}
SO, I'm thinking that the problem is that somehow those builtin function
identifiers never got put in a list to get passed to the (separate) function
parser. Oof.
Which means that until that gets fixed, you're going to have to roll your own
userdefined functions in SDL. :( I recall doing this somewhere, when I didn't
know that our bitwise operators were spelledout function identifiers and not
the usual symbols.
I can go hunt that down if you need me to...
https://stackoverflow.com/questions/7199625/mathematicalequationforandbitwiseoperation
(a & b)
can be done with:
(((a/1 % 2) * (b/1 % 2)) * 1) +
(((a/2 % 2) * (b/2 % 2)) * 2) +
(((a/4 % 2) * (b/4 % 2)) * 4) +
....
(((a/n % 2) * (b/n % 2)) * n)
Where n is 2 to the number of bits that A and B are composed minus one. This
assumes integer division (remainder is discarded).
Post a reply to this message

