projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60e1c6a
)
nir: Add an opcode for stomping a 32-bit value to 16-bit precision
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Fri, 25 Mar 2016 20:58:17 +0000
(13:58 -0700)
committer
Jason Ekstrand
<jason.ekstrand@intel.com>
Fri, 1 Apr 2016 20:52:28 +0000
(13:52 -0700)
This correlates directly to the SPIR-V opcode OpQuantizeToF16
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/nir/nir_opcodes.py
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir_opcodes.py
b/src/compiler/nir/nir_opcodes.py
index 553f924afc5e9b30ea87e0419579ae77670f98e0..bc9845036d356c0061b95202cda875d239746d40 100644
(file)
--- a/
src/compiler/nir/nir_opcodes.py
+++ b/
src/compiler/nir/nir_opcodes.py
@@
-180,6
+180,7
@@
unop("ffloor", tfloat, "bit_size == 64 ? floor(src0) : floorf(src0)")
unop("ffract", tfloat, "src0 - (bit_size == 64 ? floor(src0) : floorf(src0))")
unop("fround_even", tfloat, "bit_size == 64 ? _mesa_roundeven(src0) : _mesa_roundevenf(src0)")
+unop("fquantize2f16", tfloat, "(fabs(src0) < ldexpf(1.0, -14)) ? copysignf(0.0f, src0) : _mesa_half_to_float(_mesa_float_to_half(src0))")
# Trigonometric operations.