diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/llvm/instructions.cpp | 22 | ||||
-rw-r--r-- | src/mesa/pipe/llvm/instructions.h | 1 | ||||
-rw-r--r-- | src/mesa/pipe/llvm/llvmtgsi.cpp | 4 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/pipe/llvm/instructions.cpp b/src/mesa/pipe/llvm/instructions.cpp index 62289ba62a..ee67ae0eed 100644 --- a/src/mesa/pipe/llvm/instructions.cpp +++ b/src/mesa/pipe/llvm/instructions.cpp @@ -280,3 +280,25 @@ llvm::Value * Instructions::dph(llvm::Value *in1, llvm::Value *in2) return vectorFromVals(dph, dph, dph, dph); } +llvm::Value * Instructions::dst(llvm::Value *in1, llvm::Value *in2) +{ + ExtractElementInst *y1 = new ExtractElementInst(in1, unsigned(1), + name("y1"), + m_block); + ExtractElementInst *z = new ExtractElementInst(in1, unsigned(2), + name("z"), + m_block); + ExtractElementInst *y2 = new ExtractElementInst(in2, unsigned(1), + name("y2"), + m_block); + ExtractElementInst *w = new ExtractElementInst(in2, unsigned(3), + name("w"), + m_block); + BinaryOperator *ry = BinaryOperator::create(Instruction::Mul, + y1, y2, + name("tyuy"), + m_block); + return vectorFromVals(ConstantFP::get(Type::FloatTy, APFloat(1.f)), + ry, z, w); +} + diff --git a/src/mesa/pipe/llvm/instructions.h b/src/mesa/pipe/llvm/instructions.h index fb8ac9b8cd..0ca9bd25a7 100644 --- a/src/mesa/pipe/llvm/instructions.h +++ b/src/mesa/pipe/llvm/instructions.h @@ -18,6 +18,7 @@ public: 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); llvm::Value *lit(llvm::Value *in1); llvm::Value *madd(llvm::Value *in1, llvm::Value *in2, llvm::Value *in2); diff --git a/src/mesa/pipe/llvm/llvmtgsi.cpp b/src/mesa/pipe/llvm/llvmtgsi.cpp index 9a5d3b8d9c..91c2d9beb8 100644 --- a/src/mesa/pipe/llvm/llvmtgsi.cpp +++ b/src/mesa/pipe/llvm/llvmtgsi.cpp @@ -209,7 +209,9 @@ translate_instruction(llvm::Module *module, out = instr->dp4(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_DST: + case TGSI_OPCODE_DST: { + out = instr->dst(inputs[0], inputs[1]); + } break; case TGSI_OPCODE_MIN: break; |