diff options
author | Zack Rusin <zack@tungstengraphics.com> | 2007-11-05 13:41:56 -0500 |
---|---|---|
committer | Zack Rusin <zack@tungstengraphics.com> | 2007-12-11 09:48:13 -0500 |
commit | 8681deddd7a7e749adaf43c7df4313ea54922e62 (patch) | |
tree | 8b67c83fd0819b73c8c4842929a833292a8ceefd /src/mesa/pipe/llvm/storage.h | |
parent | c3af68dc5022715cc8f126b7df12f3f5248aefe7 (diff) |
Rewrite argument passing to prepare for handling of the kil instruction.
Pass the inputs/outputs pointer in the structure instead of infinitely
expanding arguments to the functions.
Diffstat (limited to 'src/mesa/pipe/llvm/storage.h')
-rw-r--r-- | src/mesa/pipe/llvm/storage.h | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/mesa/pipe/llvm/storage.h b/src/mesa/pipe/llvm/storage.h index aa02f02f85..7f1a8bf103 100644 --- a/src/mesa/pipe/llvm/storage.h +++ b/src/mesa/pipe/llvm/storage.h @@ -51,13 +51,9 @@ class Storage { public: Storage(llvm::BasicBlock *block, - llvm::Value *out, - llvm::Value *in, llvm::Value *consts, llvm::Value *temps); + llvm::Value *input); llvm::Value *inputPtr() const; - llvm::Value *outputPtr() const; - llvm::Value *constPtr() const; - llvm::Value *tempPtr() const; void setCurrentBlock(llvm::BasicBlock *block); @@ -81,8 +77,7 @@ public: int numConsts() const; - void pushArguments(llvm::Value *out, llvm::Value *in, - llvm::Value *constPtr, llvm::Value *temp); + void pushArguments(llvm::Value *input); void popArguments(); void pushTemps(); void popTemps(); @@ -93,17 +88,25 @@ private: llvm::Value *maskWrite(llvm::Value *src, int mask, llvm::Value *templ); const char *name(const char *prefix); + enum Args { + DestsArg = 0, + InputsArg = 1, + TempsArg = 2, + ConstsArg = 3, + KilArg = 4 + }; + llvm::Value *elemPtr(Args arg); + llvm::Value *elemIdx(llvm::Value *ptr, int idx, + llvm::Value *indIdx = 0); + llvm::Value *element(Args arg, int idx, llvm::Value *indIdx = 0); + private: llvm::BasicBlock *m_block; - llvm::Value *m_OUT; - llvm::Value *m_IN; - llvm::Value *m_CONST; - llvm::Value *m_TEMPS; + llvm::Value *m_INPUT; std::map<int, llvm::ConstantInt*> m_constInts; std::map<int, llvm::Constant*> m_intVecs; std::vector<llvm::Value*> m_addrs; - std::vector<llvm::Value*> m_dstCache; std::vector<llvm::Constant*> m_immediates; llvm::VectorType *m_floatVecType; @@ -121,13 +124,7 @@ private: llvm::Value *m_undefIntVec; llvm::Value *m_extSwizzleVec; - struct Args { - llvm::Value *out; - llvm::Value *in; - llvm::Value *cst; - llvm::Value *temp; - }; - std::stack<Args> m_argStack; + std::stack<llvm::Value*> m_argStack; std::stack<std::vector<llvm::Value*> > m_tempStack; }; |