summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/llvm
diff options
context:
space:
mode:
authorZack Rusin <zack@tungstengraphics.com>2008-01-04 09:27:42 -0500
committerZack Rusin <zack@tungstengraphics.com>2008-01-04 09:27:42 -0500
commit9789c301b476b1127f847144fd5c8313e6ba8be8 (patch)
tree9d0de9d3d09063870b8671e2bec6679e1dd19d23 /src/mesa/pipe/llvm
parent3385f3d250df1ad6899c0ac59a8f6b845cc5d504 (diff)
llvm: we need custom rules so had to redo the build a little bit
also don't use sse when llvm is enabled
Diffstat (limited to 'src/mesa/pipe/llvm')
-rw-r--r--src/mesa/pipe/llvm/Makefile80
-rw-r--r--src/mesa/pipe/llvm/llvm_base_shader.cpp16
2 files changed, 88 insertions, 8 deletions
diff --git a/src/mesa/pipe/llvm/Makefile b/src/mesa/pipe/llvm/Makefile
new file mode 100644
index 0000000000..b1463f67cf
--- /dev/null
+++ b/src/mesa/pipe/llvm/Makefile
@@ -0,0 +1,80 @@
+# -*-makefile-*-
+TOP = ../../../..
+include $(TOP)/configs/current
+
+LIBNAME = gallivm
+
+
+GALLIVM_SOURCES = \
+ gallivm.cpp \
+ instructions.cpp \
+ storage.cpp
+
+INC_SOURCES = gallivm_builtins.cpp llvm_base_shader.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/mesa/pipe \
+ -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|llvm2cpp -gen-contents -o=$@ -f -for=shader -funcname=createGallivmBuiltins
+
+llvm_base_shader.cpp: llvm_entry.c
+ clang --emit-llvm $< |llvm-as |opt -std-compile-opts |llvm2cpp -for=Shader -gen-module -o=$@ -funcname=createBaseShader
+
+# 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 llvm_base_shader.cpp
+
+symlinks:
+
+
+include depend
diff --git a/src/mesa/pipe/llvm/llvm_base_shader.cpp b/src/mesa/pipe/llvm/llvm_base_shader.cpp
index 951afc390e..b574b550ae 100644
--- a/src/mesa/pipe/llvm/llvm_base_shader.cpp
+++ b/src/mesa/pipe/llvm/llvm_base_shader.cpp
@@ -209,7 +209,7 @@ Module* createBaseShader() {
/*Linkage=*/GlobalValue::ExternalLinkage,
/*Name=*/"run_vertex_shader", mod);
func_run_vertex_shader->setCallingConv(CallingConv::C);
- ParamAttrsList *func_run_vertex_shader_PAL = 0;
+ const ParamAttrsList *func_run_vertex_shader_PAL = 0;
func_run_vertex_shader->setParamAttrs(func_run_vertex_shader_PAL);
Function* func_execute_shader = new Function(
@@ -217,7 +217,7 @@ Module* createBaseShader() {
/*Linkage=*/GlobalValue::ExternalLinkage,
/*Name=*/"execute_shader", mod); // (external, no body)
func_execute_shader->setCallingConv(CallingConv::C);
- ParamAttrsList *func_execute_shader_PAL = 0;
+ const ParamAttrsList *func_execute_shader_PAL = 0;
func_execute_shader->setParamAttrs(func_execute_shader_PAL);
Function* func_run_fragment_shader = new Function(
@@ -225,7 +225,7 @@ Module* createBaseShader() {
/*Linkage=*/GlobalValue::ExternalLinkage,
/*Name=*/"run_fragment_shader", mod);
func_run_fragment_shader->setCallingConv(CallingConv::C);
- ParamAttrsList *func_run_fragment_shader_PAL = 0;
+ const ParamAttrsList *func_run_fragment_shader_PAL = 0;
func_run_fragment_shader->setParamAttrs(func_run_fragment_shader_PAL);
// Global Variable Declarations
@@ -644,7 +644,7 @@ Module* createBaseShader() {
StoreInst* void_110 = new StoreInst(ptr_arraydecay16, ptr_tmp12, false, label_forbody_92);
CallInst* void_111 = new CallInst(func_execute_shader, ptr_args, "", label_forbody_92);
void_111->setCallingConv(CallingConv::C);
- void_111->setTailCall(false);ParamAttrsList *void_111_PAL = 0;
+ void_111->setTailCall(false);const ParamAttrsList *void_111_PAL = 0;
void_111->setParamAttrs(void_111_PAL);
BinaryOperator* int32_indvar_next_112 = BinaryOperator::create(Instruction::Add, int32_i_0_reg2mem_0_106, const_int32_31, "indvar.next", label_forbody_92);
@@ -790,7 +790,7 @@ Module* createBaseShader() {
StoreInst* void_162 = new StoreInst(const_int32_29, ptr_tmp, false, label_from_consts_exit_124);
CallInst* void_163 = new CallInst(func_execute_shader, ptr_args_127, "", label_from_consts_exit_124);
void_163->setCallingConv(CallingConv::C);
- void_163->setTailCall(false);ParamAttrsList *void_163_PAL = 0;
+ void_163->setTailCall(false);const ParamAttrsList *void_163_PAL = 0;
void_163->setParamAttrs(void_163_PAL);
LoadInst* int32_tmp23 = new LoadInst(ptr_tmp, "tmp23", false, label_from_consts_exit_124);
@@ -807,7 +807,7 @@ Module* createBaseShader() {
StoreInst* void_166 = new StoreInst(const_int32_29, ptr_tmp, false, label_from_consts_exit_124);
CallInst* void_167 = new CallInst(func_execute_shader, ptr_args_127, "", label_from_consts_exit_124);
void_167->setCallingConv(CallingConv::C);
- void_167->setTailCall(false);ParamAttrsList *void_167_PAL = 0;
+ void_167->setTailCall(false);const ParamAttrsList *void_167_PAL = 0;
void_167->setParamAttrs(void_167_PAL);
LoadInst* int32_tmp23_1 = new LoadInst(ptr_tmp, "tmp23.1", false, label_from_consts_exit_124);
@@ -826,7 +826,7 @@ Module* createBaseShader() {
StoreInst* void_170 = new StoreInst(const_int32_29, ptr_tmp, false, label_from_consts_exit_124);
CallInst* void_171 = new CallInst(func_execute_shader, ptr_args_127, "", label_from_consts_exit_124);
void_171->setCallingConv(CallingConv::C);
- void_171->setTailCall(false);ParamAttrsList *void_171_PAL = 0;
+ void_171->setTailCall(false);const ParamAttrsList *void_171_PAL = 0;
void_171->setParamAttrs(void_171_PAL);
LoadInst* int32_tmp23_2 = new LoadInst(ptr_tmp, "tmp23.2", false, label_from_consts_exit_124);
@@ -845,7 +845,7 @@ Module* createBaseShader() {
StoreInst* void_174 = new StoreInst(const_int32_29, ptr_tmp, false, label_from_consts_exit_124);
CallInst* void_175 = new CallInst(func_execute_shader, ptr_args_127, "", label_from_consts_exit_124);
void_175->setCallingConv(CallingConv::C);
- void_175->setTailCall(false);ParamAttrsList *void_175_PAL = 0;
+ void_175->setTailCall(false);const ParamAttrsList *void_175_PAL = 0;
void_175->setParamAttrs(void_175_PAL);
LoadInst* int32_tmp23_3 = new LoadInst(ptr_tmp, "tmp23.3", false, label_from_consts_exit_124);