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

Re: [f-cpu] New EU_SHL Instruction



hi !

Just an Illusion wrote:

Hello,
--- Yann Guidon <whygee@f-cpu.org> a écrit : > hi !

This is useful for example for 'interpreting masks',
when a character has been
detected and the resulting bytewide mask must be
turned into a bitfield....

Perhaps I made a mistake, but in case of mask bytewide
to bitfield, why don't use a "reduce logic" operator
like and_reduce, or_reduce... ?

and_reduce (or "combine" as written in ROP2) is not possible
for very wide data.

Furthermore, the xorn.and trick is useful for "detecting" that a byte
corresponds, but if you need to find the index of the character,
the "obvious" answer is to loop over the register.
if you have a result of 0x00FF000000000000, it's not a good solution.
So the idea is to "transpose" the bits in the word, that would become
0x4040404040404040 and the last byte can then ben binary encoded
in INC (if it's implemented).

It is certainly not enough for all cases, but it must
work fine for mask.

There are several kinds of masks and bitfields and the ROP2 operations
are not always enough.

YG

Just an Illusion

YG

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