diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-02 01:53:59 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-02 01:53:59 +0000 |
| commit | 7eb55b395fdbbdbd113aabb6cad51cc98b379af0 (patch) | |
| tree | 2666f67e03e73fc890b7277073186b32ead86d50 /llvm/lib/VMCore/Instructions.cpp | |
| parent | 57382066e875c05e58f35db5976a22ed5dcdebf8 (diff) | |
| download | bcm5719-llvm-7eb55b395fdbbdbd113aabb6cad51cc98b379af0.tar.gz bcm5719-llvm-7eb55b395fdbbdbd113aabb6cad51cc98b379af0.zip | |
For PR950:
Replace the REM instruction with UREM, SREM and FREM.
llvm-svn: 31369
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
| -rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 790f6ac8a65..3825d857634 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -1023,7 +1023,6 @@ void BinaryOperator::init(BinaryOps iType) switch (iType) { case Add: case Sub: case Mul: - case Rem: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); assert((getType()->isInteger() || getType()->isFloatingPoint() || @@ -1045,7 +1044,21 @@ void BinaryOperator::init(BinaryOps iType) cast<PackedType>(getType())->getElementType()->isFloatingPoint())) && "Incorrect operand type (not floating point) for FDIV"); break; - + case URem: + case SRem: + assert(getType() == LHS->getType() && + "Arithmetic operation should return same type as operands!"); + assert((getType()->isInteger() || (isa<PackedType>(getType()) && + cast<PackedType>(getType())->getElementType()->isInteger())) && + "Incorrect operand type (not integer) for S/UREM"); + break; + case FRem: + assert(getType() == LHS->getType() && + "Arithmetic operation should return same type as operands!"); + assert((getType()->isFloatingPoint() || (isa<PackedType>(getType()) && + cast<PackedType>(getType())->getElementType()->isFloatingPoint())) + && "Incorrect operand type (not floating point) for FREM"); + break; case And: case Or: case Xor: assert(getType() == LHS->getType() && |

