diff options
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r-- | src/gallium/auxiliary/gallivm/instructionssoa.cpp | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/tgsitollvm.cpp | 68 |
2 files changed, 24 insertions, 50 deletions
diff --git a/src/gallium/auxiliary/gallivm/instructionssoa.cpp b/src/gallium/auxiliary/gallivm/instructionssoa.cpp index 925e948763..721b7d2d83 100644 --- a/src/gallium/auxiliary/gallivm/instructionssoa.cpp +++ b/src/gallium/auxiliary/gallivm/instructionssoa.cpp @@ -24,6 +24,8 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * **************************************************************************/ + +#include <cstdio> #include "instructionssoa.h" #include "storagesoa.h" @@ -126,7 +128,7 @@ void InstructionsSoa::createFunctionMap() m_functionsMap[TGSI_OPCODE_DP4] = "dp4"; m_functionsMap[TGSI_OPCODE_MIN] = "min"; m_functionsMap[TGSI_OPCODE_MAX] = "max"; - m_functionsMap[TGSI_OPCODE_POWER] = "pow"; + m_functionsMap[TGSI_OPCODE_POW] = "pow"; m_functionsMap[TGSI_OPCODE_LIT] = "lit"; m_functionsMap[TGSI_OPCODE_RSQ] = "rsq"; m_functionsMap[TGSI_OPCODE_SLT] = "slt"; @@ -309,7 +311,7 @@ std::vector<llvm::Value*> InstructionsSoa::mul(const std::vector<llvm::Value*> i std::vector<llvm::Value*> InstructionsSoa::pow(const std::vector<llvm::Value*> in1, const std::vector<llvm::Value*> in2) { - llvm::Function *func = function(TGSI_OPCODE_POWER); + llvm::Function *func = function(TGSI_OPCODE_POW); return callBuiltin(func, in1, in2); } diff --git a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp index 5b08200d14..8d885e48be 100644 --- a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp +++ b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp @@ -160,10 +160,11 @@ translate_immediate(Storage *storage, { float vec[4]; int i; + assert( imm->Immediate.NrTokens <= 4 + 1 ); for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: - vec[i] = imm->u.ImmediateFloat32[i].Float; + vec[i] = imm->u[i].Float; break; default: assert(0); @@ -179,10 +180,11 @@ translate_immediateir(StorageSoa *storage, { float vec[4]; int i; + assert( imm->Immediate.NrTokens <= 4 + 1 ); for (i = 0; i < imm->Immediate.NrTokens - 1; ++i) { switch (imm->Immediate.DataType) { case TGSI_IMM_FLOAT32: - vec[i] = imm->u.ImmediateFloat32[i].Float; + vec[i] = imm->u[i].Float; break; default: assert(0); @@ -336,7 +338,7 @@ translate_instruction(llvm::Module *module, out = instr->sub(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_LERP: { + case TGSI_OPCODE_LRP: { out = instr->lerp(inputs[0], inputs[1], inputs[2]); } break; @@ -348,17 +350,11 @@ translate_instruction(llvm::Module *module, out = instr->cnd0(inputs[0], inputs[1], inputs[2]); } break; - case TGSI_OPCODE_DOT2ADD: { + case TGSI_OPCODE_DP2A: { out = instr->dot2add(inputs[0], inputs[1], inputs[2]); } break; - case TGSI_OPCODE_INDEX: - break; - case TGSI_OPCODE_NEGATE: { - out = instr->neg(inputs[0]); - } - break; - case TGSI_OPCODE_FRAC: { + case TGSI_OPCODE_FRC: { out = instr->frc(inputs[0]); } break; @@ -366,30 +362,28 @@ translate_instruction(llvm::Module *module, out = instr->clamp(inputs[0]); } break; - case TGSI_OPCODE_FLOOR: { + case TGSI_OPCODE_FLR: { out = instr->floor(inputs[0]); } break; case TGSI_OPCODE_ROUND: break; - case TGSI_OPCODE_EXPBASE2: { + case TGSI_OPCODE_EX2: { out = instr->ex2(inputs[0]); } break; - case TGSI_OPCODE_LOGBASE2: { + case TGSI_OPCODE_LG2: { out = instr->lg2(inputs[0]); } break; - case TGSI_OPCODE_POWER: { + case TGSI_OPCODE_POW: { out = instr->pow(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_CROSSPRODUCT: { + case TGSI_OPCODE_XPD: { out = instr->cross(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_MULTIPLYMATRIX: - break; case TGSI_OPCODE_ABS: { out = instr->abs(inputs[0]); } @@ -617,14 +611,6 @@ translate_instruction(llvm::Module *module, break; case TGSI_OPCODE_NOP: break; - case TGSI_OPCODE_M4X3: - break; - case TGSI_OPCODE_M3X4: - break; - case TGSI_OPCODE_M3X3: - break; - case TGSI_OPCODE_M3X2: - break; case TGSI_OPCODE_CALLNZ: break; case TGSI_OPCODE_IFC: @@ -778,44 +764,38 @@ translate_instructionir(llvm::Module *module, out = instr->sub(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_LERP: { + case TGSI_OPCODE_LRP: { } break; case TGSI_OPCODE_CND: break; case TGSI_OPCODE_CND0: break; - case TGSI_OPCODE_DOT2ADD: + case TGSI_OPCODE_DP2A: break; - case TGSI_OPCODE_INDEX: - break; - case TGSI_OPCODE_NEGATE: - break; - case TGSI_OPCODE_FRAC: { + case TGSI_OPCODE_FRC: { } break; case TGSI_OPCODE_CLAMP: break; - case TGSI_OPCODE_FLOOR: { + case TGSI_OPCODE_FLR: { } break; case TGSI_OPCODE_ROUND: break; - case TGSI_OPCODE_EXPBASE2: { + case TGSI_OPCODE_EX2: { } break; - case TGSI_OPCODE_LOGBASE2: { + case TGSI_OPCODE_LG2: { } break; - case TGSI_OPCODE_POWER: { + case TGSI_OPCODE_POW: { out = instr->pow(inputs[0], inputs[1]); } break; - case TGSI_OPCODE_CROSSPRODUCT: { + case TGSI_OPCODE_XPD: { } break; - case TGSI_OPCODE_MULTIPLYMATRIX: - break; case TGSI_OPCODE_ABS: { out = instr->abs(inputs[0]); } @@ -983,14 +963,6 @@ translate_instructionir(llvm::Module *module, break; case TGSI_OPCODE_NOP: break; - case TGSI_OPCODE_M4X3: - break; - case TGSI_OPCODE_M3X4: - break; - case TGSI_OPCODE_M3X3: - break; - case TGSI_OPCODE_M3X2: - break; case TGSI_OPCODE_NRM4: break; case TGSI_OPCODE_CALLNZ: |