[Mesa-dev] [PATCH 9/9] st-glsl: handle more glsl IR in glsl_to_tgsi_visitor::visit()

Maxence Le Doré maxence.ledore at gmail.com
Sat Jan 4 15:42:44 PST 2014


From: Maxence Le Doré <Maxence Le Doré>

---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 726b574..7c1f4e2 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -683,6 +683,8 @@ glsl_to_tgsi_visitor::get_opcode(ir_instruction *ir, unsigned op,
       casecomp(SLT, FSLT, ISLT, USLT);
 
       case2iu(ISHR, USHR);
+      case2iu(ILSB, ULSB);
+      case2iu(IMSB, UMSB);
 
       case2fi(SSG, ISSG);
       case3(ABS, IABS, IABS);
@@ -1929,6 +1931,24 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
          emit(ir, TGSI_OPCODE_CMP, result_dst, op[0], op[1], op[2]);
       }
       break;
+   case ir_triop_fma:
+      emit(ir, TGSI_OPCODE_FMA, result_dst, op[0], op[1], op[2]);
+      break;
+   case ir_unop_bit_count:
+      if (native_integers) {
+         emit(ir, TGSI_OPCODE_POPCNT, result_dst, op[0]);
+         break;
+      }
+   case ir_unop_find_msb:
+      if (native_integers) {
+         emit(ir, TGSI_OPCODE_ILSB, result_dst, op[0]);
+         break;
+      }
+   case ir_unop_find_lsb:
+      if (native_integers) {
+         emit(ir, TGSI_OPCODE_IMSB, result_dst, op[0], op[1]);
+         break;
+      }
    case ir_unop_pack_snorm_2x16:
    case ir_unop_pack_unorm_2x16:
    case ir_unop_pack_half_2x16:
@@ -1943,11 +1963,7 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
    case ir_unop_unpack_unorm_4x8:
    case ir_binop_pack_half_2x16_split:
    case ir_unop_bitfield_reverse:
-   case ir_unop_bit_count:
-   case ir_unop_find_msb:
-   case ir_unop_find_lsb:
    case ir_binop_bfm:
-   case ir_triop_fma:
    case ir_triop_bfi:
    case ir_triop_bitfield_extract:
    case ir_quadop_bitfield_insert:
-- 
1.8.5.2



More information about the mesa-dev mailing list