TargetDescription string documentation

Hello,

I am trying to find out where the complete documentation for the
TargetDescription string documentation is.
I am reading the tutorial and looking at the sparc backend at the same
time and there are some discrepancies. Therefore the documentation
would be extremely valuable but I can't seem to find it.

In the tutorial it shows the string "E-p:32:32-f128:128:128",
but the real sparc backend has
"E-p:32:32:32-i16:16:16-f32:32:32-f128:64:64-n32".

The tutorial doesn't explain what the 'n' stands for, or why 'f' shows
up twice (I can guess the first might be for floats and the second for
doubles, but the tutorial has a different story about doubles.

Here's where I am reading it from:
http://llvm.org/docs/WritingAnLLVMBackend.html

I would be grateful for any explanation or pointers to documentation.

Cheers,

Paulo J. Matos wrote:

Hello,

I am trying to find out where the complete documentation for the
TargetDescription string documentation is.
I am reading the tutorial and looking at the sparc backend at the same
time and there are some discrepancies. Therefore the documentation
would be extremely valuable but I can't seem to find it.

In the tutorial it shows the string "E-p:32:32-f128:128:128",
but the real sparc backend has
"E-p:32:32:32-i16:16:16-f32:32:32-f128:64:64-n32".

The tutorial doesn't explain what the 'n' stands for, or why 'f' shows
up twice (I can guess the first might be for floats and the second for
doubles, but the tutorial has a different story about doubles.

Here's where I am reading it from:
http://llvm.org/docs/WritingAnLLVMBackend.html

I would be grateful for any explanation or pointers to documentation.

Cheers,
  
I believe what you want is documented here:

http://llvm.org/docs/LangRef.html#datalayout

-- John T.

Yes it is. Thanks. I guess I should have read the document instead of
skimming it. :slight_smile:

Just a note, since it might be a bug on the backend or documentation.
It says on the documentation that size for f is either 32 or 64,
however, sparc has 64 and 128.

Paulo J. Matos wrote:

It's a documentation bug; f128 refers to the LLVM type fp128 on SPARC.

-Eli

128 could also be ppcf128 on PPC, which has a completely different representation than fp128.
And f80 exists on x86. I suppose this doc is trying to make the point that FP types can't be of arbitrary sizes while int types can be, which is a good point to make, but there should be a better way to do it than enumerating the possibilities. FP types that are not supported on the target, e.g. f80 on Sparc, will not work well.