summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-12-03 11:39:40 -0700
committerBrian Paul <brianp@vmware.com>2009-12-03 11:39:40 -0700
commite01fa1eaec34675d0b30127de4f78b020a092a83 (patch)
tree88913185d1a1616a467a00120b29605be41c8207 /src/gallium
parent866e6856d39efe9b1ec739587f420a640ad8618e (diff)
llvmpipe: comments
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_logic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_logic.c b/src/gallium/drivers/llvmpipe/lp_bld_logic.c
index db22a8028a..9470f834fc 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_logic.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_logic.c
@@ -41,6 +41,10 @@
#include "lp_bld_logic.h"
+/**
+ * Build code to compare two values 'a' and 'b' using the given func.
+ * \parm func one of PIPE_FUNC_x
+ */
LLVMValueRef
lp_build_cmp(struct lp_build_context *bld,
unsigned func,
@@ -56,6 +60,9 @@ lp_build_cmp(struct lp_build_context *bld,
LLVMValueRef res;
unsigned i;
+ assert(func >= PIPE_FUNC_NEVER);
+ assert(func <= PIPE_FUNC_ALWAYS);
+
if(func == PIPE_FUNC_NEVER)
return zeros;
if(func == PIPE_FUNC_ALWAYS)
@@ -68,6 +75,7 @@ lp_build_cmp(struct lp_build_context *bld,
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
if(type.width * type.length == 128) {
if(type.floating && util_cpu_caps.has_sse) {
+ /* float[4] comparison */
LLVMValueRef args[3];
unsigned cc;
boolean swap;
@@ -117,6 +125,7 @@ lp_build_cmp(struct lp_build_context *bld,
return res;
}
else if(util_cpu_caps.has_sse2) {
+ /* int[4] comparison */
static const struct {
unsigned swap:1;
unsigned eq:1;