On 03/10/2011 11:01 PM, bearophile wrote:
While creating the rotation code I have found two things I don't understand.
Maybe some of you is able to help me understand.
This version of the code:
union Four {
uint u;
ubyte[4] a;
}
void main() {
Four f;
asm {
rol f.u
While creating the rotation code I have found two things I don't understand.
Maybe some of you is able to help me understand.
This version of the code:
union Four {
uint u;
ubyte[4] a;
}
void main() {
Four f;
asm {
rol f.u, 8;
}
}
DMD 2.052 gives this error, do you
On Wed, Mar 9, 2011 at 7:25 PM, U2 fan wrote:
> == Quote from bearophile (bearophileh...@lycos.com)'s article
>> Tom:
>> > What is the most efficient way of implement a rotation of ubyte[4] array?
>> >
>> > By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
>> Two versions, I have done
== Quote from bearophile (bearophileh...@lycos.com)'s article
> Tom:
> > What is the most efficient way of implement a rotation of ubyte[4] array?
> >
> > By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
> Two versions, I have done no benchmarks so far:
> import std.c.stdio: printf;
>
On 03/10/2011 12:55 AM, Jonathan M Davis wrote:
I don't know of anything more efficient than:
>ubyte[4] bytes = [1,2,3,4];
>bytes = bytes[$-1] ~ bytes[0..$-1]; // Rotate left
I'm stunned that this works. I'd even consider reporting it as a bug. You're
concatenating a ubyte[] ont
On 03/09/2011 04:25 PM, bearophile wrote:
Tom:
What is the most efficient way of implement a rotation of ubyte[4] array?
By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
Two versions, I have done no benchmarks so far:
import std.c.stdio: printf;
union Four {
ubyte[4] a;
On Wednesday, March 09, 2011 15:35:29 Kai Meyer wrote:
> On 03/09/2011 03:41 PM, Tom wrote:
> > What is the most efficient way of implement a rotation of ubyte[4] array?
> >
> > By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
> >
> > TIA,
> > Tom;
>
> I don't know of anything more
El 09/03/2011 20:25, bearophile escribió:
Tom:
What is the most efficient way of implement a rotation of ubyte[4] array?
By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
Two versions, I have done no benchmarks so far:
import std.c.stdio: printf;
union Four {
ubyte[4] a;
On 03/09/2011 03:41 PM, Tom wrote:
What is the most efficient way of implement a rotation of ubyte[4] array?
By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
TIA,
Tom;
I don't know of anything more efficient than:
ubyte[4] bytes = [1,2,3,4];
bytes = bytes[$-1] ~ bytes[0..
Tom:
> What is the most efficient way of implement a rotation of ubyte[4] array?
>
> By rotation I mean: rotateRight([1, 2, 3, 4]) -> [4, 1, 2, 3]
Two versions, I have done no benchmarks so far:
import std.c.stdio: printf;
union Four {
ubyte[4] a;
uint u;
}
void showFour(Four f) {
10 matches
Mail list logo