summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/Makefile92
-rw-r--r--src/gallium/auxiliary/gallivm/SConscript16
-rw-r--r--src/gallium/auxiliary/gallivm/tgsitollvm.cpp70
3 files changed, 35 insertions, 143 deletions
diff --git a/src/gallium/auxiliary/gallivm/Makefile b/src/gallium/auxiliary/gallivm/Makefile
deleted file mode 100644
index 5a96d94ec3..0000000000
--- a/src/gallium/auxiliary/gallivm/Makefile
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*-makefile-*-
-TOP = ../../../..
-include $(TOP)/configs/current
-
-LIBNAME = gallivm
-
-
-GALLIVM_SOURCES = \
- gallivm.cpp \
- gallivm_cpu.cpp \
- instructions.cpp \
- loweringpass.cpp \
- tgsitollvm.cpp \
- storage.cpp \
- storagesoa.cpp \
- instructionssoa.cpp
-
-INC_SOURCES = gallivm_builtins.cpp gallivmsoabuiltins.cpp
-
-CPP_SOURCES = \
- $(GALLIVM_SOURCES)
-
-C_SOURCES =
-ASM_SOURCES =
-
-OBJECTS = $(C_SOURCES:.c=.o) \
- $(CPP_SOURCES:.cpp=.o) \
- $(ASM_SOURCES:.S=.o)
-
-### Include directories
-INCLUDES = \
- -I. \
- -I$(TOP)/src/gallium/drivers \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/mesa \
- -I$(TOP)/include
-
-
-##### RULES #####
-
-.c.o:
- $(CC) -c $(INCLUDES) $(LLVM_CFLAGS) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.cpp.o:
- $(CXX) -c $(INCLUDES) $(LLVM_CXXFLAGS) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-
-##### TARGETS #####
-
-default:: depend symlinks $(LIBNAME)
-
-
-$(LIBNAME): $(OBJECTS) Makefile
- $(TOP)/bin/mklib -o $@ -static $(OBJECTS)
-
-
-depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(INC_SOURCES)
- rm -f depend
- touch depend
- $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \
- $(ASM_SOURCES) $(INC_SOURCES) 2> /dev/null
-
-
-gallivm_builtins.cpp: llvm_builtins.c
- clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp1.bin
- (echo "static const unsigned char llvm_builtins_data[] = {"; od -txC temp1.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
- rm temp1.bin
-
-gallivmsoabuiltins.cpp: soabuiltins.c
- clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp2.bin
- (echo "static const unsigned char soabuiltins_data[] = {"; od -txC temp2.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
- rm temp2.bin
-
-# Emacs tags
-tags:
- etags `find . -name \*.[ch]` `find ../include`
-
-
-# Remove .o and backup files
-clean:
- -rm -f *.o */*.o *~ *.so *~ server/*.o
- -rm -f depend depend.bak
- -rm -f gallivm_builtins.cpp
- -rm -f gallivmsoabuiltins.cpp
-
-symlinks:
-
-
-include depend
diff --git a/src/gallium/auxiliary/gallivm/SConscript b/src/gallium/auxiliary/gallivm/SConscript
deleted file mode 100644
index c0aa51b90a..0000000000
--- a/src/gallium/auxiliary/gallivm/SConscript
+++ /dev/null
@@ -1,16 +0,0 @@
-Import('*')
-
-gallivm = env.ConvenienceLibrary(
- target = 'gallivm',
- source = [
- 'gallivm.cpp',
- 'gallivm_cpu.cpp',
- 'instructions.cpp',
- 'loweringpass.cpp',
- 'tgsitollvm.cpp',
- 'storage.cpp',
- 'storagesoa.cpp',
- 'instructionssoa.cpp',
- ])
-
-auxiliaries.insert(0, gallivm)
diff --git a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
index bf84401e11..8f7d3b7100 100644
--- a/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
+++ b/src/gallium/auxiliary/gallivm/tgsitollvm.cpp
@@ -94,8 +94,8 @@ translate_declaration(struct gallivm_ir *prog,
unsigned first, last, mask;
uint interp_method;
- first = decl->DeclarationRange.First;
- last = decl->DeclarationRange.Last;
+ first = decl->Range.First;
+ last = decl->Range.Last;
mask = decl->Declaration.UsageMask;
/* Do not touch WPOS.xy */
@@ -149,7 +149,7 @@ translate_declarationir(struct gallivm_ir *,
struct tgsi_full_declaration *)
{
if (decl->Declaration.File == TGSI_FILE_ADDRESS) {
- int idx = decl->DeclarationRange.First;
+ int idx = decl->Range.First;
storage->addAddress(idx);
}
}
@@ -234,26 +234,26 @@ translate_instruction(llvm::Module *module,
inputs[3] = 0;
for (int i = 0; i < inst->Instruction.NumSrcRegs; ++i) {
- struct tgsi_full_src_register *src = &inst->FullSrcRegisters[i];
+ struct tgsi_full_src_register *src = &inst->Src[i];
llvm::Value *val = 0;
llvm::Value *indIdx = 0;
- if (src->SrcRegister.Indirect) {
- indIdx = storage->addrElement(src->SrcRegisterInd.Index);
+ if (src->Register.Indirect) {
+ indIdx = storage->addrElement(src->Indirect.Index);
indIdx = storage->extractIndex(indIdx);
}
- if (src->SrcRegister.File == TGSI_FILE_CONSTANT) {
- val = storage->constElement(src->SrcRegister.Index, indIdx);
- } else if (src->SrcRegister.File == TGSI_FILE_INPUT) {
- val = storage->inputElement(src->SrcRegister.Index, indIdx);
- } else if (src->SrcRegister.File == TGSI_FILE_TEMPORARY) {
- val = storage->tempElement(src->SrcRegister.Index);
- } else if (src->SrcRegister.File == TGSI_FILE_OUTPUT) {
- val = storage->outputElement(src->SrcRegister.Index, indIdx);
- } else if (src->SrcRegister.File == TGSI_FILE_IMMEDIATE) {
- val = storage->immediateElement(src->SrcRegister.Index);
+ if (src->Register.File == TGSI_FILE_CONSTANT) {
+ val = storage->constElement(src->Register.Index, indIdx);
+ } else if (src->Register.File == TGSI_FILE_INPUT) {
+ val = storage->inputElement(src->Register.Index, indIdx);
+ } else if (src->Register.File == TGSI_FILE_TEMPORARY) {
+ val = storage->tempElement(src->Register.Index);
+ } else if (src->Register.File == TGSI_FILE_OUTPUT) {
+ val = storage->outputElement(src->Register.Index, indIdx);
+ } else if (src->Register.File == TGSI_FILE_IMMEDIATE) {
+ val = storage->immediateElement(src->Register.Index);
} else {
- fprintf(stderr, "ERROR: not supported llvm source %d\n", src->SrcRegister.File);
+ fprintf(stderr, "ERROR: not supported llvm source %d\n", src->Register.File);
return;
}
@@ -552,7 +552,7 @@ translate_instruction(llvm::Module *module,
break;
case TGSI_OPCODE_SHL:
break;
- case TGSI_OPCODE_SHR:
+ case TGSI_OPCODE_ISHR:
break;
case TGSI_OPCODE_AND:
break;
@@ -656,14 +656,14 @@ translate_instruction(llvm::Module *module,
/* store results */
for (int i = 0; i < inst->Instruction.NumDstRegs; ++i) {
- struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i];
-
- if (dst->DstRegister.File == TGSI_FILE_OUTPUT) {
- storage->setOutputElement(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
- } else if (dst->DstRegister.File == TGSI_FILE_TEMPORARY) {
- storage->setTempElement(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
- } else if (dst->DstRegister.File == TGSI_FILE_ADDRESS) {
- storage->setAddrElement(dst->DstRegister.Index, out, dst->DstRegister.WriteMask);
+ struct tgsi_full_dst_register *dst = &inst->Dst[i];
+
+ if (dst->Register.File == TGSI_FILE_OUTPUT) {
+ storage->setOutputElement(dst->Register.Index, out, dst->Register.WriteMask);
+ } else if (dst->Register.File == TGSI_FILE_TEMPORARY) {
+ storage->setTempElement(dst->Register.Index, out, dst->Register.WriteMask);
+ } else if (dst->Register.File == TGSI_FILE_ADDRESS) {
+ storage->setAddrElement(dst->Register.Index, out, dst->Register.WriteMask);
} else {
fprintf(stderr, "ERROR: unsupported LLVM destination!");
assert(!"wrong destination");
@@ -683,16 +683,16 @@ translate_instructionir(llvm::Module *module,
std::vector< std::vector<llvm::Value*> > inputs(inst->Instruction.NumSrcRegs);
for (int i = 0; i < inst->Instruction.NumSrcRegs; ++i) {
- struct tgsi_full_src_register *src = &inst->FullSrcRegisters[i];
+ struct tgsi_full_src_register *src = &inst->Src[i];
std::vector<llvm::Value*> val;
llvm::Value *indIdx = 0;
int swizzle = swizzleInt(src);
- if (src->SrcRegister.Indirect) {
- indIdx = storage->addrElement(src->SrcRegisterInd.Index);
+ if (src->Register.Indirect) {
+ indIdx = storage->addrElement(src->Indirect.Index);
}
- val = storage->load((enum tgsi_file_type)src->SrcRegister.File,
- src->SrcRegister.Index, swizzle, instr->getIRBuilder(), indIdx);
+ val = storage->load((enum tgsi_file_type)src->Register.File,
+ src->Register.Index, swizzle, instr->getIRBuilder(), indIdx);
inputs[i] = val;
}
@@ -919,7 +919,7 @@ translate_instructionir(llvm::Module *module,
break;
case TGSI_OPCODE_SHL:
break;
- case TGSI_OPCODE_SHR:
+ case TGSI_OPCODE_ISHR:
break;
case TGSI_OPCODE_AND:
break;
@@ -993,9 +993,9 @@ translate_instructionir(llvm::Module *module,
/* store results */
for (int i = 0; i < inst->Instruction.NumDstRegs; ++i) {
- struct tgsi_full_dst_register *dst = &inst->FullDstRegisters[i];
- storage->store((enum tgsi_file_type)dst->DstRegister.File,
- dst->DstRegister.Index, out, dst->DstRegister.WriteMask,
+ struct tgsi_full_dst_register *dst = &inst->Dst[i];
+ storage->store((enum tgsi_file_type)dst->Register.File,
+ dst->Register.Index, out, dst->Register.WriteMask,
instr->getIRBuilder() );
}
}