1. Rob: Feature request for next release
- Posted by Vincent <darkvincentdude at yahoo.com>
Oct 16, 2005
-
Last edited Oct 17, 2005
Rob, can we have some basic bit shifting routines for the next release:
shift_left() and shift_right()? It doesnt matter to me if they are implemented
internally, machine_proc/func(), or routines in "misc.e"... anything would do;
they are neccessary.
Regards,
Vincent
----------------------------------------------
___ __________ ___
/__/\ /__________\ |\ _\
\::\'\ //::::::::::\\ |'|::|
\::\'\ //:::_::::_:::\\ |'|::|
\::\'\ //::/ |::| \::\\ |'|::|
\::\'\ //::/ |::| \::\\|'|::|
\::\'\__//::/ |::| \::\|'|::|
\::\','/::/ |::| \::\\|::|
\::\_/::/ |::| \::\|::|
\::,::/ |::| \:::::|
\___/ |__| \____|
.``.
',,'
2. Re: Rob: Feature request for next release
- Posted by codepilot Gmail Account <codepilot at gmail.com>
Oct 16, 2005
-
Last edited Oct 17, 2005
And maybe log2
built in
FYL2X ; D9 F1 [8086,FPU]
Dan
On 10/16/05, Vincent <guest at rapideuphoria.com> wrote:
>
>
> posted by: Vincent <darkvincentdude at yahoo.com>
>
> Rob, can we have some basic bit shifting routines for the next release: s=
hift_left() and shift_right()? It doesnt matter to me if they are implement=
ed internally, machine_proc/func(), or routines in "misc.e"... anything wou=
ld do; they are neccessary.
>
>
> Regards,
> Vincent
>
> ----------------------------------------------
> ___ __________ ___
> /__/\ /__________\ |\ _\
> \::\'\ //::::::::::\\ |'|::|
> \::\'\ //:::_::::_:::\\ |'|::|
> \::\'\ //::/ |::| \::\\ |'|::|
> \::\'\ //::/ |::| \::\\|'|::|
> \::\'\__//::/ |::| \::\|'|::|
> \::\','/::/ |::| \::\\|::|
> \::\_/::/ |::| \::\|::|
> \::,::/ |::| \:::::|
> \___/ |__| \____|
>
> .``.
> ',,'
>
>
>
>
3. Re: Rob: Feature request for next release
Vincent wrote:
>
> Rob, can we have some basic bit shifting routines for the next release:
> shift_left()
> and shift_right()? It doesnt matter to me if they are implemented internally,
> machine_proc/func(), or routines in "misc.e"... anything would do; they are
> neccessary.
>
>
> Regards,
> Vincent
>
> ----------------------------------------------
>
> .``.
> ',,'
>
>
Vincent:
shifting is already available in Euphoria by
multiplying and dividing by 2.
check the library doc.
see power function
Bernie
My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw
Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
4. Re: Rob: Feature request for next release
Subject: Re: Rob: Feature request for next release
Vincent wrote:
>
> Rob, can we have some basic bit shifting routines for the next release:
shift_left()
> and shift_right()? It doesnt matter to me if they are implemented
internally,
> machine_proc/func(), or routines in "misc.e"... anything would do; they
are
> neccessary.
>
>
> Regards,
> Vincent
>
> ----------------------------------------------
>
> .``.
> ',,'
>
>
Vincent:
shifting is already available in Euphoria by
multiplying and dividing by 2.
check the library doc.
see power function
Bernie
My files in archive:
w32engin.ew mixedlib.e eu_engin.e win32eru.exw
Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on
&keywords=bernie+ryan
------------------------------
I'd rather push for rotate() functions that would work on any 32-bit
integers.
Btw, what could be even more useful is to be able to perform elementary
arithmetic on memory locations. For instance, you currently have to type
poke4(a,peek4u(a)+some_value)
Which isn't too good as peek/poke has its overhead. Using call() to do this
is even worse. Rather, an internally built
perform_op(a,PLUS,some_value)
would probably help. Both add some_value at the dword pointed by a.
The needed constants would be:
PLUS
MINUS
MINUS_R -- for reverse substraction
MUL
DIV --store quotient
DIV_R
AND
OR
XOR
Perhaps adding ROR, ROL,SHL and SHR would be good too.
CChris
5. Re: Rob: Feature request for next release
christian cuvier wrote [quoting level corrected]:
> posted by: Bernie Ryan
>
>> Vincent wrote:
>>
>>> Rob, can we have some basic bit shifting routines for the next release:
>>> shift_left() and shift_right()? It doesnt matter to me if they are
>>> implemented internally, machine_proc/func(), or routines in "misc.e"...
>>> anything would do; they are neccessary.
>>
>> Vincent:
>> shifting is already available in Euphoria by
>> multiplying and dividing by 2.
>> check the library doc.
>> see power function
>> Bernie
>
> I'd rather push for rotate() functions that would work on any 32-bit
> integers.
You can do this and much more, using <http://rapideuphoria.com/bit.zip>.
> Btw, what could be even more useful is to be able to perform elementary
> arithmetic on memory locations. For instance, you currently have to type
This can not be done with bit.zip.
<snip>
Regards,
Juergen
--
Have you read a good program lately?
6. Re: Rob: Feature request for next release
- Posted by Robert Craig <rds at RapidEuphoria.com>
Oct 17, 2005
-
Last edited Oct 18, 2005
Vincent wrote:
> Rob, can we have some basic bit shifting routines for the next release:
> shift_left()
> and shift_right()? It doesnt matter to me if they are implemented internally,
> machine_proc/func(), or routines in "misc.e"... anything would do; they are
> neccessary.
OK, I'll think about it.
I guess it wouldn't hurt to add them to misc.e.
1-bit shifts using multiply and divide by two are very well
optimized, but I guess a general n-bit shift, written as efficiently
as possible (in Euphoria) might be useful.
Thanks,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
7. Re: Rob: Feature request for next release
- Posted by Robert Craig <rds at RapidEuphoria.com>
Oct 17, 2005
-
Last edited Oct 18, 2005
codepilot Gmail Account wrote:
> And maybe log2
> built in
> FYL2X ; D9 F1 [8086,FPU]
> Dan
You can get log2 using a simple conversion from log (base e)...
constant LOG2E = log(2)
function log2(atom x)
-- log, base 2
return log(x) / LOG2E
end function
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
8. Re: Rob: Feature request for next release
- Posted by Robert Craig <rds at RapidEuphoria.com>
Oct 17, 2005
-
Last edited Oct 18, 2005
Juergen Luethje wrote:
> christian cuvier wrote [quoting level corrected]:
> > posted by: Bernie Ryan
> >> Vincent wrote:
> >>> Rob, can we have some basic bit shifting routines for the next release:
> >>> shift_left() and shift_right()? It doesnt matter to me if they are
> >>> implemented internally, machine_proc/func(), or routines in "misc.e"...
> >>> anything would do; they are neccessary.
> >>
> >> Vincent:
> >> shifting is already available in Euphoria by
> >> multiplying and dividing by 2.
> >> check the library doc.
> >> see power function
> >> Bernie
> >
> > I'd rather push for rotate() functions that would work on any 32-bit
> > integers.
>
> You can do this and much more, using <<a
> href="http://rapideuphoria.com/bit.zip">http://rapideuphoria.com/bit.zip</a>>.
I guess I had better look at what you did before I re-invent the wheel.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
9. Re: Rob: Feature request for next release
- Posted by Vincent <darkvincentdude at yahoo.com>
Oct 17, 2005
-
Last edited Oct 18, 2005
Robert Craig wrote:
>
> Juergen Luethje wrote:
> > christian cuvier wrote [quoting level corrected]:
> > > posted by: Bernie Ryan
> > >> Vincent wrote:
> > >>> Rob, can we have some basic bit shifting routines for the next release:
> > >>> shift_left() and shift_right()? It doesnt matter to me if they are
> > >>> implemented internally, machine_proc/func(), or routines in "misc.e"...
> > >>> anything would do; they are neccessary.
> > >>
> > >> Vincent:
> > >> shifting is already available in Euphoria by
> > >> multiplying and dividing by 2.
> > >> check the library doc.
> > >> see power function
> > >> Bernie
> > >
> > > I'd rather push for rotate() functions that would work on any 32-bit
> > > integers.
> >
> > You can do this and much more, using <<a
> > href="http://rapideuphoria.com/bit.zip">http://rapideuphoria.com/bit.zip</a>>.
>
> I guess I had better look at what you did before I re-invent the wheel.
>
> Regards,
> Rob Craig
> Rapid Deployment Software
> <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>
>
Heh yea, instead maybe you can provide a link to "bit.zip" at the "2.6 Bitwise
Logical Operations" description in the manual, mentioning that bit shifting,
rotating, etc. routines are available in that lib.
With Juergen Luethje's permission of course
.
Regards,
Vincent
10. Re: Rob: Feature request for next release
Vincent wrote:
> Robert Craig wrote:
>>
>> Juergen Luethje wrote:
[shift and rotate bits]
>>> You can do this and much more, using http://rapideuphoria.com/bit.zip.
>>
>> I guess I had better look at what you did before I re-invent the wheel.
>
> Heh yea, instead maybe you can provide a link to "bit.zip" at the "2.6
> Bitwise Logical Operations" description in the manual, mentioning that
> bit shifting, rotating, etc. routines are available in that lib.
>
> With Juergen Luethje's permission of course
.
Rob is free to do with the library what he wants to do.
Regards,
Juergen
--
Have you read a good program lately?