mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Document the decision to assume that the cost of floats is twice as much as integers.
llvm-svn: 179478
This commit is contained in:
parent
3b790b7f2e
commit
df6d0d6209
@ -205,11 +205,13 @@ unsigned BasicTTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty,
|
||||
std::pair<unsigned, MVT> LT = TLI->getTypeLegalizationCost(Ty);
|
||||
|
||||
bool IsFloat = Ty->getScalarType()->isFloatingPointTy();
|
||||
// Assume that floating point arithmetic operations cost twice as much as
|
||||
// integer operations.
|
||||
unsigned OpCost = (IsFloat ? 2 : 1);
|
||||
|
||||
if (TLI->isOperationLegalOrPromote(ISD, LT.second)) {
|
||||
// The operation is legal. Assume it costs 1.
|
||||
// If the type is split to multiple registers, assume that thre is some
|
||||
// If the type is split to multiple registers, assume that there is some
|
||||
// overhead to this.
|
||||
// TODO: Once we have extract/insert subvector cost we need to use them.
|
||||
if (LT.first > 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user