David Woodhouse
2014-Jan-06 22:33 UTC
[LLVMdev] Why do X86_32TargetMachine and X86_64TargetMachine classes exist?
On Mon, 2014-01-06 at 14:23 -0800, Jim Grosbach wrote:> Hi David, > > AFAIK, the answer is basically “because it’s always been that way.” I > seem to recall there were some things that were different (data layout > string and such), but that could also be parameterized if it hasn’t > been already by the recent refactorings, I suppose.It is *all* now parameterized. The classes are identical apart from that one true/false...> > @@ -74,7 +75,7 @@ X86_32TargetMachine::X86_32TargetMachine(const Target &T, Stri > > const TargetOptions &Options, > > Reloc::Model RM, CodeModel::Model CM, > > CodeGenOpt::Level OL) > > - : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false), > > + : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, Triple(TT).getArch()) > > Think this is missing a "==Triple::x86_64” at the end, yes?Nah, I turned that parameter into a Triple::ArchType so that I can pass x86_16 as an option too. See the patch on llvm-commits which adds the x86_16 target. Currently working on a few codegen bugs with building the Linux kernel's 16-bit startup code with 'clang -m16'... -- dwmw2 -------------- 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-dev/attachments/20140106/c5313a98/attachment.bin>
Jim Grosbach
2014-Jan-06 23:00 UTC
[LLVMdev] Why do X86_32TargetMachine and X86_64TargetMachine classes exist?
On Jan 6, 2014, at 2:33 PM, David Woodhouse <dwmw2 at infradead.org> wrote:> On Mon, 2014-01-06 at 14:23 -0800, Jim Grosbach wrote: >> Hi David, >> >> AFAIK, the answer is basically “because it’s always been that way.” I >> seem to recall there were some things that were different (data layout >> string and such), but that could also be parameterized if it hasn’t >> been already by the recent refactorings, I suppose. > > It is *all* now parameterized. The classes are identical apart from that > one true/false… >Cool. I have no objection to merging them. Seems the right thing to do IMO.>>> @@ -74,7 +75,7 @@ X86_32TargetMachine::X86_32TargetMachine(const Target &T, Stri >>> const TargetOptions &Options, >>> Reloc::Model RM, CodeModel::Model CM, >>> CodeGenOpt::Level OL) >>> - : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false), >>> + : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, Triple(TT).getArch()) >> >> Think this is missing a "==Triple::x86_64” at the end, yes? > > Nah, I turned that parameter into a Triple::ArchType so that I can pass > x86_16 as an option too. See the patch on llvm-commits which adds the > x86_16 target. > > Currently working on a few codegen bugs with building the Linux kernel's > 16-bit startup code with 'clang -m16'... > > -- > dwmw2
David Woodhouse
2014-Jan-06 23:45 UTC
[LLVMdev] Why do X86_32TargetMachine and X86_64TargetMachine classes exist?
On Mon, 2014-01-06 at 15:00 -0800, Jim Grosbach wrote:> > > Cool. I have no objection to merging them. Seems the right thing to do > IMO.I'll sort that out as a preliminary cleanup before the addition of x86_16 target then; thanks. That way I don't have to add a *third* gratuitous identical class :) -- dwmw2 -------------- 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-dev/attachments/20140106/6fc14195/attachment.bin>
David Woodhouse
2014-Jan-07 16:21 UTC
[LLVMdev] Why do X86_32TargetMachine and X86_64TargetMachine classes exist?
On Mon, 2014-01-06 at 15:00 -0800, Jim Grosbach wrote:> > Cool. I have no objection to merging them. Seems the right thing to do > IMO.Looks like this... -- David Woodhouse Open Source Technology Centre David.Woodhouse at intel.com Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-x86-Kill-gratuitous-X86_-32-64-TargetMachine-subclas.patch Type: text/x-patch Size: 9944 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140107/94837276/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Add-x86_16-target.patch Type: text/x-patch Size: 12602 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140107/94837276/attachment-0001.bin> -------------- 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-dev/attachments/20140107/94837276/attachment-0002.bin>