projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c79f162
)
gallivm: simpler uint8->float conversions
author
Keith Whitwell
<keithw@vmware.com>
Wed, 6 Oct 2010 18:09:03 +0000
(19:09 +0100)
committer
Keith Whitwell
<keithw@vmware.com>
Sat, 9 Oct 2010 10:44:45 +0000
(11:44 +0100)
LLVM seems to finds it easier to reason about these than our
mantissa-manipulation code.
src/gallium/auxiliary/gallivm/lp_bld_conv.c
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/gallivm/lp_bld_conv.c
b/src/gallium/auxiliary/gallivm/lp_bld_conv.c
index 3abb19272b696595c199fc293edf57e69dd95d5d..20aa2577830bf538d7214f34b8ec62080af79f9c 100644
(file)
--- a/
src/gallium/auxiliary/gallivm/lp_bld_conv.c
+++ b/
src/gallium/auxiliary/gallivm/lp_bld_conv.c
@@
-178,6
+178,16
@@
lp_build_unsigned_norm_to_float(LLVMBuilderRef builder,
assert(dst_type.floating);
+ /* Special-case int8->float, though most cases could be handled
+ * this way:
+ */
+ if (src_width == 8) {
+ scale = 1.0/255.0;
+ res = LLVMBuildSIToFP(builder, src, vec_type, "");
+ res = LLVMBuildFMul(builder, res, lp_build_const_vec(dst_type, scale), "");
+ return res;
+ }
+
mantissa = lp_mantissa(dst_type);
n = MIN2(mantissa, src_width);