Lines Matching refs:idesc

291 	struct ia64_opcode *idesc;
838 static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode *idesc,
868 static int check_dv PARAMS((struct ia64_opcode *idesc));
5658 operand_match (idesc, index, e)
5659 const struct ia64_opcode *idesc;
5663 enum ia64_opnd opnd = idesc->operands[index];
5833 bits = operand_width (idesc->operands[index]);
5907 fix->opnd = idesc->operands[index];
5942 bits = operand_width (idesc->operands[index]);
5953 bits = operand_width (idesc->operands[index]);
6029 bits = operand_width (idesc->operands[index]);
6036 if (idesc->operands[index] == IA64_OPND_IMM14)
6048 fix->opnd = idesc->operands[index];
6154 fix->opnd = idesc->operands[index];
6173 fix->opnd = idesc->operands[index];
6187 fix->opnd = idesc->operands[index];
6221 get_next_opcode (struct ia64_opcode *idesc)
6223 struct ia64_opcode *next = ia64_find_next_opcode (idesc);
6224 ia64_free_opcode (idesc);
6232 parse_operands (idesc)
6233 struct ia64_opcode *idesc;
6245 assert (strlen (idesc->name) <= 128);
6247 strcpy (mnemonic, idesc->name);
6248 if (idesc->operands[2] == IA64_OPND_SOF
6249 || idesc->operands[1] == IA64_OPND_SOF)
6303 if (idesc->operands[2] == IA64_OPND_SOF
6304 || idesc->operands[1] == IA64_OPND_SOF)
6309 know (strcmp (idesc->name, "alloc") == 0);
6343 for (; idesc; idesc = get_next_opcode (idesc))
6345 if (num_outputs != idesc->num_outputs)
6349 if (num_operands > NELEMS (idesc->operands)
6350 || (num_operands < NELEMS (idesc->operands)
6351 && idesc->operands[num_operands])
6352 || (num_operands > 0 && !idesc->operands[num_operands - 1]))
6361 the rest match, then this idesc will give the best error message. */
6364 for (i = 0; i < num_operands && idesc->operands[i]; ++i)
6366 result = operand_match (idesc, i, CURR_SLOT.opnd + i);
6378 out-of-range, then this idesc does not match. Keep track of which
6379 idesc matched the most operands before failing. If we have two
6395 expected_operand = idesc->operands[out_of_range_pos];
6400 expected_operand = idesc->operands[i];
6410 if (!idesc)
6441 switch (idesc->operands[i])
6485 if (idesc->flags & IA64_OPCODE_POSTINC)
6545 return idesc;
6554 struct ia64_opcode *idesc = slot->idesc;
6560 insn = idesc->opcode | slot->qp_regno;
6562 for (i = 0; i < NELEMS (idesc->operands) && idesc->operands[i]; ++i)
6571 assert (idesc->operands[i] == IA64_OPND_IMM8M1U8);
6577 switch (idesc->operands[i])
6648 odesc = elf64_ia64_operands + idesc->operands[i];
6653 if (idesc->flags & IA64_OPCODE_PSEUDO)
6655 if ((idesc->flags & IA64_OPCODE_F2_EQ_F3)
6661 if ((idesc->flags & IA64_OPCODE_LEN_EQ_64MCNT)
6681 struct ia64_opcode *idesc;
6711 type[i] = md.slot[curr].idesc->type;
6733 idesc = md.slot[curr].idesc;
6790 if (idesc->flags & IA64_OPCODE_SLOT2)
6795 "`%s' must be last in bundle", idesc->name);
6801 if (idesc->flags & IA64_OPCODE_LAST)
6814 switch (idesc->type)
6828 "of instruction group", idesc->name);
6841 idesc->name);
6905 && (idesc->flags & IA64_OPCODE_FIRST) == 0)
6912 && !(idesc->flags & IA64_OPCODE_FIRST))
6930 if (idesc->type == IA64_TYPE_DYN)
6934 if ((strcmp (idesc->name, "nop") == 0)
6935 || (strcmp (idesc->name, "break") == 0))
6937 else if (strcmp (idesc->name, "hint") == 0)
6963 else if (strcmp (idesc->name, "chk.s") == 0
6964 || strcmp (idesc->name, "mov") == 0)
6975 idesc->name, "?imbfxx"[insn_unit]);
6976 opnd1 = idesc->operands[0];
6977 opnd2 = idesc->operands[1];
6978 ia64_free_opcode (idesc);
6979 idesc = ia64_find_opcode (mnemonic);
6983 while (idesc != NULL
6984 && (idesc->operands[0] != opnd1
6985 || idesc->operands[1] != opnd2))
6986 idesc = get_next_opcode (idesc);
6988 md.slot[curr].idesc = idesc;
6992 insn_type = idesc->type;
7077 ia64_free_opcode (md.slot[curr].idesc);
7087 idesc = md.slot[curr].idesc;
7096 idesc->name, ia64_templ_desc[template].name);
7100 ia64_free_opcode (md.slot[curr].idesc);
7110 "`%s' does not fit into bundle", idesc->name);
7123 idesc->name, where, ia64_templ_desc[template].name);
8240 /* Return true if idesc is a conditional branch instruction. This excludes
8248 is_conditional_branch (idesc)
8249 struct ia64_opcode *idesc;
8254 return (idesc->name[0] == 'b' && idesc->name[1] == 'r'
8255 && (idesc->name[2] == '\0'
8256 || (idesc->name[2] == '.' && idesc->name[3] != 'i'
8257 && idesc->name[3] != 'c' && idesc->name[3] != 'w')
8258 || idesc->name[2] == 'l'
8260 || (idesc->name[2] == '.' && idesc->name[3] == 'c'
8261 && (idesc->name[4] == 'a' || idesc->name[4] == 'o'
8262 || (idesc->name[4] == 'l' && idesc->name[5] == 'r')))));
8269 is_taken_branch (idesc)
8270 struct ia64_opcode *idesc;
8272 return ((is_conditional_branch (idesc) && CURR_SLOT.qp_regno == 0)
8273 || strncmp (idesc->name, "br.ia", 5) == 0);
8280 is_interruption_or_rfi (idesc)
8281 struct ia64_opcode *idesc;
8283 if (strcmp (idesc->name, "rfi") == 0)
8292 depends_on (depind, idesc)
8294 struct ia64_opcode *idesc;
8297 const struct ia64_opcode_dependency *dep = idesc->dependencies;
8359 specify_resource (dep, idesc, type, specs, note, path)
8361 struct ia64_opcode *idesc;
8396 dep->name, idesc->name, (rsrc_write?"write":"read"), note)
8408 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3)
8434 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3)
8473 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3)
8496 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3)
8535 for (i = 0; i < idesc->num_outputs; i++)
8536 if (idesc->operands[i] == IA64_OPND_B1
8537 || idesc->operands[i] == IA64_OPND_B2)
8546 for (i = idesc->num_outputs; i < NELEMS (idesc->operands); i++)
8547 if (idesc->operands[i] == IA64_OPND_B1
8548 || idesc->operands[i] == IA64_OPND_B2)
8561 if (idesc->operands[!rsrc_write] == IA64_OPND_CPUID_R3)
8586 if (idesc->operands[!rsrc_write] == IA64_OPND_DBR_R3)
8616 if (idesc->operands[!rsrc_write] == IA64_OPND_IBR_R3)
8655 if (idesc->operands[!rsrc_write] == IA64_OPND_PKR_R3)
8695 if (idesc->operands[!rsrc_write] == IA64_OPND_PMC_R3
8696 || (!rsrc_write && idesc->operands[1] == IA64_OPND_PMD_R3))
8699 int index = ((idesc->operands[1] == IA64_OPND_R3 && !rsrc_write)
8724 if (idesc->operands[!rsrc_write] == IA64_OPND_PMD_R3)
8749 if (idesc->operands[!rsrc_write] == IA64_OPND_RR_R3)
8782 && idesc->operands[1] == IA64_OPND_CR3
8795 if (idesc->operands[!rsrc_write] == IA64_OPND_CR3
8817 if (idesc->operands[!rsrc_write] == IA64_OPND_CR3
8829 if (idesc->operands[!rsrc_write] == IA64_OPND_CR3)
8851 && idesc->operands[0] == IA64_OPND_F1)
8859 for (i = idesc->num_outputs; i < NELEMS (idesc->operands); i++)
8861 if (idesc->operands[i] == IA64_OPND_F2
8862 || idesc->operands[i] == IA64_OPND_F3
8863 || idesc->operands[i] == IA64_OPND_F4)
8885 for (i = 0; i < idesc->num_outputs; i++)
8886 if (idesc->operands[i] == IA64_OPND_R1
8887 || idesc->operands[i] == IA64_OPND_R2
8888 || idesc->operands[i] == IA64_OPND_R3)
8894 if (idesc->flags & IA64_OPCODE_POSTINC)
8895 for (i = 0; i < NELEMS (idesc->operands); i++)
8896 if (idesc->operands[i] == IA64_OPND_MR3)
8906 for (i = 0; i < NELEMS (idesc->operands); i++)
8908 if (idesc->operands[i] == IA64_OPND_MR3
8909 || idesc->operands[i] == IA64_OPND_CPUID_R3
8910 || idesc->operands[i] == IA64_OPND_DBR_R3
8911 || idesc->operands[i] == IA64_OPND_IBR_R3
8912 || idesc->operands[i] == IA64_OPND_MSR_R3
8913 || idesc->operands[i] == IA64_OPND_PKR_R3
8914 || idesc->operands[i] == IA64_OPND_PMC_R3
8915 || idesc->operands[i] == IA64_OPND_PMD_R3
8916 || idesc->operands[i] == IA64_OPND_RR_R3
8917 || ((i >= idesc->num_outputs)
8918 && (idesc->operands[i] == IA64_OPND_R1
8919 || idesc->operands[i] == IA64_OPND_R2
8920 || idesc->operands[i] == IA64_OPND_R3
8922 || idesc->operands[i] == IA64_OPND_R3_2)))
8971 for (i = 0; i < idesc->num_outputs; i++)
8973 if (idesc->operands[i] == IA64_OPND_P1
8974 || idesc->operands[i] == IA64_OPND_P2)
9004 int or_andcm = strstr (idesc->name, "or.andcm") != NULL;
9005 int and_orcm = strstr (idesc->name, "and.orcm") != NULL;
9007 if ((idesc->operands[0] == IA64_OPND_P1
9008 || idesc->operands[0] == IA64_OPND_P2)
9016 if ((idesc->operands[1] == IA64_OPND_P1
9017 || idesc->operands[1] == IA64_OPND_P2)
9033 if (idesc->operands[1] == IA64_OPND_PR)
9065 && idesc->operands[0] == IA64_OPND_PR)
9076 && idesc->operands[0] == IA64_OPND_PR_ROT)
9093 for (i = 0; i < idesc->num_outputs; i++)
9095 if (idesc->operands[i] == IA64_OPND_P1
9096 || idesc->operands[i] == IA64_OPND_P2)
9126 int or_andcm = strstr (idesc->name, "or.andcm") != NULL;
9127 int and_orcm = strstr (idesc->name, "and.orcm") != NULL;
9129 if ((idesc->operands[0] == IA64_OPND_P1
9130 || idesc->operands[0] == IA64_OPND_P2)
9138 if ((idesc->operands[1] == IA64_OPND_P1
9139 || idesc->operands[1] == IA64_OPND_P2)
9155 if (idesc->operands[1] == IA64_OPND_PR)
9176 if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_UM)
9183 else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR)
9193 else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_L)
9219 if (idesc->operands[0] == IA64_OPND_CR3
9220 || idesc->operands[1] == IA64_OPND_CR3)
9223 ((idesc->operands[0] == IA64_OPND_CR3)
9255 if (idesc->operands[0] == IA64_OPND_AR3
9256 || idesc->operands[1] == IA64_OPND_AR3)
9259 ((idesc->operands[0] == IA64_OPND_AR3)
9286 if (idesc->operands[0] == IA64_OPND_IMMU24)
9304 for (i = 0; i < NELEMS (idesc->operands); i++)
9306 if (idesc->operands[i] == IA64_OPND_F1
9307 || idesc->operands[i] == IA64_OPND_F2
9308 || idesc->operands[i] == IA64_OPND_F3
9309 || idesc->operands[i] == IA64_OPND_F4)
9325 for (i = 0; i < idesc->num_outputs; i++)
9327 if (idesc->operands[i] == IA64_OPND_F1)
9339 for (i = 0; i < NELEMS (idesc->operands); i++)
9341 if (idesc->operands[i] == IA64_OPND_R1
9342 || idesc->operands[i] == IA64_OPND_R2
9343 || idesc->operands[i] == IA64_OPND_R3)
9360 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3)
9379 if (idesc->operands[!rsrc_write] == IA64_OPND_AR3
9385 else if (idesc->operands[0] == IA64_OPND_AR3)
9409 else if (idesc->operands[1] == IA64_OPND_AR3)
9441 if (idesc->operands[!rsrc_write] == IA64_OPND_CR3)
9475 if ((idesc->operands[0] == IA64_OPND_CR3
9477 || (idesc->operands[1] == IA64_OPND_CR3
9505 for (i = 0; i < NELEMS (idesc->operands); i++)
9507 if (idesc->operands[i] == IA64_OPND_R1
9508 || idesc->operands[i] == IA64_OPND_R2
9509 || idesc->operands[i] == IA64_OPND_R3)
9521 else if (idesc->operands[i] == IA64_OPND_F1
9522 || idesc->operands[i] == IA64_OPND_F2
9523 || idesc->operands[i] == IA64_OPND_F3
9524 || idesc->operands[i] == IA64_OPND_F4)
9533 else if (idesc->operands[i] == IA64_OPND_P1
9534 || idesc->operands[i] == IA64_OPND_P2)
9562 if (idesc->operands[2] == IA64_OPND_IMM17)
9569 if ((idesc->operands[0] == IA64_OPND_P1
9571 || (idesc->operands[1] == IA64_OPND_P2
9590 int or_andcm = strstr (idesc->name, "or.andcm") != NULL;
9591 int and_orcm = strstr (idesc->name, "and.orcm") != NULL;
9594 && (idesc->operands[0] == IA64_OPND_P1
9595 || idesc->operands[0] == IA64_OPND_P2))
9602 && (idesc->operands[1] == IA64_OPND_P1
9603 || idesc->operands[1] == IA64_OPND_P2))
9628 if (strncmp (idesc->name, "mov", 3) == 0)
9632 if (idesc->operands[0] == IA64_OPND_AR3
9640 if (idesc->operands[0] == IA64_OPND_AR3)
9648 else if (idesc->operands[1] == IA64_OPND_AR3)
9941 note_register_values (idesc)
9942 struct ia64_opcode *idesc;
9948 for (i = 0; i < idesc->num_outputs; i++)
9950 if (idesc->operands[i] == IA64_OPND_R1
9951 || idesc->operands[i] == IA64_OPND_R2
9952 || idesc->operands[i] == IA64_OPND_R3)
9958 else if (idesc->operands[i] == IA64_OPND_R3_2)
9964 else if (idesc->operands[i] == IA64_OPND_P1
9965 || idesc->operands[i] == IA64_OPND_P2)
9970 else if (idesc->operands[i] == IA64_OPND_PR)
9972 if (idesc->operands[2] & (valueT) 0x10000)
9973 qp_changemask = ~(valueT) 0x1FFFF | idesc->operands[2];
9975 qp_changemask = idesc->operands[2];
9978 else if (idesc->operands[i] == IA64_OPND_PR_ROT)
9980 if (idesc->operands[1] & ((valueT) 1 << 43))
9981 qp_changemask = -((valueT) 1 << 44) | idesc->operands[1];
9983 qp_changemask = idesc->operands[1];
9994 if (idesc->flags & IA64_OPCODE_MOD_RRBS)
9997 if (strcmp (idesc->name, "clrrrb.pr") != 0)
10007 else if (strncmp (idesc->name, "br.call", 6) == 0
10008 || strncmp (idesc->name, "brl.call", 7) == 0)
10016 else if (is_interruption_or_rfi (idesc)
10017 || is_taken_branch (idesc))
10024 else if ((idesc->operands[0] == IA64_OPND_P1
10025 || idesc->operands[0] == IA64_OPND_P2)
10026 && (idesc->operands[1] == IA64_OPND_P1
10027 || idesc->operands[1] == IA64_OPND_P2))
10042 else if (has_suffix_p (idesc->name, ".or.andcm")
10043 || has_suffix_p (idesc->name, ".and.orcm"))
10047 else if (has_suffix_p (idesc->name, ".andcm")
10048 || has_suffix_p (idesc->name, ".and"))
10052 else if (has_suffix_p (idesc->name, ".orcm")
10053 || has_suffix_p (idesc->name, ".or"))
10071 || has_suffix_p (idesc->name, ".unc"))
10086 else if (idesc->operands[0] == IA64_OPND_R1
10087 && (idesc->operands[1] == IA64_OPND_IMM22
10088 || idesc->operands[1] == IA64_OPND_IMMU64)
10090 && (strcmp (idesc->name, "mov") == 0
10091 || strcmp (idesc->name, "movl") == 0))
10108 else if (idesc->operands[0] == IA64_OPND_R1
10109 && idesc->operands[1] == IA64_OPND_IMM8
10110 && strcmp (idesc->name, "dep.z") == 0)
10167 resources_match (rs, idesc, note, qp_regno, path)
10169 struct ia64_opcode *idesc;
10184 count = specify_resource (rs->dependency, idesc, DV_CHK, specs, note, path);
10315 mark_resource (idesc, dep, spec, depind, path)
10316 struct ia64_opcode *idesc ATTRIBUTE_UNUSED;
10419 CURR_SLOT.idesc = ia64_find_opcode ("srlz.i");
10441 CURR_SLOT.idesc = ia64_find_opcode ("srlz.d");
10475 check_dependencies (idesc)
10476 struct ia64_opcode *idesc;
10478 const struct ia64_opcode_dependency *opdeps = idesc->dependencies;
10494 || (chkind = depends_on (rs->depind, idesc)) == -1)
10540 if ((matchtype = resources_match (rs, idesc, note,
10558 idesc->name,
10602 mark_resources (idesc)
10603 struct ia64_opcode *idesc;
10606 const struct ia64_opcode_dependency *opdeps = idesc->dependencies;
10613 if (is_conditional_branch (idesc) || is_interruption_or_rfi (idesc))
10619 fprintf (stderr, "Registering '%s' resource usage\n", idesc->name);
10639 count = specify_resource (dep, idesc, DV_REG, specs, note, md.path);
10643 mark_resource (idesc, dep, &specs[count],
10663 count = specify_resource (dep, idesc, DV_REG, specs, note, path);
10665 mark_resource (idesc, dep, &specs[count],
10676 update_dependencies (idesc)
10677 struct ia64_opcode *idesc;
10681 if (strcmp (idesc->name, "srlz.i") == 0)
10685 else if (strcmp (idesc->name, "srlz.d") == 0)
10689 else if (is_interruption_or_rfi (idesc)
10690 || is_taken_branch (idesc))
10698 else if (is_conditional_branch (idesc)
10701 int is_call = strstr (idesc->name, ".call") != NULL;
10757 check_dv (idesc)
10758 struct ia64_opcode *idesc;
10763 idesc->name, CURR_SLOT.src_line,
10764 idesc->dependencies->nchks,
10765 idesc->dependencies->nregs);
10771 check_dependencies (idesc);
10775 mark_resources (idesc);
10791 update_dependencies (idesc);
10795 note_register_values (idesc);
10811 struct ia64_opcode *idesc;
10833 idesc = ia64_find_opcode (mnemonic);
10835 if (!idesc)
10841 idesc = parse_operands (idesc);
10842 if (!idesc)
10846 if (idesc->type == IA64_TYPE_DYN)
10848 if (strcmp (idesc->name, "add") == 0)
10855 ia64_free_opcode (idesc);
10856 idesc = ia64_find_opcode (mnemonic);
10858 else if (strcmp (idesc->name, "mov") == 0)
10863 opnd1 = idesc->operands[0];
10864 opnd2 = idesc->operands[1];
10884 ia64_free_opcode (idesc);
10885 idesc = ia64_find_opcode (mnemonic);
10886 while (idesc != NULL
10887 && (idesc->operands[0] != opnd1
10888 || idesc->operands[1] != opnd2))
10889 idesc = get_next_opcode (idesc);
10893 else if (strcmp (idesc->name, "mov.i") == 0
10894 || strcmp (idesc->name, "mov.m") == 0)
10899 opnd1 = idesc->operands[0];
10900 opnd2 = idesc->operands[1];
10914 if (unit != 'a' && unit != idesc->name [4])
10920 else if (strcmp (idesc->name, "hint.b") == 0)
10942 flags = idesc->flags;
10969 as_bad ("`%s' cannot be predicated", idesc->name);
10975 CURR_SLOT.idesc = idesc;
11002 check_dv (idesc);