FP128Ty

I am new to llvm and am stuck up with a problem.
I am trying to initialize a Value* of type fp128 having the value 0

I am using the following construct

ConstantFP::get(APFloat(APInt(128,0,false)));

This is returning a double instead of a float and I am confused.

Thanks a lot for your help.

FP128Ty is stubbed out, but completely untested and not supported by any targets yet.

-Chris

Hello together,

I have seen that the analysis-results are stored in llvm-IR as annotations.
For example <; preds = %entry> in basicBlock level and <; <i32*> [#uses=2]> for a variable.

Is there any documentation about annotations?

Regards
Raad

That isn't really analysis; it's just some easy-to-extract information
the disassembler uses to make the output more readable. Those notes
are treated as comments by the assembler.

-Eli

Ok, but what about a pass like alias-analysis.
How are the results stored, so that other passes can use them.

-Raad

Hi,

I have seen that the analysis-results are stored in llvm-IR as annotations.

no they are not.

For example <; preds = %entry> in basicBlock level and <; <i32*> [#uses=2]> for a variable.

Is there any documentation about annotations?

These are just comments - you can delete them and it won't matter.

Ciao,

Duncan.

RAAD B wrote:

Ok, but what about a pass like alias-analysis.
How are the results stored, so that other passes can use them.
  

Currently, most/all analysis information is stored in memory; the
analysis passes do not encode their results into the LLVM IR. There is
a new annotation intrinsic for encoding arbitrary information in the IR,
but to the best of my knowledge, no analysis pass uses it to encode its
results directly in the LLVM IR.

Instead, during execution of an LLVM-based tool (e.g. the opt tool), a
piece of code called the Pass Manager schedules analysis and
transformation passes for execution. LLVM passes are C++ objects. When
a transform pass needs analysis results, it asks the Pass Manager for a
pointer to the C++ object for the corresponding analysis pass; it then
calls methods on this pointer to query the information it requires. So,
all analysis information is passed around in memory between passes.

For more information, I'd suggest reading the "Writing an LLVM Pass"
document at http://llvm.org/docs/WritingAnLLVMPass.html.

-- John T.

More specifically, the compile-time arithmetic stuff *should* Just Work, although nobody has tried it; the conversions of FP128 to and from other formats are not done. They should not be difficult to do by copying & modifying existing code. To do specifically what you're trying to do, add the FP128 case to APFloat::initFromAPInt. The code that reads and writes the IR, and writes assembler output, also needs to be added.

(The Float in APFloat means "floating point", not the C float type.)

I am new to llvm and am stuck up with a problem.
I am trying to initialize a Value* of type fp128 having the value 0

I am using the following construct

ConstantFP::get(APFloat(APInt(128,0,false)));

Also, the 3rd parameter should be "true" for Fp128. This call is getting you PowerPC 128-bit format, which is two doubles stuck together; that's probably why it looks like a double to you. This format has lots of weird numeric properties, and you don't want to use it unless you're targeting PowerPC.