[lld] r250297 - [ELF2][mips] Support both big and little endian MIPS 32-bit targets

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 13:43:29 PDT 2015


----- Original Message -----
> From: "Rui Ueyama" <ruiu at google.com>
> To: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> Cc: "Hal Finkel" <hfinkel at anl.gov>, "llvm-commits" <llvm-commits at lists.llvm.org>
> Sent: Wednesday, October 14, 2015 3:39:28 PM
> Subject: Re: [lld] r250297 - [ELF2][mips] Support both big and little endian MIPS 32-bit targets
> 
> 
> On Wed, Oct 14, 2015 at 1:25 PM, Rafael EspĂ­ndola <
> llvm-commits at lists.llvm.org > wrote:
> 
> 
> > One solution would be to define:
> > 
> > template <endianness endian>
> > inline uint32_t read32(const void *p) { return *(const
> > detail::packed_endian_specific_integral<uint32_t, endian,
> > unaligned> *) p; }
> > 
> > and similar for write32, and implement Endian-independent things in
> > terms of those.
> 
> LGTM :-)
> 
> 
> It doesn't look good to me. It looks more intricate than necessary. I
> really prefer the current code over the suggested one.

I would not put that template code into lld, it would belong in the support header. Honestly, generic operations (add32be, etc.) should be there too. This way the code in lld (and any other user) can be simpler, not more complicated.

 -Hal

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-commits mailing list