[RFC] Add x86-16 target to llvm, 'clang -m16' support.

Eric Christopher echristo at gmail.com
Mon Jan 6 15:47:44 PST 2014


I like the idea of just ditching them which, I think, is what Jim said as
well.

-eric

On Mon Jan 06 2014 at 7:48:48 AM, David Woodhouse <dwmw2 at infradead.org>
wrote:

> With this, I can use 'clang -m16' and get 16-bit code output. This is
> needed for building the early boot code for the Linux kernel, amongst
> other things.
>
> With GCC, we do this using a fragile hack using asm(".code16gcc") and
> playing dirty tricks to ensure that it really does come at the *start*
> of the resulting assembler output. See GCC PR59672 for a request to add
> a simple '-m16' option there too: http://gcc.gnu.org/PR59672
>
> Note that I don't bother to define a gratuitous new subclass of
> X86TargetMachine for the 16-bit target. Since X86_32TargetMachine is
> actually perfectly usable for 16-bit, 32-bit *and* 64-bit targets, in
> fact I *only* use that:
>
> --- a/lib/Target/X86/X86TargetMachine.cpp
> +++ b/lib/Target/X86/X86TargetMachine.cpp
> @@ -24,8 +24,9 @@ using namespace llvm;
>
>  extern "C" void LLVMInitializeX86Target() {
>    // Register the target.
> +  RegisterTargetMachine<X86_32TargetMachine> W(TheX86_16Target);
>    RegisterTargetMachine<X86_32TargetMachine> X(TheX86_32Target);
> -  RegisterTargetMachine<X86_64TargetMachine> Y(TheX86_64Target);
> +  RegisterTargetMachine<X86_32TargetMachine> Y(TheX86_64Target);
>  }
>
>
> Perhaps we should ditch those subclasses altogether and just use
> X86TargetMachine? See my mail a few minutes ago to llvmdev@ about that:
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-January/069153.html
>
> --
> David Woodhouse                            Open Source Technology Centre
> David.Woodhouse at intel.com                              Intel Corporation
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140106/ad7aff83/attachment.html>


More information about the llvm-commits mailing list