From 3f3b09d6d86cfd277c5837d15466ee703897aa3d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 18 Feb 2008 20:05:06 +0900 Subject: Rename llvm -> gallivm. Following the directory == library name policy simplifies the build system. --- src/gallium/auxiliary/gallivm/gallivm_p.h | 110 ++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 src/gallium/auxiliary/gallivm/gallivm_p.h (limited to 'src/gallium/auxiliary/gallivm/gallivm_p.h') diff --git a/src/gallium/auxiliary/gallivm/gallivm_p.h b/src/gallium/auxiliary/gallivm/gallivm_p.h new file mode 100644 index 0000000000..cfe7b1901b --- /dev/null +++ b/src/gallium/auxiliary/gallivm/gallivm_p.h @@ -0,0 +1,110 @@ +#ifndef GALLIVM_P_H +#define GALLIVM_P_H + +#ifdef MESA_LLVM + +#include "gallivm.h" +#include "pipe/p_shader_tokens.h" +#include "pipe/p_compiler.h" + +namespace llvm { + class Module; +} + +#if defined __cplusplus +extern "C" { +#endif + +enum gallivm_shader_type; +enum gallivm_vector_layout; + +struct gallivm_interpolate { + int attrib; + int chan; + int type; +}; + +struct gallivm_ir { + llvm::Module *module; + int id; + enum gallivm_shader_type type; + enum gallivm_vector_layout layout; + int num_components; + int num_consts; + + //FIXME: this might not be enough for some shaders + struct gallivm_interpolate interpolators[32*4]; + int num_interp; +}; + +struct gallivm_prog { + llvm::Module *module; + void *function; + + int id; + enum gallivm_shader_type type; + + int num_consts; + + //FIXME: this might not be enough for some shaders + struct gallivm_interpolate interpolators[32*4]; + int num_interp; +}; + +static INLINE void gallivm_swizzle_components(int swizzle, + int *xc, int *yc, + int *zc, int *wc) +{ + int x = swizzle / 1000; swizzle -= x * 1000; + int y = swizzle / 100; swizzle -= y * 100; + int z = swizzle / 10; swizzle -= z * 10; + int w = swizzle; + + if (xc) *xc = x; + if (yc) *yc = y; + if (zc) *zc = z; + if (wc) *wc = w; +} + +static INLINE boolean gallivm_is_swizzle(int swizzle) +{ + const int NO_SWIZZLE = TGSI_SWIZZLE_X * 1000 + TGSI_SWIZZLE_Y * 100 + + TGSI_SWIZZLE_Z * 10 + TGSI_SWIZZLE_W; + return swizzle != NO_SWIZZLE; +} + +static INLINE int gallivm_x_swizzle(int swizzle) +{ + int x; + gallivm_swizzle_components(swizzle, &x, 0, 0, 0); + return x; +} + +static INLINE int gallivm_y_swizzle(int swizzle) +{ + int y; + gallivm_swizzle_components(swizzle, 0, &y, 0, 0); + return y; +} + +static INLINE int gallivm_z_swizzle(int swizzle) +{ + int z; + gallivm_swizzle_components(swizzle, 0, 0, &z, 0); + return z; +} + +static INLINE int gallivm_w_swizzle(int swizzle) +{ + int w; + gallivm_swizzle_components(swizzle, 0, 0, 0, &w); + return w; +} + +#endif /* MESA_LLVM */ + +#if defined __cplusplus +} // extern "C" +#endif + +#endif -- cgit v1.2.3 From 9a8a5d7c2fe7f32c8d15bc0a77f86e1f2f995ffe Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 27 Feb 2008 16:42:15 +0900 Subject: gallium: Replace // comments. --- src/gallium/auxiliary/gallivm/gallivm.h | 2 +- src/gallium/auxiliary/gallivm/gallivm_p.h | 6 +++--- src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c | 2 +- src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h | 8 ++++---- src/gallium/auxiliary/tgsi/util/tgsi_build.h | 8 ++++---- src/gallium/auxiliary/tgsi/util/tgsi_dump.h | 8 ++++---- src/gallium/auxiliary/tgsi/util/tgsi_parse.h | 8 ++++---- src/gallium/auxiliary/tgsi/util/tgsi_util.h | 8 ++++---- 8 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src/gallium/auxiliary/gallivm/gallivm_p.h') diff --git a/src/gallium/auxiliary/gallivm/gallivm.h b/src/gallium/auxiliary/gallivm/gallivm.h index 92da4bca7f..57912a952f 100644 --- a/src/gallium/auxiliary/gallivm/gallivm.h +++ b/src/gallium/auxiliary/gallivm/gallivm.h @@ -97,7 +97,7 @@ void gallivm_cpu_engine_delete(struct gallivm_cpu_engine *ee); #endif /* MESA_LLVM */ #if defined __cplusplus -} // extern "C" +} #endif #endif diff --git a/src/gallium/auxiliary/gallivm/gallivm_p.h b/src/gallium/auxiliary/gallivm/gallivm_p.h index cfe7b1901b..ebf3e11cd5 100644 --- a/src/gallium/auxiliary/gallivm/gallivm_p.h +++ b/src/gallium/auxiliary/gallivm/gallivm_p.h @@ -32,7 +32,7 @@ struct gallivm_ir { int num_components; int num_consts; - //FIXME: this might not be enough for some shaders + /* FIXME: this might not be enough for some shaders */ struct gallivm_interpolate interpolators[32*4]; int num_interp; }; @@ -46,7 +46,7 @@ struct gallivm_prog { int num_consts; - //FIXME: this might not be enough for some shaders + /* FIXME: this might not be enough for some shaders */ struct gallivm_interpolate interpolators[32*4]; int num_interp; }; @@ -104,7 +104,7 @@ static INLINE int gallivm_w_swizzle(int swizzle) #endif /* MESA_LLVM */ #if defined __cplusplus -} // extern "C" +} #endif #endif diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c index 779b901f2b..57ccd86be4 100755 --- a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.c @@ -1268,7 +1268,7 @@ emit_store( break; case TGSI_SAT_ZERO_ONE: -// assert( 0 ); + /* assert( 0 ); */ break; case TGSI_SAT_MINUS_PLUS_ONE: diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h index 9bee371766..63b8ef3911 100755 --- a/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h +++ b/src/gallium/auxiliary/tgsi/exec/tgsi_sse2.h @@ -3,7 +3,7 @@ #if defined __cplusplus extern "C" { -#endif // defined __cplusplus +#endif struct tgsi_token; struct x86_function; @@ -19,8 +19,8 @@ tgsi_emit_sse2_fs( struct x86_function *function ); #if defined __cplusplus -} // extern "C" -#endif // defined __cplusplus +} +#endif -#endif // !defined TGSI_SSE2_H +#endif /* TGSI_SSE2_H */ diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_build.h b/src/gallium/auxiliary/tgsi/util/tgsi_build.h index 116c78abf3..607860e7fc 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_build.h +++ b/src/gallium/auxiliary/tgsi/util/tgsi_build.h @@ -3,7 +3,7 @@ #if defined __cplusplus extern "C" { -#endif // defined __cplusplus +#endif /* * version @@ -313,8 +313,8 @@ tgsi_build_dst_register_ext_modulate( struct tgsi_header *header ); #if defined __cplusplus -} // extern "C" -#endif // defined __cplusplus +} +#endif -#endif // !defined TGSI_BUILD_H +#endif /* TGSI_BUILD_H */ diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_dump.h b/src/gallium/auxiliary/tgsi/util/tgsi_dump.h index 1adc9db251..b983b38226 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_dump.h +++ b/src/gallium/auxiliary/tgsi/util/tgsi_dump.h @@ -3,7 +3,7 @@ #if defined __cplusplus extern "C" { -#endif // defined __cplusplus +#endif #define TGSI_DUMP_VERBOSE 1 #define TGSI_DUMP_NO_IGNORED 2 @@ -21,8 +21,8 @@ tgsi_dump_str( unsigned flags ); #if defined __cplusplus -} // extern "C" -#endif // defined __cplusplus +} +#endif -#endif // !defined TGSI_DUMP_H +#endif /* TGSI_DUMP_H */ diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_parse.h b/src/gallium/auxiliary/tgsi/util/tgsi_parse.h index 9372da8d5d..5ccb5bfcf6 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_parse.h +++ b/src/gallium/auxiliary/tgsi/util/tgsi_parse.h @@ -3,7 +3,7 @@ #if defined __cplusplus extern "C" { -#endif // defined __cplusplus +#endif struct tgsi_full_version { @@ -114,8 +114,8 @@ tgsi_parse_token( struct tgsi_parse_context *ctx ); #if defined __cplusplus -} // extern "C" -#endif // defined __cplusplus +} +#endif -#endif // !defined TGSI_PARSE_H +#endif /* TGSI_PARSE_H */ diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_util.h b/src/gallium/auxiliary/tgsi/util/tgsi_util.h index ef14446f0e..45f5f0be0e 100644 --- a/src/gallium/auxiliary/tgsi/util/tgsi_util.h +++ b/src/gallium/auxiliary/tgsi/util/tgsi_util.h @@ -3,7 +3,7 @@ #if defined __cplusplus extern "C" { -#endif // defined __cplusplus +#endif void * tgsi_align_128bit( @@ -63,8 +63,8 @@ tgsi_util_set_full_src_register_sign_mode( unsigned sign_mode ); #if defined __cplusplus -} // extern "C" -#endif // defined __cplusplus +} +#endif -#endif // !defined TGSI_UTIL_H +#endif /* TGSI_UTIL_H */ -- cgit v1.2.3 From 7b0e0e1a0d571291851e8a7b2e64c8425055cd69 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Sun, 16 Nov 2008 20:32:05 +0100 Subject: gallivm: fix some small stuff. --- src/gallium/auxiliary/gallivm/gallivm_p.h | 4 ++-- src/gallium/auxiliary/gallivm/storage.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/gallivm/gallivm_p.h') diff --git a/src/gallium/auxiliary/gallivm/gallivm_p.h b/src/gallium/auxiliary/gallivm/gallivm_p.h index ebf3e11cd5..d2c5852bdf 100644 --- a/src/gallium/auxiliary/gallivm/gallivm_p.h +++ b/src/gallium/auxiliary/gallivm/gallivm_p.h @@ -101,10 +101,10 @@ static INLINE int gallivm_w_swizzle(int swizzle) return w; } -#endif /* MESA_LLVM */ - #if defined __cplusplus } #endif +#endif /* MESA_LLVM */ + #endif diff --git a/src/gallium/auxiliary/gallivm/storage.cpp b/src/gallium/auxiliary/gallivm/storage.cpp index 6f373f6dd5..73df24c976 100644 --- a/src/gallium/auxiliary/gallivm/storage.cpp +++ b/src/gallium/auxiliary/gallivm/storage.cpp @@ -323,7 +323,7 @@ llvm::Value * Storage::elemIdx(llvm::Value *ptr, int idx, if (indIdx) { getElem = GetElementPtrInst::Create(ptr, - BinaryOperator::create(Instruction::Add, + BinaryOperator::Create(Instruction::Add, indIdx, constantInt(idx), name("add"), -- cgit v1.2.3