Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: src/IceDefs.h

Issue 353553004: Add support for vector types and vector constants. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: 1) Remove StringList. 2) Assign redundant assign TODO to stichnot. 3) Fix RUN line. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | src/IceGlobalContext.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares various useful types and classes that have 10 // This file declares various useful types and classes that have
(...skipping 11 matching lines...) Expand all
22 #include <cstdio> // snprintf 22 #include <cstdio> // snprintf
23 #include <functional> // std::less 23 #include <functional> // std::less
24 #include <list> 24 #include <list>
25 #include <map> 25 #include <map>
26 #include <set> 26 #include <set>
27 #include <string> 27 #include <string>
28 #include <vector> 28 #include <vector>
29 29
30 #include "llvm/ADT/BitVector.h" 30 #include "llvm/ADT/BitVector.h"
31 #include "llvm/ADT/SmallBitVector.h" 31 #include "llvm/ADT/SmallBitVector.h"
32 #include "llvm/ADT/SmallVector.h"
32 #include "llvm/ADT/STLExtras.h" 33 #include "llvm/ADT/STLExtras.h"
33 #include "llvm/Support/Casting.h" 34 #include "llvm/Support/Casting.h"
34 #include "llvm/Support/Compiler.h" // LLVM_STATIC_ASSERT 35 #include "llvm/Support/Compiler.h" // LLVM_STATIC_ASSERT
35 #include "llvm/Support/raw_ostream.h" 36 #include "llvm/Support/raw_ostream.h"
36 #include "llvm/Support/Timer.h" 37 #include "llvm/Support/Timer.h"
37 38
38 // Roll our own static_assert<> in the absence of C++11. TODO: change 39 // Roll our own static_assert<> in the absence of C++11. TODO: change
39 // to static_assert<> with C++11. 40 // to static_assert<> with C++11.
40 template <bool> struct staticAssert; 41 template <bool> struct staticAssert;
41 template <> struct staticAssert<true> {}; // only true is defined 42 template <> struct staticAssert<true> {}; // only true is defined
(...skipping 16 matching lines...) Expand all
58 59
59 // TODO: Switch over to LLVM's ADT container classes. 60 // TODO: Switch over to LLVM's ADT container classes.
60 // http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure- for-a-task 61 // http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure- for-a-task
61 typedef std::string IceString; 62 typedef std::string IceString;
62 typedef std::list<Inst *> InstList; 63 typedef std::list<Inst *> InstList;
63 typedef std::list<InstPhi *> PhiList; 64 typedef std::list<InstPhi *> PhiList;
64 typedef std::vector<Variable *> VarList; 65 typedef std::vector<Variable *> VarList;
65 typedef std::vector<CfgNode *> NodeList; 66 typedef std::vector<CfgNode *> NodeList;
66 typedef std::vector<Constant *> ConstantList; 67 typedef std::vector<Constant *> ConstantList;
67 68
69 const unsigned VECT128_BYTES = 16;
70 // TODO(stichnot): Switch Vect128 to std::array after C++11
71 typedef llvm::SmallVector<char, VECT128_BYTES> Vect128;
JF 2014/06/30 17:48:50 You should use uint8_t here. I'd also name the cla
wala 2014/06/30 22:13:24 Unless vector constants are supported, this type i
72 typedef llvm::SmallVector<bool, VECT128_BYTES> BitVect;
JF 2014/06/30 17:48:50 Can you add a comment that explains this type?
wala 2014/06/30 22:13:24 Unless vector constants are supported, this type i
73
68 // SizeT is for holding small-ish limits like number of source 74 // SizeT is for holding small-ish limits like number of source
69 // operands in an instruction. It is used instead of size_t (which 75 // operands in an instruction. It is used instead of size_t (which
70 // may be 64-bits wide) when we want to save space. 76 // may be 64-bits wide) when we want to save space.
71 typedef uint32_t SizeT; 77 typedef uint32_t SizeT;
72 78
73 // InstNumberT is for holding an instruction number. Instruction 79 // InstNumberT is for holding an instruction number. Instruction
74 // numbers are used for representing Variable live ranges. 80 // numbers are used for representing Variable live ranges.
75 typedef int32_t InstNumberT; 81 typedef int32_t InstNumberT;
76 82
77 enum LivenessMode { 83 enum LivenessMode {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 146
141 private: 147 private:
142 const llvm::TimeRecord Start; 148 const llvm::TimeRecord Start;
143 Timer(const Timer &) LLVM_DELETED_FUNCTION; 149 Timer(const Timer &) LLVM_DELETED_FUNCTION;
144 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; 150 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION;
145 }; 151 };
146 152
147 } // end of namespace Ice 153 } // end of namespace Ice
148 154
149 #endif // SUBZERO_SRC_ICEDEFS_H 155 #endif // SUBZERO_SRC_ICEDEFS_H
OLDNEW
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | src/IceGlobalContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698