[PATCH v3 04/11] [x86] Add OpSize16 to instructions that need it

David Woodhouse dwmw2 at infradead.org
Sun Jan 5 07:43:37 PST 2014


On Sun, 2014-01-05 at 07:39 -0600, Craig Topper wrote:
> If we approached this from another direction and inverted the normal
> OpSize bit in 16-bit mode, how many instructions would break?

Basically, lots. The question is roughly equivalent to asking, after my
existing patch, "how many instructions have neither OpSize nor OpSize16
bit set". Someone with a bit of clue about tablegen could probably
answer that in a moment. But I'll stick with a qualitative answer of
"too many".

I suppose you could refine the question, and make it "how many
instructions operate on a 32-bit register or memory location and don't
need the OpSize16 bit" (probably very few other than move to/from CR),
plus "how many instructions have OpSize16 but don't operate on a 32-bit
object (probably only lgdtl and friends).

So you *might* be able to contrive a way to make it work without adding
OpSize16 to so many instructions. But I don't think it'll be pretty, and
you'll have to have special cases in the code to handle the "does it
operate on a 32-bit object" bit. And probably end up needing a new, less
intuitive, feature bit on some instructions anyway. Or maybe two of
them, to handle both false positives and false negatives in whatever
heuristics you come up with to "guess" which instructions need the
prefix.

Doing it with OpSize16 seems a whole lot simpler.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140105/43733851/attachment.bin>


More information about the llvm-commits mailing list