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

Re: [f-cpu] Zen and the art of F-CPU assembler coding



> > xor.8 ,,r1
> > addsi.8 0xfe,r1,r1
> > inc.8 r1,r1
>
> .o( What an ugly mess! )
>
> It's more wonderful than you think: Both `cor' and `cand' can be
> substituted with only two other F-CPU instructions. No additional
> registers are required. And in contrast to your version, it's a general
> solution that will also work with larger chunks. Just add an unsigned
> compare-with-zero to a normal logic operation, and you've got it.

What is .o(...) :-) ? You version with cmple is much better,
no doubt ! I like it :-)

> On the other hand, the examples show that we can live without combine.
> If we drop it (or maybe move it to a second pipeline stage and make it
> support *all* chunk sizes), there will be enough room in the ROP2 unit to
> add `n -> 2**n' decoders in front of it for 1-cycle btst/bchg/bset/bclr
> instructions that are more useful than combine, IMHO.

It would be very nice (how complex is such decoder?). Could be possible
to support bnclr then (when we have nand) ?
I used bseti $C,r0,r for loading some constants in my gcc backend and
it helped the code. bnclr $C,r0,r could be used to load big masks
with one cleared bit. Both of these constants are heavily used in
C codes to create and modify flag bitmasks and rotating masks for
bit selection.

devik

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