|
Intel SPMD Program Compiler
1.3.0
|
Binary expression. More...
#include <expr.h>


Public Types | |
| enum | Op { Add, Sub, Mul, Div, Mod, Shl, Shr, Lt, Gt, Le, Ge, Equal, NotEqual, BitAnd, BitXor, BitOr, LogicalAnd, LogicalOr, Comma } |
Public Member Functions | |
| BinaryExpr (Op o, Expr *a, Expr *b, SourcePos p) | |
| llvm::Value * | GetValue (FunctionEmitContext *ctx) const |
| const Type * | GetType () const |
| void | Print () const |
| Expr * | Optimize () |
| Expr * | TypeCheck () |
| int | EstimateCost () const |
Public Attributes | |
| const Op | op |
| Expr * | arg0 |
| Expr * | arg1 |
| enum BinaryExpr::Op |
| int BinaryExpr::EstimateCost | ( | ) | const |
Definition at line 2575 of file expr.cpp.
References arg0, arg1, COST_COMPLEX_ARITH_OP, COST_SIMPLE_ARITH_LOGIC_OP, Div, Mod, NULL, and op.
| const Type * BinaryExpr::GetType | ( | ) | const [virtual] |
Returns the Type of the expression.
Implements Expr.
Definition at line 1932 of file expr.cpp.
References Add, arg0, arg1, AssertPos, BitAnd, BitOr, BitXor, Comma, Div, Equal, FATAL, Opt::force32BitAddressing, g, Ge, Type::GetAsVaryingType(), Expr::GetType(), Gt, Target::is32Bit, Type::IsVaryingType(), Le, lMatchingBoolType(), LogicalAnd, LogicalOr, lOpString(), Lt, Mod, Type::MoreGeneralType(), Mul, NotEqual, NULL, op, Globals::opt, Shl, Shr, Sub, Globals::target, AtomicType::UniformInt32, and AtomicType::UniformInt64.
Referenced by Print().
| llvm::Value * BinaryExpr::GetValue | ( | FunctionEmitContext * | ctx | ) | const [virtual] |
This is the main method for Expr implementations to implement. It should call methods in the FunctionEmitContext to emit LLVM IR instructions to the current basic block in order to generate an llvm::Value that represents the expression's value.
Implements Expr.
Definition at line 1876 of file expr.cpp.
References Add, arg0, arg1, AssertPos, BitAnd, BitOr, BitXor, Comma, Div, Equal, Module::errorCount, FATAL, Ge, Expr::GetType(), Expr::GetValue(), Gt, Type::IsUnsignedType(), Type::IsVaryingType(), Le, lEmitBinaryArith(), lEmitBinaryBitOp(), lEmitBinaryCmp(), lEmitLogicalOp(), LogicalAnd, LogicalOr, Lt, m, Mod, Mul, NotEqual, NULL, op, PerformanceWarning(), FunctionEmitContext::SetDebugPos(), Shl, Shr, and Sub.
| Expr * BinaryExpr::Optimize | ( | ) | [virtual] |
This method should perform early optimizations of the expression (constant folding, etc.) and return a pointer to the resulting expression. If an error is encountered during optimization, NULL should be returned.
Implements Expr.
Definition at line 2125 of file expr.cpp.
References arg0, arg1, ConstExpr::AsBool(), ConstExpr::AsDouble(), ConstExpr::AsFloat(), ConstExpr::AsInt32(), AssertPos, ConstExpr::AsUInt32(), BinaryExpr(), Div, Type::Equal(), Type::EqualIgnoringConst(), Opt::fastMath, g, Type::GetAsNonConstType(), Expr::GetType(), ConstExpr::GetType(), int32_t, ISPC_MAX_NVEC, lConstFoldBinArithOp(), lConstFoldBinIntOp(), lConstFoldBinLogicalOp(), lConstFoldBoolBinOp(), SymbolTable::LookupFunction(), m, Mul, NULL, op, Globals::opt, Module::symbolTable, TypeCheck(), AtomicType::UniformBool, AtomicType::UniformDouble, AtomicType::UniformFloat, AtomicType::UniformInt32, AtomicType::UniformUInt32, AtomicType::VaryingBool, AtomicType::VaryingDouble, AtomicType::VaryingFloat, AtomicType::VaryingInt32, AtomicType::VaryingUInt32, and Warning().
| void BinaryExpr::Print | ( | ) | const [virtual] |
Prints the expression to standard output (used for debugging).
Implements Expr.
Definition at line 2586 of file expr.cpp.
References arg0, arg1, GetType(), lOpString(), op, Expr::Print(), and SourcePos::Print().
| Expr * BinaryExpr::TypeCheck | ( | ) | [virtual] |
This method should perform type checking of the expression and return a pointer to the resulting expression. If an error is encountered, NULL should be returned.
Implements Expr.
Definition at line 2270 of file expr.cpp.
References Add, arg0, arg1, AssertPos, BitAnd, BitOr, BitXor, Comma, Div, Equal, Error(), FATAL, g, Ge, Type::GetAsVaryingType(), PointerType::GetBaseType(), VectorType::GetElementCount(), Type::GetSOAWidth(), Type::GetString(), PointerType::GetString(), Expr::GetType(), Gt, Target::is32Bit, Type::IsBoolType(), Type::IsFloatType(), Type::IsIntType(), Type::IsNumericType(), Type::IsUniformType(), Type::IsVaryingType(), PointerType::IsVoidPointer(), lArrayToPointer(), Le, lIsAllIntZeros(), LogicalAnd, LogicalOr, lOpString(), Lt, Mod, Type::MoreGeneralType(), Mul, NotEqual, NULL, op, Shl, Shr, Sub, Globals::target, TypeConvertExpr(), AtomicType::UniformBool, AtomicType::UniformInt32, AtomicType::UniformInt64, Union(), and AtomicType::VaryingBool.
Referenced by Optimize().
Definition at line 165 of file expr.h.
Referenced by BinaryExpr(), EstimateCost(), GetType(), GetValue(), Optimize(), Print(), and TypeCheck().
Definition at line 165 of file expr.h.
Referenced by BinaryExpr(), EstimateCost(), GetType(), GetValue(), Optimize(), Print(), and TypeCheck().
| const Op BinaryExpr::op |
Definition at line 164 of file expr.h.
Referenced by EstimateCost(), GetType(), GetValue(), Optimize(), Print(), and TypeCheck().
1.7.5.1