aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r--lib/Target/TargetMachine.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp
index 83bd2f3a3d..69c7cfd428 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -1,11 +1,13 @@
//===-- TargetMachine.cpp - General Target Information ---------------------==//
//
// This file describes the general parts of a Target machine.
-// This file also implements the InstInfo interface as well...
+// This file also implements MachineInstrInfo and MachineCacheInfo.
//
//===----------------------------------------------------------------------===//
+#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MachineInstrInfo.h"
+#include "llvm/Target/MachineCacheInfo.h"
#include "llvm/DerivedTypes.h"
//---------------------------------------------------------------------------
@@ -85,3 +87,27 @@ MachineInstrInfo::constantFitsInImmedField(MachineOpCode opCode,
return false;
}
+
+
+//---------------------------------------------------------------------------
+// class MachineCacheInfo
+//
+// Purpose:
+// Describes properties of the target cache architecture.
+//---------------------------------------------------------------------------
+
+/*ctor*/
+MachineCacheInfo::MachineCacheInfo(const TargetMachine& tgt)
+ : target(tgt)
+{
+ Initialize();
+}
+
+void
+MachineCacheInfo::Initialize()
+{
+ numLevels = 2;
+ cacheLineSizes.push_back(16); cacheLineSizes.push_back(32);
+ cacheSizes.push_back(1 << 15); cacheSizes.push_back(1 << 20);
+ cacheAssoc.push_back(1); cacheAssoc.push_back(4);
+}