[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2007-05-04 Thread Bill Wendling


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.10 -> 1.11
---
Log message:

Add an "implies" field to features. This indicates that, if the current
feature is set, then the features in the implied list should be set also.
The opposite is also enforced: if a feature in the implied list isn't set,
then the feature that owns that implies list shouldn't be set either.


---
Diffs of the changes:  (+1 -0)

 SubtargetFeature.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.10 
llvm/include/llvm/Target/SubtargetFeature.h:1.11
--- llvm/include/llvm/Target/SubtargetFeature.h:1.10Sat Dec 16 23:15:12 2006
+++ llvm/include/llvm/Target/SubtargetFeature.h Fri May  4 15:38:40 2007
@@ -34,6 +34,7 @@
   const char *Key;  // K-V key string
   const char *Desc; // Help descriptor
   uint32_t Value;   // K-V integer value
+  uint32_t Implies; // K-V bit mask
   
   // Compare routine for std binary search
   bool operator<(const SubtargetFeatureKV &S) const {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2006-12-16 Thread Bill Wendling


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.9 -> 1.10
---
Log message:

Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


---
Diffs of the changes:  (+1 -0)

 SubtargetFeature.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.9 
llvm/include/llvm/Target/SubtargetFeature.h:1.10
--- llvm/include/llvm/Target/SubtargetFeature.h:1.9 Tue Dec 12 13:26:50 2006
+++ llvm/include/llvm/Target/SubtargetFeature.h Sat Dec 16 23:15:12 2006
@@ -98,6 +98,7 @@
   
   /// Print feature string.
   void print(std::ostream &OS) const;
+  void print(std::ostream *OS) const { if (OS) print(*OS); }
   
   // Dump feature info.
   void dump() const;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h TargetSubtarget.h

2006-12-12 Thread Jim Laskey


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.8 -> 1.9
TargetSubtarget.h updated: 1.3 -> 1.4
---
Log message:

Rollback changes to take a different tack.

---
Diffs of the changes:  (+0 -6)

 SubtargetFeature.h |3 ---
 TargetSubtarget.h  |3 ---
 2 files changed, 6 deletions(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.8 
llvm/include/llvm/Target/SubtargetFeature.h:1.9
--- llvm/include/llvm/Target/SubtargetFeature.h:1.8 Tue Dec 12 10:07:33 2006
+++ llvm/include/llvm/Target/SubtargetFeature.h Tue Dec 12 13:26:50 2006
@@ -81,9 +81,6 @@
   /// Set the CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
   void setCPU(const std::string &String);
   
-  /// Get the CPU string.
-  const std::string &getCPU() const { return Features[0]; }
-  
   /// Setting CPU string only if no string is set.
   void setCPUIfNone(const std::string &String);
   


Index: llvm/include/llvm/Target/TargetSubtarget.h
diff -u llvm/include/llvm/Target/TargetSubtarget.h:1.3 
llvm/include/llvm/Target/TargetSubtarget.h:1.4
--- llvm/include/llvm/Target/TargetSubtarget.h:1.3  Tue Dec 12 10:07:33 2006
+++ llvm/include/llvm/Target/TargetSubtarget.h  Tue Dec 12 13:26:50 2006
@@ -27,13 +27,10 @@
 class TargetSubtarget {
   TargetSubtarget(const TargetSubtarget&);   // DO NOT IMPLEMENT
   void operator=(const TargetSubtarget&);  // DO NOT IMPLEMENT
-  std::string CPU; // CPU name.
 protected: // Can only create subclasses...
   TargetSubtarget();
 public:
   virtual ~TargetSubtarget();
-  void setCPU(const std::string &C) { CPU = C; }
-  const std::string &getCPU() const { return CPU; }
 };
 
 } // End llvm namespace



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h TargetSubtarget.h

2006-12-12 Thread Jim Laskey


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.7 -> 1.8
TargetSubtarget.h updated: 1.2 -> 1.3
---
Log message:

Honor the command line specification for machine type.

---
Diffs of the changes:  (+8 -0)

 SubtargetFeature.h |3 +++
 TargetSubtarget.h  |5 +
 2 files changed, 8 insertions(+)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.7 
llvm/include/llvm/Target/SubtargetFeature.h:1.8
--- llvm/include/llvm/Target/SubtargetFeature.h:1.7 Fri Mar 24 04:00:56 2006
+++ llvm/include/llvm/Target/SubtargetFeature.h Tue Dec 12 10:07:33 2006
@@ -81,6 +81,9 @@
   /// Set the CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
   void setCPU(const std::string &String);
   
+  /// Get the CPU string.
+  const std::string &getCPU() const { return Features[0]; }
+  
   /// Setting CPU string only if no string is set.
   void setCPUIfNone(const std::string &String);
   


Index: llvm/include/llvm/Target/TargetSubtarget.h
diff -u llvm/include/llvm/Target/TargetSubtarget.h:1.2 
llvm/include/llvm/Target/TargetSubtarget.h:1.3
--- llvm/include/llvm/Target/TargetSubtarget.h:1.2  Mon Jul 11 21:41:19 2005
+++ llvm/include/llvm/Target/TargetSubtarget.h  Tue Dec 12 10:07:33 2006
@@ -14,6 +14,8 @@
 #ifndef LLVM_TARGET_TARGETSUBTARGET_H
 #define LLVM_TARGET_TARGETSUBTARGET_H
 
+#include 
+
 namespace llvm {
 
 
//===--===//
@@ -25,10 +27,13 @@
 class TargetSubtarget {
   TargetSubtarget(const TargetSubtarget&);   // DO NOT IMPLEMENT
   void operator=(const TargetSubtarget&);  // DO NOT IMPLEMENT
+  std::string CPU; // CPU name.
 protected: // Can only create subclasses...
   TargetSubtarget();
 public:
   virtual ~TargetSubtarget();
+  void setCPU(const std::string &C) { CPU = C; }
+  const std::string &getCPU() const { return CPU; }
 };
 
 } // End llvm namespace



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2006-03-24 Thread Jim Laskey


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.6 -> 1.7
---
Log message:

Clean up some commentary.


---
Diffs of the changes:  (+1 -1)

 SubtargetFeature.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.6 
llvm/include/llvm/Target/SubtargetFeature.h:1.7
--- llvm/include/llvm/Target/SubtargetFeature.h:1.6 Thu Jan 26 14:41:32 2006
+++ llvm/include/llvm/Target/SubtargetFeature.h Fri Mar 24 04:00:56 2006
@@ -2,7 +2,7 @@
 //
 // The LLVM Compiler Infrastructure
 //
-// This file was developed by Jim Laskey and is distributed under the 
+// This file was developed by James M. Laskey and is distributed under the 
 // University of Illinois Open Source License. See LICENSE.TXT for details.
 //
 
//===--===//



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2006-01-26 Thread Jeff Cohen


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.5 -> 1.6
---
Log message:

Improve compatibility with VC2005, patch by Morten Ofstad!

---
Diffs of the changes:  (+4 -4)

 SubtargetFeature.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.5 
llvm/include/llvm/Target/SubtargetFeature.h:1.6
--- llvm/include/llvm/Target/SubtargetFeature.h:1.5 Tue Oct 25 10:15:28 2005
+++ llvm/include/llvm/Target/SubtargetFeature.h Thu Jan 26 14:41:32 2006
@@ -36,8 +36,8 @@
   uint32_t Value;   // K-V integer value
   
   // Compare routine for std binary search
-  bool operator<(const std::string &S) const {
-return strcmp(Key, S.c_str()) < 0;
+  bool operator<(const SubtargetFeatureKV &S) const {
+return strcmp(Key, S.Key) < 0;
   }
 };
   
@@ -51,8 +51,8 @@
   void *Value;  // K-V pointer value
   
   // Compare routine for std binary search
-  bool operator<(const std::string &S) const {
-return strcmp(Key, S.c_str()) < 0;
+  bool operator<(const SubtargetInfoKV &S) const {
+return strcmp(Key, S.Key) < 0;
   }
 };
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2005-10-25 Thread Jim Laskey


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.4 -> 1.5
---
Log message:

Preparation of supporting scheduling info.  Need to find info based on selected
CPU.



---
Diffs of the changes:  (+27 -9)

 SubtargetFeature.h |   36 +++-
 1 files changed, 27 insertions(+), 9 deletions(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.4 
llvm/include/llvm/Target/SubtargetFeature.h:1.5
--- llvm/include/llvm/Target/SubtargetFeature.h:1.4 Sun Oct 23 00:25:19 2005
+++ llvm/include/llvm/Target/SubtargetFeature.h Tue Oct 25 10:15:28 2005
@@ -43,6 +43,21 @@
   
 
//===--===//
 ///
+/// SubtargetInfoKV - Used to provide key value pairs for CPU and arbitrary
+/// pointers.
+//
+struct SubtargetInfoKV {
+  const char *Key;  // K-V key string
+  void *Value;  // K-V pointer value
+  
+  // Compare routine for std binary search
+  bool operator<(const std::string &S) const {
+return strcmp(Key, S.c_str()) < 0;
+  }
+};
+  
+//===--===//
+///
 /// SubtargetFeatures - Manages the enabling and disabling of subtarget 
 /// specific features.  Features are encoded as a string of the form
 ///   "cpu,+attr1,+attr2,-attr3,...,+attrN"
@@ -63,20 +78,23 @@
   std::string getString() const;
   void setString(const std::string &Initial);
 
-  /// Setting CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
-  ///
+  /// Set the CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
   void setCPU(const std::string &String);
   
+  /// Setting CPU string only if no string is set.
+  void setCPUIfNone(const std::string &String);
+  
   /// Adding Features.
   void AddFeature(const std::string &String, bool IsEnabled = true);

-  /// Parse feature string for quick usage.
-  static uint32_t Parse(const std::string &String,
-const std::string &DefaultCPU,
-const SubtargetFeatureKV *CPUTable,
-size_t CPUTableSize,
-const SubtargetFeatureKV *FeatureTable,
-size_t FeatureTableSize);
+  /// Get feature bits.
+  uint32_t getBits(const SubtargetFeatureKV *CPUTable,
+ size_t CPUTableSize,
+   const SubtargetFeatureKV *FeatureTable,
+ size_t FeatureTableSize);
+ 
+  /// Get info pointer
+  void *getInfo(const SubtargetInfoKV *Table, size_t TableSize);
   
   /// Print feature string.
   void print(std::ostream &OS) const;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/SubtargetFeature.h

2005-10-22 Thread Chris Lattner


Changes in directory llvm/include/llvm/Target:

SubtargetFeature.h updated: 1.3 -> 1.4
---
Log message:

Move static functions to .cpp file, reduce #includes, pass strings by 
const&.


---
Diffs of the changes:  (+7 -68)

 SubtargetFeature.h |   75 -
 1 files changed, 7 insertions(+), 68 deletions(-)


Index: llvm/include/llvm/Target/SubtargetFeature.h
diff -u llvm/include/llvm/Target/SubtargetFeature.h:1.3 
llvm/include/llvm/Target/SubtargetFeature.h:1.4
--- llvm/include/llvm/Target/SubtargetFeature.h:1.3 Fri Sep  2 14:27:43 2005
+++ llvm/include/llvm/Target/SubtargetFeature.h Sun Oct 23 00:25:19 2005
@@ -18,11 +18,9 @@
 #ifndef LLVM_TARGET_SUBTARGETFEATURE_H
 #define LLVM_TARGET_SUBTARGETFEATURE_H
 
-
 #include 
 #include 
-#include 
-#include 
+#include 
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
@@ -57,80 +55,21 @@
 ///
 
 class SubtargetFeatures {
-private:
   std::vector Features;// Subtarget features as a vector
-
-  // Determine if a feature has a flag; '+' or '-'
-  static inline bool hasFlag(const std::string &Feature) {
-assert(!Feature.empty() && "Empty string");
-// Get first character
-char Ch = Feature[0];
-// Check if first character is '+' or '-' flag
-return Ch == '+' || Ch =='-';
-  }
-  
-  // Return true if enable flag; '+'.
-  static inline bool isEnabled(const std::string &Feature) {
-assert(!Feature.empty() && "Empty string");
-// Get first character
-char Ch = Feature[0];
-// Check if first character is '+' for enabled
-return Ch == '+';
-  }
-  
-  // Return a string with a prepended flag; '+' or '-'.
-  static inline std::string PrependFlag(const std::string &Feature,
-bool IsEnabled) {
-assert(!Feature.empty() && "Empty string");
-if (hasFlag(Feature)) return Feature;
-return std::string(IsEnabled ? "+" : "-") + Feature;
-  }
-  
-  // Return string stripped of flag.
-  static inline std::string StripFlag(const std::string &Feature) {
-return hasFlag(Feature) ? Feature.substr(1) : Feature;
-  }
-
-  /// Splits a string of comma separated items in to a vector of strings.
-  static void Split(std::vector &V, const std::string &S);
-  
-  /// Join a vector of strings into a string with a comma separating each
-  /// item.
-  static std::string Join(const std::vector &V);
-  
-  /// Convert a string to lowercase.
-  static std::string toLower(const std::string &S);
-  
-  /// Find item in array using binary search.
-  static const SubtargetFeatureKV *Find(const std::string &S,
-const SubtargetFeatureKV *A, size_t L);
-
 public:
-  /// Ctor.
-  SubtargetFeatures(const std::string Initial = std::string()) {
-// Break up string into separate features
-Split(Features, Initial);
-  }
+  SubtargetFeatures(const std::string &Initial = std::string());
 
   /// Features string accessors.
-  inline std::string getString() const { return Join(Features); }
-  void setString(const std::string &Initial) {
-// Throw out old features
-Features.clear();
-// Break up string into separate features
-Split(Features, toLower(Initial));
-  }
+  std::string getString() const;
+  void setString(const std::string &Initial);
 
   /// Setting CPU string.  Replaces previous setting.  Setting to "" clears 
CPU.
-  void setCPU(std::string String) { Features[0] = toLower(String); }
+  ///
+  void setCPU(const std::string &String);
   
   /// Adding Features.
   void AddFeature(const std::string &String, bool IsEnabled = true);
-
-  /// Display help for feature choices.
-  static void Help(const char *Heading,
-   const SubtargetFeatureKV *Table, size_t TableSize);
-
+   
   /// Parse feature string for quick usage.
   static uint32_t Parse(const std::string &String,
 const std::string &DefaultCPU,



___
llvm-commits mailing list
[EMAIL PROTECTED]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits