Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Sep 2016 13:45:57 -0500
From:      Krzysztof Parzyszek <kristof@swissmail.org>
To:        freebsd-ppc@freebsd.org
Subject:   Re: From llvm: Fwd: [Bug 26519] Clang 3.8.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) [fixed in llvm -r280705]
Message-ID:  <74556e62-cc12-a4c7-53f4-0be7ec01163f@swissmail.org>
In-Reply-To: <6EA51424-C360-4604-B2D5-06C6762600A9@dsl-only.net>
References:  <EB82D9DC-4868-4075-B02E-BEC3A241C9A9@dsl-only.net> <6EA51424-C360-4604-B2D5-06C6762600A9@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/8/2016 8:02 PM, Mark Millard wrote:
>
> Interestingly http://compiler-rt.llvm.org says (mentioning powerpc64 explicitly):
>
> [Quoting the web site this time.]
>
>> Platform Support
>>
>> builtins is known to work on the following platforms:
>>
>> 	• Machine Architectures: i386, X86-64, SPARC64, ARM, PowerPC, PowerPC 64.
>> 	• OS: AuroraUX, DragonFlyBSD, FreeBSD, NetBSD, Linux, Darwin.
>
> If true for all builtins (libgcc like) for powerpc64 then I'm not sure why there is the code:
>
> [Quoting from https://reviews.llvm.org/D13351 and its cfe/trunk/lib/Driver/Tools.cpp material this time.]
>
>>   ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args);
>>   if (FloatABI == ppc::FloatABI::Soft &&
>>       !(Triple.getArch() == llvm::Triple::ppc64 ||
>>         Triple.getArch() == llvm::Triple::ppc64le))
>>     Features.push_back("+soft-float");
>>   else if (FloatABI == ppc::FloatABI::Soft &&
>>            (Triple.getArch() == llvm::Triple::ppc64 ||
>>             Triple.getArch() == llvm::Triple::ppc64le))
>>     D.Diag(diag::err_drv_invalid_mfloat_abi)
>>         << "soft float is not supported for ppc64";
>
> The above reports that "soft float is not supported for ppc64". This notice seems to be global for clang powerpc64: in no way FreeBSD specific.
>
> May be the view is that no floating point builtins ever apply to powerpc64 (but they do for powerpc (32))?

I think the reasoning was that all powerpc64 cores do contain 
floating-point units (and that the 64-bit part wasn't tried/tested/etc).

I have looked at compiler-rt and it does have support for all 
floating-point operations (although it seems to only do 
rounding-to-nearest).

On a somewhat related note---the kernel does have some sort of an FPU 
emulation---do you know what it's for and how it's used? It does make 
more sense to use compiler-supported library though, after all it's the 
compiler generating calls to it.

-Krzysztof




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?74556e62-cc12-a4c7-53f4-0be7ec01163f>