[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] RC5, F-CPU and srotl



hi !

Cedric BAIL wrote:
> > Here's a 16-bit version, using slightly less than 3 instructions per
> > slice, and only 2 registers:
> >
> >       rotl.d  %2, %1, %1
> >       shiftri 16, %2, %2
> >       rotri   16, %1, %1
> >       rotl.d  %2, %1, %1
> >       shiftri 16, %2, %2
> >       rotri   16, %1, %1
> >       rotl.d  %2, %1, %1
> >       shiftri 16, %2, %2
> >       rotri   16, %1, %1
> >       rotl.d  %2, %1, %1
> >       rotr    16, %1, %1
> Well, we lost what %2 and %1 contain after the call. I know in my call too,
> but it can be a problem.

another problem is that if the SHL unit has 2 cycles of latency,
you'll have to find 2 other srotl macro_instructions to interleave it.
I have not checked all the data dependencies, but it's going to stall
the pipeline 2/3 of the time...

> > >     An other thing about the srotl, it currently double the asm code.
> > > It mean that, if we have a real srotl operation, we will have the same or
> > > better performance than the K7 core (who is actually the best for this
> > > algorithm). So my question is what is the cost of having a real srotl
> > > instruction ?
> > A more complex shifter unit, with more delay.
> It was what I was thinking, but is it so important ?
if the SHL unit is still multi-purpose and othogonal, it's ok.
i don't think that a shift is going to be only one cycle long, anyway.

> > A while ago (precisely: Aug 15, 2001), I wrote this:
> >
> >       - The loadm/storem has a surprising operand order
> >         (start,src/dest,count), and it's not clear whether the
> >         register *numbers* or the register *contents* serve as the
> >         start/count values.  I suggest the former, and I would also
> >         change the operands to (firstreg, lastreg, memaddr) which is
> >         much easier to grok for humans.
> >
> > Two days later, Yann replied:
> >
> >        - whether it is the contents or the value of the address does
> >          not change much except that the value is know 2 cycles
> >          before or after. i'd prefer to use the register number than
> >          its value, though, if possible.  though using the register
> >          contents might also help.
> >
> > That is, the first and third operand can be considered immediate
> > operands in disguise.
> So, we need to patch the manual.

hmmm yes, marking a big "don't read this silliness !"

i think i shouldn't have put these instructions in the manual, it creates
too many problems and misunderstandings.

at least, not yet for FC0.

> A+
>   Cedric
WHYGEE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/