From: f0dder on
Jim Carlock wrote:


*snip*

The OR method is somewhat cute, but won't it have a zillion mispredicted
performance killing branches? :)


From: Jamie on
Skybuck wrote:
>>you guys are nuts, i've coding Assembler with various processors over the
>>years and all i had to worry about was byte order!, (big endian/little
>>endian).
>> the only time bit ordering had to be worked with is when you may
>>receive data from some sort of serial device or encryption code to get
>>it in the correct
>>order. this has nothing to do with the platform your on...
>>
>> i have copied over piles of source code that was originated on Big
>>Endian platforms over to little Endian that contain all kinds of bit
>>operations etc.. never had a problem and never had to change anything
>>other than byte order coding ..
>
>
> Ok I just can't resist to make a nasty joke, here it comes, brace
> yourself lol:
>
> "I am glad I never hired Jamie to code my airoplanes :P ;)"
>
> Bye,
> Skybuck.
>
i wouldn't worry about that, at this point you wouldn't be
able to start a business let alone hold one.
go back to your books. i think you missed a chapter.




--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

From: Jim Carlock on
Jim Carlock wrote:
> *snip*

"f0dder" <f0dder.nospam(a)flork.dk.invalid> wrote:
> The OR method is somewhat cute, but won't it have a zillion
> mispredicted performance killing branches? :)

OR 0000 0000, 0000 0001 => 0000 0001 => 1
OR 0000 0000, 0000 0010 => 0000 0010 => 2
OR 0000 0000, 0000 0100 => 0000 0100 => 4
OR 0000 0000, 0000 1000 => 0000 1000 => 8
OR 0000 0000, 0001 0000 => 0001 0000 => 16
OR 0000 0000, 0010 0000 => 0010 0000 => 32
OR 0000 0000, 0100 0000 => 0100 0000 => 64
OR 0000 0000, 1000 0000 => 1000 0000 => 128

Performance killing branches? I'm not sure I follow where you
want to go. If the register starts out as zero, it remains zero until
something sets a bit, right? And then ORing it (an inclusive OR),
sets the appropriate bit. All I did was change the BTS to OR
(and changed the from setting a specific bit to ORing that bit, at
least that's what I think I did as far as the first item posted goes).
What am I missing out on?

The second algorithm I posted holds some flaws in it. With some
reconfiguration it might become workable. I count three flaws in
it.

Thanks.

--
Jim Carlock


From: Evenbit on

Jim Carlock wrote:
> Jim Carlock wrote:
> > *snip*
>
> "f0dder" <f0dder.nospam(a)flork.dk.invalid> wrote:
> > The OR method is somewhat cute, but won't it have a zillion
> > mispredicted performance killing branches? :)
>
> OR 0000 0000, 0000 0001 => 0000 0001 => 1
> OR 0000 0000, 0000 0010 => 0000 0010 => 2
> OR 0000 0000, 0000 0100 => 0000 0100 => 4
> OR 0000 0000, 0000 1000 => 0000 1000 => 8
> OR 0000 0000, 0001 0000 => 0001 0000 => 16
> OR 0000 0000, 0010 0000 => 0010 0000 => 32
> OR 0000 0000, 0100 0000 => 0100 0000 => 64
> OR 0000 0000, 1000 0000 => 1000 0000 => 128
>
> Performance killing branches? I'm not sure I follow where you
> want to go. If the register starts out as zero, it remains zero until
> something sets a bit, right? And then ORing it (an inclusive OR),
> sets the appropriate bit. All I did was change the BTS to OR
> (and changed the from setting a specific bit to ORing that bit, at
> least that's what I think I did as far as the first item posted goes).
> What am I missing out on?
>
> The second algorithm I posted holds some flaws in it. With some
> reconfiguration it might become workable. I count three flaws in
> it.
>

If you are going to be using BT, then don't use that Carry Flag to
determine your route through the conditional jumps. CF is going to
vary wildly, but we can find other ways to put it to use:

program rev;
#include("stdlib.hhf")
?@nodisplay := true;
?@noalignstack := true;

static

unknown :byte := 42;
align(4);
stack :byte[8];

begin rev;

mov( unknown, al );
mov( 0, ecx );
mov( ecx, ebx );
lea( edi, stack );
call fillstack;
stdout.newln();
call showstack;
stdout.newln();
jmp _exit;

fillstack:
bt( cx, ax );
adc( 0, bl );
mov( bl, [edi+ecx] );
stdout.putu8( bl );
mov( 0, bl );
inc( cl );
cmp( cl, 8 );
je fsout;
call fillstack;
fsout:
ret();

showstack:
dec( cl );
mov( [edi+ecx], bl );
stdout.putu8( bl );
or( 0, cl );
jz ssout;
call showstack;
ssout:
ret();

_exit:

end rev;

Nathan.

From: Dunny on
In news:wRMHg.725$Gb2.526(a)newsfe03.lga,
Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_(a)charter.net> typed:

> Skybuck wrote:

>> "I am glad I never hired Jamie to code my airoplanes :P ;)"

> i wouldn't worry about that, at this point you wouldn't be
> able to start a business let alone hold one.
> go back to your books. i think you missed a chapter.

Well, I would say that we're all very glad that Skybuck doesn't write
dictionaries :-)

D.


First  |  Prev  |  Next  |  Last
Pages: 6 7 8 9 10 11 12 13 14 15 16 17 18
Prev: Apple II Debugger
Next: TMA Assembler?