Liste des Groupes | Revenir à c arch |
mitchalsup@aol.com (MitchAlsup1) writes:You already have a vector of bits that is spread acrossOn Fri, 7 Mar 2025 22:25:12 +0000, Scott Lurndal wrote:>
>mitchalsup@aol.com (MitchAlsup1) writes:>On Fri, 7 Mar 2025 11:08:56 +0000, BGB wrote:>
>For a simple test:>
lj[ 7: 0]=li[31:24];
lj[15: 8]=li[23:16];
lj[23:16]=li[15: 8];
lj[31:24]=li[ 7: 0];
Does seem to compile down to 4 instructions.
1 innstruction:: BITR rd,rs1,<8>
Isn't that just 'bswap32' on x86, or REV32 on ARM64?
A degenerate version is:: but consider::
>
BITR Rd,Rs1,<1>
>
performs bit reversion, while::
>
BITR Rd,Rs1,<2>
>
reverses pairs of bits, ...
Is there an application for this particular variant?
>>>
BITR Rs,Rs1,<16>
>
reverses halfwords.
Since there generally aren't higher level language
constructs that encapsulate this behavior, how useful
is it in the real world? Does it justify the verif
costs, much less the engineering cost?
Bswap32/64 are genuinely useful in real world applicationsYou might want to do a BE->LE conversion where they byte
(particularly networking) thus the presence in most modern instruction
sets.
Les messages affichés proviennent d'usenet.