Lines Matching refs:c

28 %parse-param {Context *c}
114 gen_inst(c, $1);
118 EMIT_SIG(c, ")");
119 EMIT_HEAD(c, "{\n");
123 gen_inst_code(c, &@1);
127 free_instruction(c);
140 track_string(c, $1.var.name);
169 yyassert(c, &@1, $1.bit_width <= 64,
200 yyassert(c, &@2, $2.imm.type == I,
211 gen_varid_allocate(c, &@1, &$2, $1.bit_width, $1.signedness);
223 c->inst.code_begin = c->input_buffer + @2.first_column - 1;
224 c->inst.code_end = c->input_buffer + @2.last_column - 1;
235 emit_arg(c, &@1, &$1);
237 g_array_append_val(c->inst.init_list, $1);
241 emit_arg(c, &@1, &$1);
243 g_array_append_val(c->inst.init_list, $1);
247 emit_arg(c, &@2, &$2);
251 emit_arg(c, &@2, &$2);
255 EMIT_SIG(c, ", int %ciV", $1.imm.id);
279 gen_assign(c, &@1, &$1, &$3);
285 gen_assign(c, &@1, &$1, &$3);
291 HexValue tmp = gen_bin_op(c, &@1, ADD_OP, &$1, &$3);
292 gen_assign(c, &@1, &$1, &tmp);
298 HexValue tmp = gen_bin_op(c, &@1, SUB_OP, &$1, &$3);
299 gen_assign(c, &@1, &$1, &tmp);
305 HexValue tmp = gen_bin_op(c, &@1, ANDB_OP, &$1, &$3);
306 gen_assign(c, &@1, &$1, &tmp);
312 HexValue tmp = gen_bin_op(c, &@1, ORB_OP, &$1, &$3);
313 gen_assign(c, &@1, &$1, &tmp);
319 HexValue tmp = gen_bin_op(c, &@1, XORB_OP, &$1, &$3);
320 gen_assign(c, &@1, &$1, &tmp);
326 gen_pred_assign(c, &@1, &$1, &$3);
331 yyassert(c, &@1, $3.type == IMMEDIATE,
333 yyassert(c, &@1, $1.imm.type == VARIABLE,
336 OUT(c, &@1, &$1, " = ", &$3, ";\n");
342 yyassert(c, &@1, !is_inside_ternary(c),
344 yyassert(c, &@1, $3.imm.value == 1,
346 gen_load(c, &@1, &$5, $7, &$9, &$11);
352 yyassert(c, &@1, !is_inside_ternary(c),
354 yyassert(c, &@1, $3.imm.value == 1,
356 gen_store(c, &@1, &$5, &$7, &$9);
361 yyassert(c, &@1, !is_inside_ternary(c),
363 $3 = gen_rvalue_truncate(c, &@1, &$3);
364 $3 = rvalue_materialize(c, &@1, &$3);
365 OUT(c, &@1, "gen_set_usr_field(ctx, USR_LPCFG, ", &$3, ");\n");
370 yyassert(c, &@1, !is_inside_ternary(c),
372 gen_deposit_op(c, &@1, &$5, &$7, &$3, &$1);
377 yyassert(c, &@1, !is_inside_ternary(c),
379 gen_sethalf(c, &@1, &$1, &$3, &$5, &$7);
384 yyassert(c, &@1, !is_inside_ternary(c),
386 gen_setbits(c, &@1, &$3, &$5, &$7, &$9);
391 yyassert(c, &@1, !is_inside_ternary(c),
393 gen_rdeposit_op(c, &@1, &$3, &$9, &$7, &$5);
413 gen_load_cancel(c, &@1);
417 gen_cancel(c, &@1);
425 OUT(c, &@1, "gen_set_label(if_label_", &$1, ");\n");
430 $2 = gen_if_else(c, &@1, $1);
434 OUT(c, &@1, "gen_set_label(if_label_", &$2, ");\n");
440 yyassert(c, &@3,
446 OUT(c, &@1, "for (int ", &$3, " = ", &$5, "; ",
448 OUT(c, &@1, "; ", &$11, "++) {\n");
452 OUT(c, &@1, "}\n");
459 $1 = gen_if_cond(c, &@1, &$3);
469 yyassert(c, &@1, false, "Encountered a FAIL token as rvalue.\n");
482 $$ = gen_rvalue_pred(c, &@1, &$1);
507 $$ = gen_rvalue_var(c, &@1, &$1);
512 $$ = gen_rvalue_mpy(c, &@1, &$1, &$3, &$5);
517 $$ = gen_bin_op(c, &@1, ADD_OP, &$1, &$3);
522 $$ = gen_bin_op(c, &@1, SUB_OP, &$1, &$3);
527 $$ = gen_bin_op(c, &@1, MUL_OP, &$1, &$3);
532 $$ = gen_bin_op(c, &@1, ASL_OP, &$1, &$3);
537 assert_signedness(c, &@1, $1.signedness);
539 $$ = gen_bin_op(c, &@1, LSR_OP, &$1, &$3);
541 $$ = gen_bin_op(c, &@1, ASR_OP, &$1, &$3);
547 $$ = gen_bin_op(c, &@1, LSR_OP, &$1, &$3);
552 $$ = gen_bin_op(c, &@1, ANDB_OP, &$1, &$3);
557 $$ = gen_bin_op(c, &@1, ORB_OP, &$1, &$3);
562 $$ = gen_bin_op(c, &@1, XORB_OP, &$1, &$3);
567 $$ = gen_bin_op(c, &@1, ANDL_OP, &$1, &$3);
572 $$ = gen_bin_op(c, &@1, MINI_OP, &$3, &$5);
577 $$ = gen_bin_op(c, &@1, MAXI_OP, &$3, &$5);
582 $$ = gen_rvalue_not(c, &@1, &$2);
587 $$ = gen_rvalue_notl(c, &@1, &$2);
592 $$ = gen_rvalue_sat(c, &@1, &$1, &$3, &$5);
597 $$ = gen_cast_op(c, &@1, &$2, $1.bit_width, $1.signedness);
602 $$ = gen_bin_cmp(c, &@1, TCG_COND_EQ, &$1, &$3);
607 $$ = gen_bin_cmp(c, &@1, TCG_COND_NE, &$1, &$3);
613 assert_signedness(c, &@1, $1.signedness);
614 assert_signedness(c, &@1, $3.signedness);
616 $$ = gen_bin_cmp(c, &@1, TCG_COND_LTU, &$1, &$3);
618 $$ = gen_bin_cmp(c, &@1, TCG_COND_LT, &$1, &$3);
625 assert_signedness(c, &@1, $1.signedness);
626 assert_signedness(c, &@1, $3.signedness);
628 $$ = gen_bin_cmp(c, &@1, TCG_COND_GTU, &$1, &$3);
630 $$ = gen_bin_cmp(c, &@1, TCG_COND_GT, &$1, &$3);
637 assert_signedness(c, &@1, $1.signedness);
638 assert_signedness(c, &@1, $3.signedness);
640 $$ = gen_bin_cmp(c, &@1, TCG_COND_LEU, &$1, &$3);
642 $$ = gen_bin_cmp(c, &@1, TCG_COND_LE, &$1, &$3);
649 assert_signedness(c, &@1, $1.signedness);
650 assert_signedness(c, &@1, $3.signedness);
652 $$ = gen_bin_cmp(c, &@1, TCG_COND_GEU, &$1, &$3);
654 $$ = gen_bin_cmp(c, &@1, TCG_COND_GE, &$1, &$3);
662 g_array_append_val(c->ternary, t);
666 Ternary *t = &g_array_index(c->ternary, Ternary,
667 c->ternary->len - 1);
673 $$ = gen_rvalue_ternary(c, &@1, &$1, &$4, &$7);
678 $$ = gen_rvalue_fscr(c, &@1, &$3);
683 yyassert(c, &@1, $5.type == IMMEDIATE &&
686 $$ = gen_extend_op(c, &@1, &$3, 64, &$7, SIGNED);
691 yyassert(c, &@1, $5.type == IMMEDIATE &&
694 $$ = gen_extend_op(c, &@1, &$3, 64, &$7, UNSIGNED);
703 $$ = gen_rvalue_abs(c, &@1, &$2);
708 $$ = gen_convround_n(c, &@1, &$3, &$5);
713 $$ = gen_convround(c, &@1, &$3);
718 $$ = gen_round(c, &@1, &$3, &$5);
723 $$ = gen_rvalue_neg(c, &@1, &$2);
728 $$ = gen_tmp(c, &@1, 32, UNSIGNED);
729 OUT(c, &@1, "gen_read_ireg(", &$$, ", ", &$3, ", ", &$6, ");\n");
734 gen_circ_op(c, &@1, &$3, &$5, &$7);
740 $$ = gen_locnt_op(c, &@1, &$3);
746 $$ = gen_ctpop_op(c, &@1, &$3);
751 $$ = gen_extract_op(c, &@1, &$5, &$3, &$1);
756 yyassert(c, &@1, $5.type == IMMEDIATE &&
761 $$ = gen_rextract_op(c,
770 $$ = gen_rvalue_truncate(c, &@1, &$3);
772 $$ = rvalue_materialize(c, &@1, &$$);
773 $$ = gen_rvalue_extend(c, &@1, &$$);
778 $$ = gen_rvalue_brev(c, &@1, &$3);
783 $$ = gen_rotl(c, &@1, &$3, &$5);
788 gen_addsat64(c, &@1, &$3, &$5, &$7);
793 $$ = gen_carry_from_add(c, &@1, &$3, &$5, &$7);
798 HexValue one = gen_imm_value(c, &@1, 1, 32, UNSIGNED);
799 $$ = gen_bin_op(c, &@1, ANDB_OP, &$3, &one);
806 yyassert(c, &@1, false, "Encountered a FAIL token as lvalue.\n");