projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a75254d
)
gallivm: constant building for scalar zero
author
Brian Paul
<brianp@vmware.com>
Thu, 11 Mar 2010 01:06:02 +0000
(18:06 -0700)
committer
Brian Paul
<brianp@vmware.com>
Thu, 11 Mar 2010 01:09:49 +0000
(18:09 -0700)
src/gallium/auxiliary/gallivm/lp_bld_const.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/gallivm/lp_bld_const.c
b/src/gallium/auxiliary/gallivm/lp_bld_const.c
index 53447757e8e23ba6f24a0c089af4761983f52cc1..8a275fa72f386d46c299dd4b0968ab4052e12284 100644
(file)
--- a/
src/gallium/auxiliary/gallivm/lp_bld_const.c
+++ b/
src/gallium/auxiliary/gallivm/lp_bld_const.c
@@
-221,8
+221,16
@@
lp_build_undef(struct lp_type type)
LLVMValueRef
lp_build_zero(struct lp_type type)
{
- LLVMTypeRef vec_type = lp_build_vec_type(type);
- return LLVMConstNull(vec_type);
+ if (type.length == 1) {
+ if (type.floating)
+ return LLVMConstReal(LLVMFloatType(), 0.0);
+ else
+ return LLVMConstInt(LLVMIntType(type.width), 0, 0);
+ }
+ else {
+ LLVMTypeRef vec_type = lp_build_vec_type(type);
+ return LLVMConstNull(vec_type);
+ }
}