Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King wrote:
> On Thu, Jan 23, 2014 at 11:56:43AM -0800, Jonathan Nieder wrote:

>> In that case I think git-compat-util.h should include something like
>> what block-sha1/sha1.c has:
>> 
>> 	#if !defined(__i386__) && !defined(__x86_64__) && \
>> 	    !defined(_M_IX86) && !defined(_M_X64) && \
>> 	    !defined(__ppc__) && !defined(__ppc64__) && \
>> 	    !defined(__powerpc__) && !defined(__powerpc64__) && \
>> 	    !defined(__s390__) && !defined(__s390x__)
>> 	#define NEEDS_ALIGNED_ACCESS
>> 	#endif
>>
>> Otherwise we are relying on the person building to know their own
>> architecture intimately, which shouldn't be necessary.
>
> Yeah, I agree it would be nice to autodetect.

The nice thing is that false positives are harmless, modulo slowing
down git a little if the compiler doesn't figure out how to optimize
the NEEDS_ALIGNED_ACCESS codepath when on an unlisted platform that
doesn't, in fact, need aligned access.

In other words, it would work out of the box for everybody.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]