in reply to Re: Newbie question
in thread Newbie question
As far as speed with Perl, I am betting that abs() is really fast - this is not a complex operation for a 2's complement number. Don't know that Perl would be "smart" enough to do this asm code, but this is very fast because no branches to stall the instruction pipe.
; abs(eax), with no branches. ; intel syntax (dest, src) mov ebx, eax ; save copy of eax neg eax cmovl eax, ebx ; if eax is now negative, restore its saved value
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Newbie question
by NERDVANA (Priest) on Aug 23, 2022 at 19:57 UTC | |
|
Re^3: Newbie question
by oldB51 (Sexton) on Aug 23, 2022 at 12:58 UTC | |
|
Re^3: Newbie question
by Anonymous Monk on Aug 23, 2022 at 12:46 UTC | |
by Marshall (Canon) on Aug 23, 2022 at 15:48 UTC |