1. Rob: Feature request for next release

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

----------------------------------------------
     ___	      __________      ___
    /__/\            /__________\    |\ _\
    \::\'\          //::::::::::\\   |'|::|
     \::\'\        //:::_::::_:::\\  |'|::|
      \::\'\      //::/  |::|  \::\\ |'|::|
       \::\'\    //::/   |::|   \::\\|'|::|
        \::\'\__//::/    |::|    \::\|'|::|
         \::\','/::/     |::|     \::\\|::|
          \::\_/::/      |::|      \::\|::|
           \::,::/       |::|       \:::::|
            \___/        |__|        \____|

 	                 .``.
		         ',,'

new topic     » topic index » view message » categorize

2. Re: Rob: Feature request for next release

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
>
> ----------------------------------------------
>     ___              __________      ___
>    /__/\            /__________\    |\ _\
>    \::\'\          //::::::::::\\   |'|::|
>     \::\'\        //:::_::::_:::\\  |'|::|
>      \::\'\      //::/  |::|  \::\\ |'|::|
>       \::\'\    //::/   |::|   \::\\|'|::|
>        \::\'\__//::/    |::|    \::\|'|::|
>         \::\','/::/     |::|     \::\\|::|
>          \::\_/::/      |::|      \::\|::|
>           \::,::/       |::|       \:::::|
>            \___/        |__|        \____|
>
>                         .``.
>                         ',,'
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

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

new topic     » goto parent     » topic index » view message » categorize

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

new topic     » goto parent     » topic index » view message » categorize

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?

new topic     » goto parent     » topic index » view message » categorize

6. 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.

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

new topic     » goto parent     » topic index » view message » categorize

7. Re: Rob: Feature request for next release

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

new topic     » goto parent     » topic index » view message » categorize

8. Re: Rob: Feature request for next release

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

new topic     » goto parent     » topic index » view message » categorize

9. Re: Rob: Feature request for next release

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 smile.


Regards,
Vincent

new topic     » goto parent     » topic index » view message » categorize

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 smile.

Rob is free to do with the library what he wants to do.

Regards,
   Juergen

-- 
Have you read a good program lately?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu