diff options
author | nobled <nobled@dreamwidth.org> | 2010-08-09 21:15:08 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-08-10 10:24:26 +0100 |
commit | a44a6960fab8c0053678fe74ce4c978ef40b06ff (patch) | |
tree | 60e495adb079b20af52b8507fa99b083d45e47f4 /src/gallium/auxiliary/gallivm/lp_bld_arit.c | |
parent | e9f3994b16beabb5892abdc4b359a093cbde7f79 (diff) |
gallivm: Even more type checking
http://bugs.freedesktop.org/29407
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_arit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index ec9b53be80..860fbd829b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -72,6 +72,9 @@ lp_build_min_simple(struct lp_build_context *bld, const char *intrinsic = NULL; LLVMValueRef cond; + assert(lp_check_value(type, a)); + assert(lp_check_value(type, b)); + /* TODO: optimize the constant case */ if(type.width * type.length == 128) { @@ -118,6 +121,9 @@ lp_build_max_simple(struct lp_build_context *bld, const char *intrinsic = NULL; LLVMValueRef cond; + assert(lp_check_value(type, a)); + assert(lp_check_value(type, b)); + /* TODO: optimize the constant case */ if(type.width * type.length == 128) { @@ -395,6 +401,10 @@ lp_build_mul_u8n(LLVMBuilderRef builder, LLVMValueRef c8; LLVMValueRef ab; + assert(!i16_type.floating); + assert(lp_check_value(i16_type, a)); + assert(lp_check_value(i16_type, b)); + c8 = lp_build_const_int_vec(i16_type, 8); #if 0 @@ -848,8 +858,8 @@ lp_build_set_sign(struct lp_build_context *bld, ~((unsigned long long) 1 << (type.width - 1))); LLVMValueRef val, res; - assert(lp_check_value(type, a)); assert(type.floating); + assert(lp_check_value(type, a)); /* val = reinterpret_cast<int>(a) */ val = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); |