From 67e4b8299620db2e2f33795621b23e9827604bb1 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 26 Oct 2007 14:52:10 -0400 Subject: Get basic function calls working in the shaders. --- src/mesa/pipe/llvm/instructions.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mesa/pipe/llvm/instructions.h') diff --git a/src/mesa/pipe/llvm/instructions.h b/src/mesa/pipe/llvm/instructions.h index 82d871d410..85feb1665d 100644 --- a/src/mesa/pipe/llvm/instructions.h +++ b/src/mesa/pipe/llvm/instructions.h @@ -37,6 +37,7 @@ #include #include +#include #include namespace llvm { @@ -44,6 +45,8 @@ namespace llvm { class Function; } +class Storage; + class Instructions { public: @@ -55,7 +58,10 @@ public: llvm::Value *arl(llvm::Value *in1); llvm::Value *add(llvm::Value *in1, llvm::Value *in2); void beginLoop(); + void bgnSub(unsigned, Storage *); void brk(); + void cal(int label, llvm::Value *out, llvm::Value *in, + llvm::Value *cst); llvm::Value *cross(llvm::Value *in1, llvm::Value *in2); llvm::Value *dp3(llvm::Value *in1, llvm::Value *in2); llvm::Value *dp4(llvm::Value *in1, llvm::Value *in2); @@ -65,6 +71,7 @@ public: void endif(); void endLoop(); void end(); + void endSub(); llvm::Value *ex2(llvm::Value *in); llvm::Value *floor(llvm::Value *in); llvm::Value *frc(llvm::Value *in); @@ -101,6 +108,9 @@ private: llvm::Value *z, llvm::Value *w=0); llvm::Function *declarePrintf(); + llvm::Function *declareFunc(int label); + + llvm::Function *findFunction(int label); private: llvm::Module *m_mod; llvm::Function *m_func; @@ -125,6 +135,7 @@ private: llvm::BasicBlock *end; }; std::stack m_loopStack; + std::map m_functions; }; #endif -- cgit v1.2.3