[PATCH] Encode native floating point types in data layout string.

Tim Northover t.p.northover at gmail.com
Fri Dec 19 09:36:05 PST 2014


Hi Cameron,

On 16 December 2014 at 16:16, Cameron Esfahani <dirty at apple.com> wrote:
> My first attempt at using Phabricator didn't work so well.  Should I be adding llvm-commits as a reviewer or a subscriber?

I think subscriber usually sends messages to the list. Do you have a
corresponding Clang patch for this? It sets datalayouts and needs to
be kept in precise sync with the backends at the moment.

> Attached is patch proposal to encode native floating point types into the data layout string.

We'll want to update the LangRef documentation for this.

> ARM: 16-bit (if supported), single, and double (if supported) precision float.

I wouldn't have said 16-bit was native. It'll get promoted to float
one way or the other for any actual operations. You just might be
lucky enough that there are instructions to do that conversion for
you.

+    else if (ST.useNEONForSinglePrecisionFP())
+      Ret += "-nf32";

I also don't think this logic is right for ARM. You probably want
ST.isFPOnlySP().

I'm not an expert in any other targets, but I'd be surprised if PPC
supported fp128 efficiently. As far as I'm aware it has a pseudo-128
format of its own, which relies on 64-bit operations. There may be
other ABIs that use IEEE 128-bit, but probably not efficiently.
Whether it's efficient or not is debatable. You'll want to get PPC
people to comment on this (and their own targets) though.

I've

Cheers.

Tim.



More information about the llvm-commits mailing list