D - XOR Bit Array
- resistor mac.com (9/9) Sep 16 2003 Hey folks!
- John Boucher (4/13) Sep 16 2003 Uhhh... Use != to xor bits, and use a for statement to walk the array?
- resistor mac.com (5/23) Sep 16 2003 Is it not possible to use an array operator to do all of them at once? ...
- Sean L. Palmer (13/39) Sep 17 2003 Any
- Charles Sanders (9/50) Sep 17 2003 Isnt there some special CPU instruction set that ill apply an operation ...
- Sean L. Palmer (13/28) Sep 19 2003 There certainly is. It is usually a bit more limited than the normal
Hey folks! I have a question about something i'm trying to write in D. I have two arrays of 144 bits, and I need to XOR them, and store the result in yet a third array of 144 bits. Any suggestions on how to do this? Do the bit arrays need to be dynamic or static? I'm just a tad confused! Thanks, Owen Anderson
Sep 16 2003
In article <bk7u0c$1tb9$1 digitaldaemon.com>, resistor mac.com says...Hey folks! I have a question about something i'm trying to write in D. I have two arrays of 144 bits, and I need to XOR them, and store the result in yet a third array of 144 bits. Any suggestions on how to do this? Do the bit arrays need to be dynamic or static? I'm just a tad confused! Thanks, Owen AndersonUhhh... Use != to xor bits, and use a for statement to walk the array? John Boucher The King had Humpty pushed
Sep 16 2003
In article <bk7vhl$23mn$1 digitaldaemon.com>, John Boucher says...In article <bk7u0c$1tb9$1 digitaldaemon.com>, resistor mac.com says...Is it not possible to use an array operator to do all of them at once? And also, isn't ^ the XOR operator? That's what the documentation says, but I suppose it could be wrong. Owen AndersonHey folks! I have a question about something i'm trying to write in D. I have two arrays of 144 bits, and I need to XOR them, and store the result in yet a third array of 144 bits. Any suggestions on how to do this? Do the bit arrays need to be dynamic or static? I'm just a tad confused! Thanks, Owen AndersonUhhh... Use != to xor bits, and use a for statement to walk the array? John Boucher The King had Humpty pushed
Sep 16 2003
<resistor mac.com> wrote in message news:bk81nb$2bh3$1 digitaldaemon.com...In article <bk7vhl$23mn$1 digitaldaemon.com>, John Boucher says...arraysIn article <bk7u0c$1tb9$1 digitaldaemon.com>, resistor mac.com says...Hey folks! I have a question about something i'm trying to write in D. I have twoAnyof 144 bits, and I need to XOR them, and store the result in yet a third array of 144 bits.tadsuggestions on how to do this? Do the bit arrays need to be dynamic or static? I'm just aAndIs it not possible to use an array operator to do all of them at once?confused! Thanks, Owen AndersonUhhh... Use != to xor bits, and use a for statement to walk the array? John Boucher The King had Humpty pushedalso, isn't ^ the XOR operator? That's what the documentation says, but I suppose it could bewrong.Owen AndersonThere was a plan once upon a time to implement operations on entire arrays at once, and if that ever gets implemented you'll be able to do something like this: bit[144] a, b, c; a[] = b[] ^ c[]; // could use != instead of ^... ^ returns each bit, != only returns one bit and only acts like an xor if used on single bits Sean
Sep 17 2003
Isnt there some special CPU instruction set that ill apply an operation to an array or matrix or something, vectorizing compilers or something like that ? Charles "Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bka32e$2km1$1 digitaldaemon.com...<resistor mac.com> wrote in messagenews:bk81nb$2bh3$1 digitaldaemon.com...twoIn article <bk7vhl$23mn$1 digitaldaemon.com>, John Boucher says...In article <bk7u0c$1tb9$1 digitaldaemon.com>, resistor mac.com says...Hey folks! I have a question about something i'm trying to write in D. I havearraysbits.of 144 bits, and I need to XOR them, and store the result in yet a third array of 144Anytadsuggestions on how to do this? Do the bit arrays need to be dynamic or static? I'm just aAndIs it not possible to use an array operator to do all of them at once?confused! Thanks, Owen AndersonUhhh... Use != to xor bits, and use a for statement to walk the array? John Boucher The King had Humpty pushedalso, isn't ^ the XOR operator? That's what the documentation says, but I suppose it could bewrong.Owen AndersonThere was a plan once upon a time to implement operations on entire arrays at once, and if that ever gets implemented you'll be able to do something like this: bit[144] a, b, c; a[] = b[] ^ c[]; // could use != instead of ^... ^ returns each bit, != only returns one bit and only acts like an xor if used on single bits Sean
Sep 17 2003
There certainly is. It is usually a bit more limited than the normal instruction set but enough to get most jobs done, with a quickness. ;) My coworker just wrote a function for PS2 that processes 16 triangle bounding boxes at the same time, using a few min/max/compare instructions. It would be nice if in D you could express this as simply as: typedef byte[16] b16; extern b16 a,b,c; b16 res = a[] + b[] < c[] && a[] - b[] > c[]; Sean "Charles Sanders" <sanders-consulting comcast.net> wrote in message news:bkaj99$aq1$1 digitaldaemon.com...Isnt there some special CPU instruction set that ill apply an operation to an array or matrix or something, vectorizing compilers or something like that ? Charles "Sean L. Palmer" <palmer.sean verizon.net> wrote in message news:bka32e$2km1$1 digitaldaemon.com...arraysThere was a plan once upon a time to implement operations on entiresomethingat once, and if that ever gets implemented you'll be able to dolike this: bit[144] a, b, c; a[] = b[] ^ c[]; // could use != instead of ^... ^ returns each bit, != only returns one bit and only acts like an xor if used on single bits Sean
Sep 19 2003