From 721c201bd55ffb73cb2ba8d39e0570fa38c44e15 Mon Sep 17 00:00:00 2001
From: dim Global variables define regions of memory allocated at compilation time
instead of run-time. Global variables may optionally be initialized, may
have an explicit section to be placed in, and may have an optional explicit
- alignment specified. A variable may be defined as "thread_local", which
+ alignment specified. A variable may be defined as thread_local, which
means that it will not be shared by threads (each thread will have a
- separated copy of the variable). A variable may be defined as a global
+ separated copy of the variable). Not all targets support thread-local
+ variables. Optionally, a TLS model may be specified: The models correspond to the ELF TLS models; see
+ ELF
+ Handling For Thread-Local Storage for more information on under which
+ circumstances the different models may be used. The target may choose a
+ different TLS model if the specified model is not supported, or if a better
+ choice of model can be made. A variable may be defined as a global
"constant," which indicates that the contents of the variable
will never be modified (enabling better optimization, allowing the
global data to be placed in the read-only section of an executable, etc).
@@ -886,6 +920,13 @@ define i32 @main() { ; i32()*
@G = addrspace(5) constant float 1.0, section "foo", align 4
+ The following example defines a thread-local global with
+ the initialexec TLS model:
+
+
+
+@G = thread_local(initialexec) global i32 0, align 4
+
+
@@ -1048,7 +1089,7 @@ declare signext i8 @returns_signed_char()
value to the function. The attribute implies that a hidden copy of the
pointee
is made between the caller and the callee, so the callee is unable to
- modify the value in the callee. This attribute is only valid on LLVM
+ modify the value in the caller. This attribute is only valid on LLVM
pointer arguments. It is generally used to pass structs and arrays by
value, but is also valid on pointers to scalars. The copy is considered
to belong to the caller not the callee (for example,
@@ -1167,6 +1208,13 @@ define void @f() optsize { ... }
may make calls to the function faster, at the cost of extra program
startup time if the function is not called during program startup.
+
There are no constants of type x86mmx.
@@ -2739,7 +2788,7 @@ second_end: make it fit in TYPE.Inline assembler expressions may only be used as the callee operand of - a call instruction. Thus, typically we - have:
+ a call or an + invoke instruction. + Thus, typically we have:%X = call i32 asm "bswap $0", "=r,r"(i32 %Y) @@ -3051,6 +3101,8 @@ call void @llvm.dbg.value(metadata !24, i64 0, metadata !25)
In addition, the pairs must be in signed order of the lower bound and + they must be non-contiguous.
Examples:
The first two operands of a 'shufflevector' instruction are vectors - with types that match each other. The third argument is a shuffle mask whose + with the same type. The third argument is a shuffle mask whose element type is always 'i32'. The result of the instruction is a vector whose length is the same as the shuffle mask and whose element type is the same as the element type of the first two operands.
@@ -7464,6 +7518,74 @@ LLVM. + +This is an overloaded intrinsic. You can use llvm.fabs on any + floating point or vector of floating point type. Not all targets support all + types however.
+ ++ declare float @llvm.fabs.f32(float %Val) + declare double @llvm.fabs.f64(double %Val) + declare x86_fp80 @llvm.fabs.f80(x86_fp80 %Val) + declare fp128 @llvm.fabs.f128(fp128 %Val) + declare ppc_fp128 @llvm.fabs.ppcf128(ppc_fp128 %Val) ++ +
The 'llvm.fabs.*' intrinsics return the absolute value of + the operand.
+ +The argument and return value are floating point numbers of the same + type.
+ +This function returns the same values as the libm fabs functions + would, and handles error conditions in the same way.
+ +This is an overloaded intrinsic. You can use llvm.floor on any + floating point or vector of floating point type. Not all targets support all + types however.
+ ++ declare float @llvm.floor.f32(float %Val) + declare double @llvm.floor.f64(double %Val) + declare x86_fp80 @llvm.floor.f80(x86_fp80 %Val) + declare fp128 @llvm.floor.f128(fp128 %Val) + declare ppc_fp128 @llvm.floor.ppcf128(ppc_fp128 %Val) ++ +
The 'llvm.floor.*' intrinsics return the floor of + the operand.
+ +The argument and return value are floating point numbers of the same + type.
+ +This function returns the same values as the libm floor functions + would, and handles error conditions in the same way.
+ ++ declare float @llvm.fmuladd.f32(float %a, float %b, float %c) + declare double @llvm.fmuladd.f64(double %a, double %b, double %c) ++ +
The 'llvm.fmuladd.*' intrinsic functions represent multiply-add +expressions that can be fused if the code generator determines that the fused +expression would be legal and efficient.
+ +The 'llvm.fmuladd.*' intrinsics each take three arguments: two +multiplicands, a and b, and an addend c.
+ +The expression:
++ %0 = call float @llvm.fmuladd.f32(%a, %b, %c) ++
is equivalent to the expression a * b + c, except that rounding will not be +performed between the multiplication and addition steps if the code generator +fuses the operations. Fusion is not guaranteed, even if the target platform +supports it. If a fused multiply-add is required the corresponding llvm.fma.* +intrinsic function should be used instead.
+ ++ %r2 = call float @llvm.fmuladd.f32(float %a, float %b, float %c) ; yields {float}:r2 = (a * b) + c ++ +
Half precision floating point is a storage-only format. This means that it is +
For most target platforms, half precision floating point is a storage-only + format. This means that it is a dense encoding (in memory) but does not support computation in the format.
@@ -8382,7 +8551,7 @@ LLVM.- declare void @llvm.trap() + declare void @llvm.trap() noreturn nounwind
None.
This intrinsics is lowered to the target dependent trap instruction. If the +
This intrinsic is lowered to the target dependent trap instruction. If the target does not have a trap instruction, this intrinsic will be lowered to - the call of the abort() function.
+ a call of the abort() function. + ++ declare void @llvm.debugtrap() nounwind ++ +
The 'llvm.debugtrap' intrinsic.
+ +None.
+ +This intrinsic is lowered to code which is intended to cause an execution + trap with the intention of requesting the attention of a debugger.
- declare i32 @llvm.objectsize.i32(i8* <object>, i1 <type>) - declare i64 @llvm.objectsize.i64(i8* <object>, i1 <type>) + declare i32 @llvm.objectsize.i32(i8* <object>, i1 <min>) + declare i64 @llvm.objectsize.i64(i8* <object>, i1 <min>)
The llvm.objectsize intrinsic takes two arguments. The first argument is a pointer to or into the object. The second argument - is a boolean 0 or 1. This argument determines whether you want the - maximum (0) or minimum (1) bytes remaining. This needs to be a literal 0 or - 1, variables are not allowed.
+ is a boolean and determines whether llvm.objectsize returns 0 (if + true) or -1 (if false) when the object size is unknown. + The second argument only accepts constants.The llvm.objectsize intrinsic is lowered to either a constant - representing the size of the object concerned, or i32/i64 -1 or 0, - depending on the type argument, if the size cannot be determined at - compile time.
+The llvm.objectsize intrinsic is lowered to a constant representing + the size of the object concerned. If the size cannot be determined at compile + time, llvm.objectsize returns i32/i64 -1 or 0 + (depending on the min argument).
@@ -8492,6 +8685,30 @@ LLVM.This intrinsic is lowered to the val.
+ ++ declare void @llvm.donothing() nounwind readnone ++ +
The llvm.donothing intrinsic doesn't perform any operation. It's the +only intrinsic that can be called with an invoke instruction.
+ +None.
+ +This intrinsic does nothing, and it's removed by optimizers and ignored by +codegen.
+