[RFC PATCH 0/8] [x86] Fix 16-bit addressing modes (bug 18220) and attempt to implement .code16 (bug 8684)

David Woodhouse dwmw2 at infradead.org
Fri Dec 13 15:28:48 PST 2013

There follows a series of patches which attempts $SUBJECT.

It could do with careful review from someone who's spent more than two
days looking at LLVM code. In particular, my implementation of
reloc_signed_2byte is almost certainly not correct in some details, and
is only tested for ELF output. And was the code in EmitImmediate()
already doing the wrong thing and turning FK_Data_8 into FK_SecRel_4? I
ignored that and simply did 'Size == 2 ? FK_SecRel_2 : FK_SecRel_4',
preserving the original 'bug' if it is a bug.

I would like feedback on the introduction of OpSize16 before I actually
complete the final patch in the series, which is only a rough pass so
far and covers the instructions which were needed by my test cases.

I should probably pull out the addition of 'popaw' and 'pushaw'
instructions (and the renaming of popal and pushal) from the final patch
into a separate commit... or just draw explicit attention to it here.

This implementation of .code16 isn't perfect — we do need to explicitly
encode the word size on some instructions, such as retw because a simple
'ret' will alias to 'retl' by default. But that can possibly be
addressed in subsequent patches, and it's certainly good enough for my
purposes as it is.

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/20131213/3c43ff31/attachment.bin>

More information about the llvm-commits mailing list