mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Instruction::isAssociative() returns true for fmul/fadd if they are tagged "unsafe" mode.
Approved by: Eli and Michael. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -468,6 +468,20 @@ bool Instruction::isAssociative(unsigned Opcode) {
|
||||
Opcode == Add || Opcode == Mul;
|
||||
}
|
||||
|
||||
bool Instruction::isAssociative() const {
|
||||
unsigned Opcode = getOpcode();
|
||||
if (isAssociative(Opcode))
|
||||
return true;
|
||||
|
||||
switch (Opcode) {
|
||||
case FMul:
|
||||
case FAdd:
|
||||
return cast<FPMathOperator>(this)->hasUnsafeAlgebra();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// isCommutative - Return true if the instruction is commutative:
|
||||
///
|
||||
/// Commutative operators satisfy: (x op y) === (y op x)
|
||||
|
||||
Reference in New Issue
Block a user