From f274a2ca8733059bdd4f1c456ed4f6df7d7ec008 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 6 Mar 2013 11:05:14 -0800 Subject: glsl: Add ir_binop_vector_extract The new opcode is used to get a single field from a vector. The field index may not be constant. This will eventually replace ir_dereference_array of vectors. This is similar to the extractelement instruction in LLVM IR. http://llvm.org/docs/LangRef.html#extractelement-instruction v2: Convert tabs to spaces. Suggested by Eric. v3: Add array index range checking to ir_binop_vector_extract constant expression handling. Suggested by Ken. v4: Use CLAMP instead of MIN2(MAX2()). Suggested by Ken. Signed-off-by: Ian Romanick Reviewed-by: Eric Anholt Reviewed-by: Kenneth Graunke --- src/mesa/program/ir_to_mesa.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 258b864f559..98281140aae 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -1489,6 +1489,7 @@ ir_to_mesa_visitor::visit(ir_expression *ir) emit(ir, OPCODE_LRP, result_dst, op[2], op[1], op[0]); break; + case ir_binop_vector_extract: case ir_binop_bfm: case ir_triop_bfi: case ir_triop_bitfield_extract: -- cgit v1.2.3