Lines Matching refs:expr
91 s_expression *expr = s_expression::read_expression(sx_mem_ctx, src); in read() local
92 if (expr == NULL) { in read()
98 scan_for_prototypes(instructions, expr); in read()
103 read_instructions(instructions, expr, NULL); in read()
111 ir_reader::ir_read_error(s_expression *expr, const char *fmt, ...) in ir_read_error() argument
127 if (expr != NULL) { in ir_read_error()
129 expr->print(); in ir_read_error()
135 ir_reader::read_type(s_expression *expr) in read_type() argument
141 if (MATCH(expr, pat)) { in read_type()
151 s_symbol *type_sym = SX_AS_SYMBOL(expr); in read_type()
153 ir_read_error(expr, "expected <type>"); in read_type()
159 ir_read_error(expr, "invalid type: %s", type_sym->value()); in read_type()
166 ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr) in scan_for_prototypes() argument
168 s_list *list = SX_AS_LIST(expr); in scan_for_prototypes()
170 ir_read_error(expr, "Expected (<instruction> ...); found an atom."); in scan_for_prototypes()
190 ir_reader::read_function(s_expression *expr, bool skip_body) in read_function() argument
196 if (!PARTIAL_MATCH(expr, pat)) { in read_function()
197 ir_read_error(expr, "Expected (function <name> (signature ...) ...)"); in read_function()
211 exec_node *node = ((s_list *) expr)->subexpressions.get_head_raw()->next->next; in read_function()
226 ir_reader::read_function_sig(ir_function *f, s_expression *expr, bool skip_body) in read_function_sig() argument
233 if (!MATCH(expr, pat)) { in read_function_sig()
234 ir_read_error(expr, "Expected (signature <type> (parameters ...) " in read_function_sig()
276 ir_read_error(expr, "function `%s' parameter `%s' qualifiers " in read_function_sig()
282 ir_read_error(expr, "function `%s' return type doesn't " in read_function_sig()
297 ir_read_error(expr, "function %s redefined", f->name); in read_function_sig()
310 ir_reader::read_instructions(exec_list *instructions, s_expression *expr, in read_instructions() argument
314 s_list *list = SX_AS_LIST(expr); in read_instructions()
316 ir_read_error(expr, "Expected (<instruction> ...); found an atom."); in read_instructions()
338 ir_reader::read_instruction(s_expression *expr, ir_loop *loop_ctx) in read_instruction() argument
340 s_symbol *symbol = SX_AS_SYMBOL(expr); in read_instruction()
348 s_list *list = SX_AS_LIST(expr); in read_instruction()
350 ir_read_error(expr, "Invalid instruction.\n"); in read_instruction()
356 ir_read_error(expr, "expected instruction tag"); in read_instruction()
390 ir_reader::read_declaration(s_expression *expr) in read_declaration() argument
397 if (!MATCH(expr, pat)) { in read_declaration()
398 ir_read_error(expr, "expected (declare (<qualifiers>) <type> <name>)"); in read_declaration()
411 ir_read_error(expr, "qualifier list must contain only symbols"); in read_declaration()
457 ir_read_error(expr, "unknown qualifier: %s", qualifier->value()); in read_declaration()
470 ir_reader::read_if(s_expression *expr, ir_loop *loop_ctx) in read_if() argument
477 if (!MATCH(expr, pat)) { in read_if()
478 ir_read_error(expr, "expected (if <condition> (<then>...) (<else>...))"); in read_if()
501 ir_reader::read_loop(s_expression *expr) in read_loop() argument
506 if (!MATCH(expr, loop_pat)) { in read_loop()
507 ir_read_error(expr, "expected (loop <body>)"); in read_loop()
523 ir_reader::read_return(s_expression *expr) in read_return() argument
529 if (MATCH(expr, return_value_pat)) { in read_return()
536 } else if (MATCH(expr, return_void_pat)) { in read_return()
539 ir_read_error(expr, "expected (return <rvalue>) or (return)"); in read_return()
546 ir_reader::read_rvalue(s_expression *expr) in read_rvalue() argument
548 s_list *list = SX_AS_LIST(expr); in read_rvalue()
554 ir_read_error(expr, "expected rvalue tag"); in read_rvalue()
570 ir_read_error(expr, "unrecognized rvalue tag: %s", tag->value()); in read_rvalue()
577 ir_reader::read_assignment(s_expression *expr) in read_assignment() argument
585 if (!MATCH(expr, pat4) && !MATCH(expr, pat5)) { in read_assignment()
586 ir_read_error(expr, "expected (assign [<condition>] (<write mask>) " in read_assignment()
608 ir_read_error(expr, "invalid write mask: %s", mask_str); in read_assignment()
616 ir_read_error(expr, "write mask contains invalid character: %c", in read_assignment()
640 ir_read_error(expr, "non-zero write mask required."); in read_assignment()
648 ir_reader::read_call(s_expression *expr) in read_call() argument
658 if (MATCH(expr, non_void_pat)) { in read_call()
664 } else if (!MATCH(expr, void_pat)) { in read_call()
665 ir_read_error(expr, "expected (call <name> [<deref>] (<param> ...))"); in read_call()
682 ir_read_error(expr, "found call to undefined function %s", in read_call()
690 ir_read_error(expr, "couldn't find matching signature for function " in read_call()
696 ir_read_error(expr, "call has return value storage but void type"); in read_call()
699 ir_read_error(expr, "call has non-void type but no return value storage"); in read_call()
707 ir_reader::read_expression(s_expression *expr) in read_expression() argument
714 if (!PARTIAL_MATCH(expr, pat)) { in read_expression()
715 ir_read_error(expr, "expected (expression <type> <operator> " in read_expression()
731 ir_read_error(expr, "invalid operator: %s", s_op->value()); in read_expression()
736 int num_operands = (int) ((s_list *) expr)->subexpressions.length() - 3; in read_expression()
740 ir_read_error(expr, "found %d expression operands, expected %d", in read_expression()
758 ir_reader::read_swizzle(s_expression *expr) in read_swizzle() argument
764 if (!MATCH(expr, pat)) { in read_swizzle()
765 ir_read_error(expr, "expected (swiz <swizzle> <rvalue>)"); in read_swizzle()
770 ir_read_error(expr, "expected a valid swizzle; found %s", swiz->value()); in read_swizzle()
781 ir_read_error(expr, "invalid swizzle"); in read_swizzle()
787 ir_reader::read_constant(s_expression *expr) in read_constant() argument
793 if (!MATCH(expr, pat)) { in read_constant()
794 ir_read_error(expr, "expected (constant <type> (...))"); in read_constant()
803 ir_read_error(expr, "expected (constant <type> (...))"); in read_constant()
830 foreach_in_list(s_expression, expr, &values->subexpressions) { in read_constant()
837 s_number *value = SX_AS_NUMBER(expr); in read_constant()
844 s_int *value = SX_AS_INT(expr); in read_constant()
880 ir_reader::read_var_ref(s_expression *expr) in read_var_ref() argument
885 if (MATCH(expr, var_pat)) { in read_var_ref()
888 ir_read_error(expr, "undeclared variable: %s", s_var->value()); in read_var_ref()
897 ir_reader::read_dereference(s_expression *expr) in read_dereference() argument
906 ir_dereference_variable *var_ref = read_var_ref(expr); in read_dereference()
909 } else if (MATCH(expr, array_pat)) { in read_dereference()
922 } else if (MATCH(expr, record_pat)) { in read_dereference()
934 ir_reader::read_texture(s_expression *expr) in read_texture() argument
968 if (MATCH(expr, lod_pattern)) { in read_texture()
970 } else if (MATCH(expr, tex_pattern)) { in read_texture()
972 } else if (MATCH(expr, txf_pattern)) { in read_texture()
974 } else if (MATCH(expr, txf_ms_pattern)) { in read_texture()
976 } else if (MATCH(expr, txs_pattern)) { in read_texture()
978 } else if (MATCH(expr, tg4_pattern)) { in read_texture()
980 } else if (MATCH(expr, query_levels_pattern)) { in read_texture()
982 } else if (MATCH(expr, texture_samples_pattern)) { in read_texture()
984 } else if (MATCH(expr, other_pattern)) { in read_texture()
1120 ir_reader::read_emit_vertex(s_expression *expr) in read_emit_vertex() argument
1126 if (MATCH(expr, pat)) { in read_emit_vertex()
1139 ir_reader::read_end_primitive(s_expression *expr) in read_end_primitive() argument
1145 if (MATCH(expr, pat)) { in read_end_primitive()
1158 ir_reader::read_barrier(s_expression *expr) in read_barrier() argument
1162 if (MATCH(expr, pat)) { in read_barrier()