Skip to content

Comment on 80386 Barrel Shifterparent

Comments

So you can have bit arrays of any length in memory, rather than just 32 bits in a register.

That makes sense. LLVM could probably do better here by using the memory operand version:

https://godbolt.org/z/jeqbaPsMz

The memory operand version tends to be as slow or slower than the manual implementation, so LLVM is right to avoid it.

Don't think the memory operand version would work here. If I understand the x86 architectural manual description, the 32-bit operand form interprets the bit offset as signed. A 64-bit operand could work around that but then run into issues with over-read due to fetching 64 bits of data.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.