[03/51] nir: Add 16-bit float support into algebraic opts

Submitted by Topi Pohjolainen on Nov. 24, 2017, 12:26 p.m.

Details

Message ID 20171124122718.24124-4-topi.pohjolainen@intel.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Topi Pohjolainen Nov. 24, 2017, 12:26 p.m.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
---
 src/compiler/nir/nir_search.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index dec56fee74..3b28da4a3f 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -27,6 +27,7 @@ 
 
 #include <inttypes.h>
 #include "nir_search.h"
+#include "util/half_float.h"
 
 struct match_state {
    bool inexact_match;
@@ -194,6 +195,9 @@  match_value(const nir_search_value *value, nir_alu_instr *instr, unsigned src,
          for (unsigned i = 0; i < num_components; ++i) {
             double val;
             switch (load->def.bit_size) {
+            case 16:
+               val = _mesa_half_to_float(load->value.u16[new_swizzle[i]]);
+               break;
             case 32:
                val = load->value.f32[new_swizzle[i]];
                break;