// Simple binary arithmetic operators.
ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
+ // MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing
+ // an unsigned/signed value of type i[2*n], then return the top part.
+ MULHU, MULHS,
+
// Bitwise operators.
AND, OR, XOR, SHL, SRA, SRL,
// SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
// integer shift operations, just like ADD/SUB_PARTS. The operation
// ordering is:
- // [Lo,Hi] = op [LoLHS,HiLHS], [LoRHS,HiRHS]
+ // [Lo,Hi] = op [LoLHS,HiLHS], Amt
SHL_PARTS, SRA_PARTS, SRL_PARTS,
// Conversion operators. These are all single input single output
// FP_EXTEND - Extend a smaller FP type into a larger FP type.
FP_EXTEND,
+ // FNEG, FABS - Perform unary floating point negation and absolute value
+ // operations.
+ FNEG, FABS,
+
// Other operators. LOAD and STORE have token chains as their first
// operand, then the same operands as an LLVM load/store instruction.
LOAD, STORE,
// to if the condition is true.
BRCOND,
+ // BRCONDTWOWAY - Two-way conditional branch. The first operand is the
+ // chain, the second is the condition, the third is the block to branch to
+ // if true, and the forth is the block to branch to if false. Targets
+ // usually do not implement this, preferring to have legalize demote the
+ // operation to BRCOND/BR pairs when necessary.
+ BRCONDTWOWAY,
+
// RET - Return from function. The first operand is the chain,
// and any subsequent operands are the return values for the
// function. This operation can have variable number of operands.
bool isNullValue() const { return Value == 0; }
bool isAllOnesValue() const {
- return Value == (1ULL << MVT::getSizeInBits(getValueType(0)))-1;
+ int NumBits = MVT::getSizeInBits(getValueType(0));
+ if (NumBits == 64) return Value+1 == 0;
+ return Value == (1ULL << NumBits)-1;
}
static bool classof(const ConstantSDNode *) { return true; }