Re: CW inline assembly and Rosetta
- From: Anon <anon@xxxxx>
- Date: Thu, 21 Jul 2005 00:17:47 -0400
In article <dbm19q$5ra$1@xxxxxxxxxxxxxxxxxxx>,
Michael McLaughlin <mpmcl@xxxxxxxxx> wrote:
> Apologies if this is a bit off-topic.
>
> The function below is the (PowerPC) core of a pseudo-random-number
> generator which is nearly four times faster than the best C equivalent I
> can write. [The basic operation, subtract-with-borrow (subfe), is a
> single instruction that must be simulated in C.]
>
> Can anyone tell me whether Rosetta will handle a function like this,
> including fetching and storing the globals, or will I have to write an
> x86 assembly routine? [I do not have an x86 computer and have never
> written x86 assembly.]
>
> Thanks in advance.
>
> asm void URandomLib::Refill()
> {
> lwz r3,Ultra_brw // fetch global addresses from TOC
..
..
..
> li r5,148 // 4*37 bytes
> sth r5,0(r7) // reinitialize
> blr
> }
>
> --
> Mike McLaughlin
The only reason Rosetta would not be able to handle it is if any of
those instructions are not available on a G3. I don't believe that is
the case so it should be fine. However, it will almost certainly be
slower under emulation.
Chris.
.
- Follow-Ups:
- Re: CW inline assembly and Rosetta
- From: Michael McLaughlin
- Re: CW inline assembly and Rosetta
- References:
- CW inline assembly and Rosetta
- From: Michael McLaughlin
- CW inline assembly and Rosetta
- Prev by Date: Re: Compiling simple old UNIX program
- Next by Date: Re: Delay in editor
- Previous by thread: CW inline assembly and Rosetta
- Next by thread: Re: CW inline assembly and Rosetta
- Index(es):