From 5040eefbb758fb0e02125ad3a6bfb3dba13cb7fa Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 24 Oct 2007 07:49:24 -0400 Subject: Implement arl, lerp opcodes and do a first stab at if/endif handling and branching support. --- src/mesa/pipe/llvm/instructions.h | 12 ++++++++++++ 1 file changed, 12 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 f7bc4a5839..ce2ce796d9 100644 --- a/src/mesa/pipe/llvm/instructions.h +++ b/src/mesa/pipe/llvm/instructions.h @@ -5,6 +5,8 @@ #include #include +#include + namespace llvm { class VectorType; class Function; @@ -15,16 +17,23 @@ class Instructions public: Instructions(llvm::Module *mod, llvm::Function *func, llvm::BasicBlock *block); + llvm::BasicBlock *currentBlock() const; + llvm::Value *abs(llvm::Value *in1); + llvm::Value *arl(llvm::Value *in1); llvm::Value *add(llvm::Value *in1, llvm::Value *in2); 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); llvm::Value *dph(llvm::Value *in1, llvm::Value *in2); llvm::Value *dst(llvm::Value *in1, llvm::Value *in2); + void endif(); llvm::Value *ex2(llvm::Value *in); llvm::Value *floor(llvm::Value *in); llvm::Value *frc(llvm::Value *in); + void ifop(llvm::Value *in); + llvm::Value *lerp(llvm::Value *in1, llvm::Value *in2, + llvm::Value *in3); llvm::Value *lit(llvm::Value *in); llvm::Value *lg2(llvm::Value *in); llvm::Value *madd(llvm::Value *in1, llvm::Value *in2, @@ -36,6 +45,7 @@ public: llvm::Value *rcp(llvm::Value *in); llvm::Value *rsq(llvm::Value *in); llvm::Value *sge(llvm::Value *in1, llvm::Value *in2); + llvm::Value *sgt(llvm::Value *in1, llvm::Value *in2); llvm::Value *slt(llvm::Value *in1, llvm::Value *in2); llvm::Value *sub(llvm::Value *in1, llvm::Value *in2); @@ -70,6 +80,8 @@ private: llvm::Function *m_llvmLit; llvm::Constant *m_fmtPtr; + + std::stack m_ifStack; }; #endif -- cgit v1.2.3