gallivm: add PK2H/UP2H support
authorRoland Scheidegger <sroland@vmware.com>
Tue, 2 Feb 2016 02:51:22 +0000 (03:51 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 2 Feb 2016 04:58:20 +0000 (05:58 +0100)
Add support for these opcodes, the conversion functions were already
there albeit need some new packing stuff.
Just like the tgsi version, piglit won't like it for all the same
reasons, so it's disabled (UP2H passes piglit arb_shader_language_packing
tests, albeit since PK2H won't due to those rounding differences I don't
know if that one works or not as the piglit test is rather difficult to
deal with).

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_pack.c
src/gallium/auxiliary/gallivm/lp_bld_tgsi_action.c

index daa2043ee2858461fd52f202d077c7574598f5c2..d80c997ad8481e4d695d271a75c549d381a5e515 100644 (file)
@@ -273,7 +273,7 @@ lp_build_uninterleave1(struct gallivm_state *gallivm,
    unsigned i;
    assert(num_elems <= LP_MAX_VECTOR_LENGTH);
 
-   for(i = 0; i < num_elems / 2; ++i)
+   for (i = 0; i < num_elems / 2; ++i)
       elems[i] = lp_build_const_int32(gallivm, 2*i + lo_hi);
 
    shuffle = LLVMConstVector(elems, num_elems / 2);
index f6b42eead1e8a0e2fab0320757d385850b3a6e8a..43af6b4ea0da0405be3a666858072a79dfa17841 100644 (file)
@@ -548,9 +548,10 @@ pk2h_fetch_args(
 }
 
 static void
-pk2h_emit(const struct lp_build_tgsi_action *action,
-          struct lp_build_tgsi_context *bld_base,
-          struct lp_build_emit_data *emit_data)
+pk2h_emit(
+   const struct lp_build_tgsi_action *action,
+   struct lp_build_tgsi_context *bld_base,
+   struct lp_build_emit_data *emit_data)
 {
    struct gallivm_state *gallivm = bld_base->base.gallivm;
    struct lp_type f16i_t;
@@ -575,9 +576,10 @@ static struct lp_build_tgsi_action pk2h_action = {
 /* TGSI_OPCODE_UP2H */
 
 static void
-up2h_emit(const struct lp_build_tgsi_action *action,
-          struct lp_build_tgsi_context *bld_base,
-          struct lp_build_emit_data *emit_data)
+up2h_emit(
+   const struct lp_build_tgsi_action *action,
+   struct lp_build_tgsi_context *bld_base,
+   struct lp_build_emit_data *emit_data)
 {
    struct gallivm_state *gallivm = bld_base->base.gallivm;
    LLVMBuilderRef builder = gallivm->builder;