|
Intel SPMD Program Compiler
1.3.0
|
AtomicType represents basic types like floats, ints, etc. More...
#include <type.h>


AtomicType represents basic types like floats, ints, etc.
AtomicTypes can be either uniform or varying. Unique instances of all of the possible AtomicTypes are available in the static members like AtomicType::UniformInt32. It is thus possible to compare AtomicTypes for equality with simple pointer equality tests; this is not true for the other Type implementations.
| AtomicType::AtomicType | ( | BasicType | basicType, |
| Variability | v, | ||
| bool | isConst | ||
| ) | [private] |
Definition at line 190 of file type.cpp.
References asOtherConstType, asUniformType, asVaryingType, and NULL.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsUnsignedType(), GetAsVaryingType(), and ResolveUnboundVariability().
| const AtomicType * AtomicType::GetAsConstType | ( | ) | const [virtual] |
Get a const version of this type. If it's already const, then the old Type pointer is returned.
Implements Type.
Definition at line 282 of file type.cpp.
References asOtherConstType, AtomicType(), basicType, isConst, NULL, TYPE_VOID, and variability.
Referenced by ForeachActiveStmt::EmitCode(), and VectorType::GetAsConstType().
| const AtomicType * AtomicType::GetAsNonConstType | ( | ) | const [virtual] |
Get a non-const version of this type. If it's already not const, then the old Type pointer is returned.
Implements Type.
Definition at line 295 of file type.cpp.
References asOtherConstType, AtomicType(), basicType, isConst, NULL, TYPE_VOID, and variability.
Referenced by VectorType::GetAsNonConstType().
| const AtomicType * AtomicType::GetAsSOAType | ( | int | width | ) | const [virtual] |
Implements Type.
Definition at line 353 of file type.cpp.
References Assert, AtomicType(), basicType, isConst, Variability::SOA, TYPE_VOID, and variability.
Referenced by VectorType::GetAsSOAType().
| const AtomicType * AtomicType::GetAsUnboundVariabilityType | ( | ) | const [virtual] |
Get an instance of the type with unbound variability.
Implements Type.
Definition at line 344 of file type.cpp.
References Assert, AtomicType(), basicType, isConst, TYPE_VOID, Variability::Unbound, and variability.
Referenced by VectorType::GetAsUnboundVariabilityType(), and DeclSpecs::GetBaseType().
| const AtomicType * AtomicType::GetAsUniformType | ( | ) | const [virtual] |
Return a "uniform" instance of this type. If the type is already uniform, its "this" pointer will be returned.
Implements Type.
Definition at line 329 of file type.cpp.
References Assert, asUniformType, asVaryingType, AtomicType(), basicType, isConst, NULL, TYPE_VOID, Variability::Uniform, variability, and Variability::Varying.
Referenced by VectorType::GetAsUniformType(), GetDIType(), VectorType::getVectorMemoryCount(), and LLVMType().
| const AtomicType * AtomicType::GetAsUnsignedType | ( | ) | const [virtual] |
If this is a signed integer type, return the unsigned version of the type. Otherwise, return the original type.
Reimplemented from Type.
Definition at line 258 of file type.cpp.
References AtomicType(), basicType, FATAL, isConst, IsIntType(), IsUnsignedType(), NULL, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, and variability.
| const AtomicType * AtomicType::GetAsVaryingType | ( | ) | const [virtual] |
Return a "varying" instance of this type. If the type is already varying, its "this" pointer will be returned.
Implements Type.
Definition at line 314 of file type.cpp.
References Assert, asUniformType, asVaryingType, AtomicType(), basicType, isConst, NULL, TYPE_VOID, Variability::Uniform, variability, and Variability::Varying.
Referenced by VectorType::GetAsVaryingType().
| const AtomicType * AtomicType::GetBaseType | ( | ) | const [virtual] |
For AtomicTypes, the base type is just the same as the AtomicType itself.
Implements Type.
Definition at line 308 of file type.cpp.
Referenced by IndexExpr::TypeCheck(), and PtrDerefExpr::TypeCheck().
| std::string AtomicType::GetCDeclaration | ( | const std::string & | name | ) | const [virtual] |
Returns a string that is the declaration of the same type in C syntax.
Implements Type.
Definition at line 424 of file type.cpp.
References Assert, basicType, Module::errorCount, FATAL, isConst, lShouldPrintName(), m, Variability::SOA, Variability::soaWidth, TYPE_BOOL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, TYPE_VOID, Variability::Uniform, and variability.
Referenced by VectorType::GetCDeclaration().
| llvm::DIType AtomicType::GetDIType | ( | llvm::DIDescriptor | scope | ) | const [virtual] |
Returns the DIType (LLVM's debugging information structure), corresponding to this type.
Implements Type.
Definition at line 505 of file type.cpp.
References Assert, basicType, Module::diBuilder, FATAL, g, GetAsUniformType(), GetDIType(), ArrayType::GetDIType(), m, Variability::SOA, Variability::soaWidth, Globals::target, Variability::type, TYPE_BOOL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, TYPE_VOID, Variability::Unbound, Variability::Uniform, variability, Variability::Varying, and Target::vectorWidth.
Referenced by GetDIType(), and VectorType::GetDIType().
| std::string AtomicType::GetString | ( | ) | const [virtual] |
Returns a text representation of the type (for example, for use in warning and error messages).
Implements Type.
Definition at line 371 of file type.cpp.
References basicType, FATAL, Variability::GetString(), isConst, TYPE_BOOL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, TYPE_VOID, and variability.
Referenced by VectorType::GetString().
| Variability AtomicType::GetVariability | ( | ) | const [virtual] |
Returns the variability of the type.
Implements Type.
Definition at line 198 of file type.cpp.
References variability.
Referenced by VectorType::GetVariability(), and lCheckTypeEquality().
| bool AtomicType::IsBoolType | ( | ) | const [virtual] |
Returns true if the underlying type is boolean. In other words, this is true for individual bools and for short-vectors with underlying bool type, but not for arrays of bools.
Implements Type.
Definition at line 246 of file type.cpp.
References basicType, and TYPE_BOOL.
Referenced by VectorType::IsBoolType().
| bool AtomicType::IsConstType | ( | ) | const [virtual] |
Returns true if this type is 'const'-qualified.
Implements Type.
Definition at line 252 of file type.cpp.
References isConst.
Referenced by VectorType::IsConstType().
| bool AtomicType::IsFloatType | ( | ) | const [virtual] |
Returns true if the underlying type is float or double. In other words, this is true for individual floats/doubles and for short-vectors of them, but not for arrays of them.
Implements Type.
Definition at line 225 of file type.cpp.
References basicType, TYPE_DOUBLE, and TYPE_FLOAT.
Referenced by VectorType::IsFloatType().
| bool AtomicType::IsIntType | ( | ) | const [virtual] |
Returns true if the underlying type is an integer type. In other words, this is true for individual integers and for short-vectors of integer types, but not for arrays of integer types.
Implements Type.
Definition at line 230 of file type.cpp.
References basicType, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, and TYPE_UINT8.
Referenced by GetAsUnsignedType(), VectorType::IsIntType(), and TypeCastExpr::TypeCheck().
| bool AtomicType::IsUnsignedType | ( | ) | const [virtual] |
Returns true if the underlying type is unsigned. In other words, this is true for unsigned integers and short vectors of unsigned integer types.
Implements Type.
Definition at line 239 of file type.cpp.
References basicType, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, and TYPE_UINT8.
Referenced by GetAsUnsignedType(), and VectorType::IsUnsignedType().
| llvm::Type * AtomicType::LLVMType | ( | llvm::LLVMContext * | ctx | ) | const [virtual] |
Returns the LLVM type corresponding to this ispc type
Implements Type.
Definition at line 465 of file type.cpp.
References Assert, basicType, LLVMTypes::BoolType, LLVMTypes::BoolVectorType, LLVMTypes::DoubleType, LLVMTypes::DoubleVectorType, FATAL, LLVMTypes::FloatType, LLVMTypes::FloatVectorType, GetAsUniformType(), LLVMTypes::Int16Type, LLVMTypes::Int16VectorType, LLVMTypes::Int32Type, LLVMTypes::Int32VectorType, LLVMTypes::Int64Type, LLVMTypes::Int64VectorType, LLVMTypes::Int8Type, LLVMTypes::Int8VectorType, ArrayType::LLVMType(), NULL, Variability::soaWidth, Variability::type, TYPE_BOOL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, TYPE_VOID, Variability::Unbound, Variability::Uniform, variability, and Variability::Varying.
Referenced by VectorType::LLVMType().
| std::string AtomicType::Mangle | ( | ) | const [virtual] |
Returns a string that represents the mangled type (for use in mangling function symbol names for function overloading). The various Types implementations of this method should collectively ensure that all of them use mangling schemes that are guaranteed not to clash.
Implements Type.
Definition at line 399 of file type.cpp.
References basicType, FATAL, isConst, Variability::MangleString(), TYPE_BOOL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT64, TYPE_UINT8, TYPE_VOID, and variability.
Referenced by VectorType::Mangle().
| const AtomicType * AtomicType::ResolveUnboundVariability | ( | Variability | v | ) | const [virtual] |
Implements Type.
Definition at line 362 of file type.cpp.
References Assert, AtomicType(), basicType, isConst, Variability::Unbound, and variability.
Referenced by VectorType::ResolveUnboundVariability().
const AtomicType* AtomicType::asOtherConstType [mutable, private] |
Definition at line 349 of file type.h.
Referenced by AtomicType(), GetAsConstType(), and GetAsNonConstType().
const AtomicType * AtomicType::asUniformType [mutable, private] |
Definition at line 349 of file type.h.
Referenced by AtomicType(), GetAsUniformType(), and GetAsVaryingType().
const AtomicType * AtomicType::asVaryingType [mutable, private] |
Definition at line 349 of file type.h.
Referenced by AtomicType(), GetAsUniformType(), and GetAsVaryingType().
Definition at line 329 of file type.h.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsUnsignedType(), GetAsVaryingType(), ConstExpr::getBasicType(), GetCDeclaration(), GetDIType(), GetString(), IsBoolType(), IsFloatType(), IsIntType(), IsUnsignedType(), lCheckTypeEquality(), lIsMatchWithTypeWidening(), lLLVMConstantValue(), LLVMType(), lTypeConvAtomic(), Mangle(), Type::MoreGeneralType(), TypeCastExpr::Optimize(), and ResolveUnboundVariability().
const bool AtomicType::isConst [private] |
Definition at line 346 of file type.h.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsUnsignedType(), GetAsVaryingType(), GetCDeclaration(), GetString(), IsConstType(), Mangle(), and ResolveUnboundVariability().
const AtomicType * AtomicType::UniformBool [static] |
new AtomicType(AtomicType::TYPE_BOOL, Variability::Uniform, false)
Definition at line 331 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), SelectExpr::GetValue(), lConstFoldBinLogicalOp(), lEncodeType(), lLLVMTypeToISPCType(), lMatchingBoolType(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), IfStmt::TypeCheck(), DoStmt::TypeCheck(), BinaryExpr::TypeCheck(), ForStmt::TypeCheck(), and AssertStmt::TypeCheck().
const AtomicType * AtomicType::UniformDouble [static] |
new AtomicType(AtomicType::TYPE_DOUBLE, Variability::Uniform, false)
Definition at line 341 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lEncodeType(), lLLVMTypeToISPCType(), and BinaryExpr::Optimize().
const AtomicType * AtomicType::UniformFloat [static] |
new AtomicType(AtomicType::TYPE_FLOAT, Variability::Uniform, false)
Definition at line 338 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lEncodeType(), lLLVMTypeToISPCType(), and BinaryExpr::Optimize().
const AtomicType * AtomicType::UniformInt16 [static] |
new AtomicType(AtomicType::TYPE_INT16, Variability::Uniform, false)
Definition at line 333 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), lProcessPrintArg(), and UnaryExpr::Optimize().
const AtomicType * AtomicType::UniformInt32 [static] |
new AtomicType(AtomicType::TYPE_INT32, Variability::Uniform, false)
Definition at line 334 of file type.h.
Referenced by ConstExpr::ConstExpr(), DeclSpecs::GetBaseType(), ConstExpr::GetConstant(), BinaryExpr::GetType(), lArrayToPointer(), lDefineConstantInt(), lDefineConstantIntFunc(), lEmitPrePostIncDec(), lEncodeType(), lLLVMTypeToISPCType(), lProcessPrintArg(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), BinaryExpr::TypeCheck(), AssignExpr::TypeCheck(), ForeachStmt::TypeCheck(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), and SwitchStmt::TypeCheck().
const AtomicType * AtomicType::UniformInt64 [static] |
new AtomicType(AtomicType::TYPE_INT64, Variability::Uniform, false)
Definition at line 339 of file type.h.
Referenced by ConstExpr::ConstExpr(), ForeachActiveStmt::EmitCode(), ConstExpr::GetConstant(), BinaryExpr::GetType(), lEncodeType(), lLLVMTypeToISPCType(), UnaryExpr::Optimize(), BinaryExpr::TypeCheck(), AssignExpr::TypeCheck(), IndexExpr::TypeCheck(), and SwitchStmt::TypeCheck().
const AtomicType * AtomicType::UniformInt8 [static] |
new AtomicType(AtomicType::TYPE_INT8, Variability::Uniform, false)
Definition at line 332 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), lProcessPrintArg(), and UnaryExpr::Optimize().
const AtomicType * AtomicType::UniformUInt16 [static] |
new AtomicType(AtomicType::TYPE_UINT16, Variability::Uniform, false)
Definition at line 336 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), lProcessPrintArg(), and UnaryExpr::Optimize().
const AtomicType * AtomicType::UniformUInt32 [static] |
new AtomicType(AtomicType::TYPE_UINT32, Variability::Uniform, false)
Definition at line 337 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), SizeOfExpr::GetType(), TypeCastExpr::GetValue(), lEncodeType(), lLLVMTypeToISPCType(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), and NewExpr::TypeCheck().
const AtomicType * AtomicType::UniformUInt64 [static] |
new AtomicType(AtomicType::TYPE_UINT64, Variability::Uniform, false)
Definition at line 340 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), SizeOfExpr::GetType(), lEncodeType(), lLLVMTypeToISPCType(), UnaryExpr::Optimize(), SwitchStmt::TypeCheck(), and NewExpr::TypeCheck().
const AtomicType * AtomicType::UniformUInt8 [static] |
new AtomicType(AtomicType::TYPE_UINT8, Variability::Uniform, false)
Definition at line 335 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), lProcessPrintArg(), and UnaryExpr::Optimize().
const Variability AtomicType::variability [private] |
Definition at line 345 of file type.h.
Referenced by GetAsConstType(), GetAsNonConstType(), GetAsSOAType(), GetAsUnboundVariabilityType(), GetAsUniformType(), GetAsUnsignedType(), GetAsVaryingType(), GetCDeclaration(), GetDIType(), GetString(), GetVariability(), LLVMType(), Mangle(), and ResolveUnboundVariability().
| const AtomicType * AtomicType::VaryingBool |
new AtomicType(AtomicType::TYPE_BOOL, Variability::Varying, false)
Definition at line 331 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), SelectExpr::GetValue(), lConstFoldBinLogicalOp(), lCreateISPCSymbol(), lEmitLogicalOp(), lEncodeType(), lLLVMTypeToISPCType(), lMatchingBoolType(), FunctionEmitContext::maskedStore(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), SelectExpr::Optimize(), IfStmt::TypeCheck(), BinaryExpr::TypeCheck(), DoStmt::TypeCheck(), ForStmt::TypeCheck(), and AssertStmt::TypeCheck().
| const AtomicType * AtomicType::VaryingDouble |
new AtomicType(AtomicType::TYPE_DOUBLE, Variability::Varying, false)
Definition at line 341 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lEncodeType(), lLLVMTypeToISPCType(), FunctionEmitContext::maskedStore(), BinaryExpr::Optimize(), and SelectExpr::Optimize().
| const AtomicType * AtomicType::VaryingFloat |
new AtomicType(AtomicType::TYPE_FLOAT, Variability::Varying, false)
Definition at line 338 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lEncodeType(), lLLVMTypeToISPCType(), FunctionEmitContext::maskedStore(), BinaryExpr::Optimize(), and SelectExpr::Optimize().
| const AtomicType * AtomicType::VaryingInt16 |
new AtomicType(AtomicType::TYPE_INT16, Variability::Varying, false)
Definition at line 333 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), and FunctionEmitContext::maskedStore().
| const AtomicType * AtomicType::VaryingInt32 |
new AtomicType(AtomicType::TYPE_INT32, Variability::Varying, false)
Definition at line 334 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lCreateISPCSymbol(), lDeclareSizeAndPtrIntTypes(), lDefineProgramIndex(), lEmitPrePostIncDec(), lEncodeType(), lLLVMTypeToISPCType(), lProcessPrintArg(), FunctionEmitContext::maskedStore(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), SelectExpr::Optimize(), IndexExpr::TypeCheck(), and SwitchStmt::TypeCheck().
| const AtomicType * AtomicType::VaryingInt64 |
new AtomicType(AtomicType::TYPE_INT64, Variability::Varying, false)
Definition at line 339 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lDeclareSizeAndPtrIntTypes(), lEncodeType(), lLLVMTypeToISPCType(), FunctionEmitContext::maskedStore(), SelectExpr::Optimize(), and SwitchStmt::TypeCheck().
| const AtomicType * AtomicType::VaryingInt8 |
new AtomicType(AtomicType::TYPE_INT8, Variability::Varying, false)
Definition at line 332 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), and FunctionEmitContext::maskedStore().
| const AtomicType * AtomicType::VaryingUInt16 |
new AtomicType(AtomicType::TYPE_UINT16, Variability::Varying, false)
Definition at line 336 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), and FunctionEmitContext::maskedStore().
| const AtomicType * AtomicType::VaryingUInt32 |
new AtomicType(AtomicType::TYPE_UINT32, Variability::Varying, false)
Definition at line 337 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), TypeCastExpr::GetValue(), lDeclareSizeAndPtrIntTypes(), lEncodeType(), lLLVMTypeToISPCType(), FunctionEmitContext::maskedStore(), UnaryExpr::Optimize(), BinaryExpr::Optimize(), and SelectExpr::Optimize().
| const AtomicType * AtomicType::VaryingUInt64 |
new AtomicType(AtomicType::TYPE_UINT64, Variability::Varying, false)
Definition at line 340 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lDeclareSizeAndPtrIntTypes(), lEncodeType(), lLLVMTypeToISPCType(), FunctionEmitContext::maskedStore(), and SelectExpr::Optimize().
| const AtomicType * AtomicType::VaryingUInt8 |
new AtomicType(AtomicType::TYPE_UINT8, Variability::Varying, false)
Definition at line 335 of file type.h.
Referenced by ConstExpr::ConstExpr(), ConstExpr::GetConstant(), lLLVMTypeToISPCType(), and FunctionEmitContext::maskedStore().
const AtomicType * AtomicType::Void [static] |
new AtomicType(TYPE_VOID, Variability::Uniform, false)
Definition at line 342 of file type.h.
Referenced by Module::AddFunctionDeclaration(), Module::AddGlobalVariable(), FunctionEmitContext::CurrentLanesReturned(), FunctionEmitContext::FunctionEmitContext(), GetStructTypesNamesPositions(), SyncExpr::GetType(), FunctionCallExpr::GetValue(), TypeCastExpr::GetValue(), Declaration::GetVariableDeclarations(), Declarator::InitFromType(), lApplyTypeQualifiers(), lDoTypeConv(), lLLVMTypeToISPCType(), FunctionEmitContext::ReturnInst(), FunctionCallExpr::TypeCheck(), IndexExpr::TypeCheck(), TypeCastExpr::TypeCheck(), and PtrDerefExpr::TypeCheck().
1.7.5.1