这篇教程C++ GET_RTX_LENGTH函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GET_RTX_LENGTH函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_RTX_LENGTH函数的具体用法?C++ GET_RTX_LENGTH怎么用?C++ GET_RTX_LENGTH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GET_RTX_LENGTH函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: PyGccRtl_get_operandsPyObject *PyGccRtl_get_operands(struct PyGccRtl *self, void *closure){ const int length = GET_RTX_LENGTH (GET_CODE (self->insn.inner)); PyObject *result; int i; const char *format_ptr; result = PyTuple_New(length); if (!result) { return NULL; } format_ptr = GET_RTX_FORMAT (GET_CODE (self->insn.inner)); for (i = 0; i < length; i++) { PyObject *item = get_operand_as_object(self->insn.inner, i, *format_ptr++); if (!item) { Py_DECREF(result); return NULL; } PyTuple_SET_ITEM(result, i, item); } return result;}
开发者ID:afrolovskiy,项目名称:gcc-python-plugin,代码行数:25,
示例2: nonpic_symbol_mentioned_p/* Return TRUE if X references a SYMBOL_REF or LABEL_REF whose symbol isn't protected by a PIC unspec. */intnonpic_symbol_mentioned_p (rtx x){ const char *fmt; int i; if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF || GET_CODE (x) == PC) return 1; /* We don't want to look into the possible MEM location of a CONST_DOUBLE, since we're not going to use it, in general. */ if (GET_CODE (x) == CONST_DOUBLE) return 0; if (GET_CODE (x) == UNSPEC) return 0; fmt = GET_RTX_FORMAT (GET_CODE (x)); for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) { if (fmt[i] == 'E') { int j; for (j = XVECLEN (x, i) - 1; j >= 0; j--) if (nonpic_symbol_mentioned_p (XVECEXP (x, i, j))) return 1; } else if (fmt[i] == 'e' && nonpic_symbol_mentioned_p (XEXP (x, i))) return 1; } return 0;}
开发者ID:boomeer,项目名称:gcc,代码行数:37,
示例3: purge_mem_unchanging_flagstatic voidpurge_mem_unchanging_flag (rtx x){ RTX_CODE code; int i, j; const char *fmt; if (x == NULL_RTX) return; code = GET_CODE (x); if (code == MEM) { if (RTX_UNCHANGING_P (x) && (XEXP (x, 0) == current_function_internal_arg_pointer || (GET_CODE (XEXP (x, 0)) == PLUS && XEXP (XEXP (x, 0), 0) == current_function_internal_arg_pointer && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))) RTX_UNCHANGING_P (x) = 0; return; } /* Scan all subexpressions. */ fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) { if (*fmt == 'e') purge_mem_unchanging_flag (XEXP (x, i)); else if (*fmt == 'E') for (j = 0; j < XVECLEN (x, i); j++) purge_mem_unchanging_flag (XVECEXP (x, i, j)); }}
开发者ID:robinsonb5,项目名称:zpugcc,代码行数:35,
示例4: max_operand_1static voidmax_operand_1 (rtx x){ RTX_CODE code; int i; int len; const char *fmt; if (x == 0) return; code = GET_CODE (x); if (code == MATCH_OPERAND || code == MATCH_OPERATOR || code == MATCH_PARALLEL) max_opno = MAX (max_opno, XINT (x, 0)); fmt = GET_RTX_FORMAT (code); len = GET_RTX_LENGTH (code); for (i = 0; i < len; i++) { if (fmt[i] == 'e' || fmt[i] == 'u') max_operand_1 (XEXP (x, i)); else if (fmt[i] == 'E') { int j; for (j = 0; j < XVECLEN (x, i); j++) max_operand_1 (XVECEXP (x, i, j)); } }}
开发者ID:DJHartley,项目名称:iphone-dev,代码行数:31,
示例5: unknown/* Return true if X contains memory or some UNSPEC. We can not just check insn operands as memory or unspec might be not an operand itself but contain an operand. Insn with memory access is not profitable for rematerialization. Rematerialization of UNSPEC might result in wrong code generation as the UNPEC effect is unknown (e.g. generating a label). */static boolbad_for_rematerialization_p (rtx x){ int i, j; const char *fmt; enum rtx_code code; if (MEM_P (x) || GET_CODE (x) == UNSPEC || GET_CODE (x) == UNSPEC_VOLATILE) return true; code = GET_CODE (x); fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') { if (bad_for_rematerialization_p (XEXP (x, i))) return true; } else if (fmt[i] == 'E') { for (j = XVECLEN (x, i) - 1; j >= 0; j--) if (bad_for_rematerialization_p (XVECEXP (x, i, j))) return true; } } return false;}
开发者ID:iovisor-obsolete,项目名称:bpf_gcc,代码行数:33,
示例6: rtl_check_failed_boundsvoidrtl_check_failed_bounds (const_rtx r, int n, const char *file, int line, const char *func){ internal_error ("RTL check: access of elt %d of '%s' with last elt %d in %s, at %s:%d", n, GET_RTX_NAME (GET_CODE (r)), GET_RTX_LENGTH (GET_CODE (r)) - 1, func, trim_filename (file), line);}
开发者ID:keparo,项目名称:gcc,代码行数:9,
示例7: collect_insn_datastatic voidcollect_insn_data (rtx pattern, int *palt, int *pmax){ const char *fmt; enum rtx_code code; int i, j, len; code = GET_CODE (pattern); switch (code) { case MATCH_OPERAND: i = n_alternatives (XSTR (pattern, 2)); *palt = (i > *palt ? i : *palt); /* Fall through. */ case MATCH_OPERATOR: case MATCH_SCRATCH: case MATCH_PARALLEL: case MATCH_INSN: i = XINT (pattern, 0); if (i > *pmax) *pmax = i; break; default: break; } fmt = GET_RTX_FORMAT (code); len = GET_RTX_LENGTH (code); for (i = 0; i < len; i++) { switch (fmt[i]) { case 'e': case 'u': collect_insn_data (XEXP (pattern, i), palt, pmax); break; case 'V': if (XVEC (pattern, i) == NULL) break; /* Fall through. */ case 'E': for (j = XVECLEN (pattern, i) - 1; j >= 0; --j) collect_insn_data (XVECEXP (pattern, i, j), palt, pmax); break; case 'i': case 'w': case '0': case 's': case 'S': case 'T': break; default: abort (); } }}
开发者ID:Fokycnuk,项目名称:gcc,代码行数:55,
示例8: that/* Process MEMs in SET_DEST destinations. We must not process this together with REG SET_DESTs, but must do it separately, lest when we see [(set (reg:SI foo) (bar)) (set (mem:SI (reg:SI foo) (baz)))] struct_equiv_block_eq could get confused to assume that (reg:SI foo) is not live before this instruction. */static boolset_dest_addr_equiv_p (rtx x, rtx y, struct equiv_info *info){ enum rtx_code code = GET_CODE (x); int length; const char *format; int i; if (code != GET_CODE (y)) return false; if (code == MEM) return rtx_equiv_p (&XEXP (x, 0), XEXP (y, 0), 1, info); /* Process subexpressions. */ length = GET_RTX_LENGTH (code); format = GET_RTX_FORMAT (code); for (i = 0; i < length; ++i) { switch (format[i]) { case 'V': case 'E': if (XVECLEN (x, i) != XVECLEN (y, i)) return false; if (XVEC (x, i) != 0) { int j; for (j = 0; j < XVECLEN (x, i); ++j) { if (! set_dest_addr_equiv_p (XVECEXP (x, i, j), XVECEXP (y, i, j), info)) return false; } } break; case 'e': if (! set_dest_addr_equiv_p (XEXP (x, i), XEXP (y, i), info)) return false; break; default: break; } } return true;}
开发者ID:0mp,项目名称:freebsd,代码行数:52,
示例9: substitute/* Change pseudos in *LOC on their coalescing group representatives. */static boolsubstitute (rtx *loc){ int i, regno; const char *fmt; enum rtx_code code; bool res; if (*loc == NULL_RTX) return false; code = GET_CODE (*loc); if (code == REG) { regno = REGNO (*loc); if (regno < FIRST_PSEUDO_REGISTER || first_coalesced_pseudo[regno] == regno) return false; *loc = regno_reg_rtx[first_coalesced_pseudo[regno]]; return true; } res = false; fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') { if (substitute (&XEXP (*loc, i))) res = true; } else if (fmt[i] == 'E') { int j; for (j = XVECLEN (*loc, i) - 1; j >= 0; j--) if (substitute (&XVECEXP (*loc, i, j))) res = true; } } return res;}
开发者ID:ChaosJohn,项目名称:gcc,代码行数:43,
示例10: references_value_pintreferences_value_p (const_rtx x, int only_useless){ const enum rtx_code code = GET_CODE (x); const char *fmt = GET_RTX_FORMAT (code); int i, j; if (GET_CODE (x) == VALUE && (! only_useless || CSELIB_VAL_PTR (x)->locs == 0)) return 1; for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e' && references_value_p (XEXP (x, i), only_useless)) return 1; else if (fmt[i] == 'E') for (j = 0; j < XVECLEN (x, i); j++) if (references_value_p (XVECEXP (x, i, j), only_useless)) return 1; } return 0;}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:23,
示例11: uses_addressofstatic intuses_addressof (rtx x){ RTX_CODE code; int i, j; const char *fmt; if (x == NULL_RTX) return 0; code = GET_CODE (x); if (code == ADDRESSOF || x == current_function_internal_arg_pointer) return 1; if (code == MEM) return 0; /* Scan all subexpressions. */ fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) { if (*fmt == 'e') { if (uses_addressof (XEXP (x, i))) return 1; } else if (*fmt == 'E') { for (j = 0; j < XVECLEN (x, i); j++) if (uses_addressof (XVECEXP (x, i, j))) return 1; } } return 0;}
开发者ID:robinsonb5,项目名称:zpugcc,代码行数:36,
示例12: mark_not_eliminable//.........这里部分代码省略......... else if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER) { /* If we modify the source of an elimination rule, disable it. Do the same if it is the destination and not the hard frame register. */ for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == XEXP (x, 0) || (ep->to_rtx == XEXP (x, 0) && ep->to_rtx != hard_frame_pointer_rtx)) setup_can_eliminate (ep, false); } return; case USE: if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER) /* If using a hard register that is the source of an eliminate we still think can be performed, note it cannot be performed since we don't know how this hard register is used. */ for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == XEXP (x, 0) && ep->to_rtx != hard_frame_pointer_rtx) setup_can_eliminate (ep, false); return; case CLOBBER: if (REG_P (XEXP (x, 0)) && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER) /* If clobbering a hard register that is the replacement register for an elimination we still think can be performed, note that it cannot be performed. Otherwise, we need not be concerned about it. */ for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->to_rtx == XEXP (x, 0) && ep->to_rtx != hard_frame_pointer_rtx) setup_can_eliminate (ep, false); return; case SET: if (SET_DEST (x) == stack_pointer_rtx && GET_CODE (SET_SRC (x)) == PLUS && XEXP (SET_SRC (x), 0) == SET_DEST (x) && CONST_INT_P (XEXP (SET_SRC (x), 1))) { curr_sp_change += INTVAL (XEXP (SET_SRC (x), 1)); return; } if (! REG_P (SET_DEST (x)) || REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER) mark_not_eliminable (SET_DEST (x), mem_mode); else { /* See if this is setting the replacement hard register for an elimination. If DEST is the hard frame pointer, we do nothing because we assume that all assignments to the frame pointer are for non-local gotos and are being done at a time when they are valid and do not disturb anything else. Some machines want to eliminate a fake argument pointer (or even a fake frame pointer) with either the real frame pointer or the stack pointer. Assignments to the hard frame pointer must not prevent this elimination. */ for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->to_rtx == SET_DEST (x) && SET_DEST (x) != hard_frame_pointer_rtx) setup_can_eliminate (ep, false); } mark_not_eliminable (SET_SRC (x), mem_mode); return; case MEM: /* Our only special processing is to pass the mode of the MEM to our recursive call. */ mark_not_eliminable (XEXP (x, 0), GET_MODE (x)); return; default: break; } fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) { if (*fmt == 'e') mark_not_eliminable (XEXP (x, i), mem_mode); else if (*fmt == 'E') for (j = 0; j < XVECLEN (x, i); j++) mark_not_eliminable (XVECEXP (x, i, j), mem_mode); }}
开发者ID:paranoiacblack,项目名称:gcc,代码行数:101,
示例13: rtx_hash/* Recursive hash function for RTL X. */static hashval_trtx_hash (rtx x){ int i, j; enum rtx_code code; const char *fmt; hashval_t val = 0; if (x == 0) return val; code = GET_CODE (x); val += (int) code + 4095; /* Some RTL can be compared nonrecursively. */ switch (code) { case REG: return val + REGNO (x); case LABEL_REF: return iterative_hash_object (XEXP (x, 0), val); case SYMBOL_REF: return iterative_hash_object (XSTR (x, 0), val); case SCRATCH: case CONST_DOUBLE: case CONST_INT: case CONST_VECTOR: return val; default: break; } /* Hash the elements. */ fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { switch (fmt[i]) { case 'w': val += XWINT (x, i); break; case 'n': case 'i': val += XINT (x, i); break; case 'V': case 'E': val += XVECLEN (x, i); for (j = 0; j < XVECLEN (x, i); j++) val += rtx_hash (XVECEXP (x, i, j)); break; case 'e': val += rtx_hash (XEXP (x, i)); break; case 'S': case 's': val += htab_hash_string (XSTR (x, i)); break; case 'u': case '0': case 't': break; /* It is believed that rtx's at this level will never contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: abort (); } } return val;}
开发者ID:iovisor-obsolete,项目名称:bpf_gcc,代码行数:83,
示例14: iterative_hash_rtxhashval_titerative_hash_rtx (const_rtx x, hashval_t hash){ enum rtx_code code; enum machine_mode mode; int i, j; const char *fmt; if (x == NULL_RTX) return hash; code = GET_CODE (x); hash = iterative_hash_object (code, hash); mode = GET_MODE (x); hash = iterative_hash_object (mode, hash); switch (code) { case REG: i = REGNO (x); return iterative_hash_object (i, hash); case CONST_INT: return iterative_hash_object (INTVAL (x), hash); case SYMBOL_REF: if (XSTR (x, 0)) return iterative_hash (XSTR (x, 0), strlen (XSTR (x, 0)) + 1, hash); return hash; case LABEL_REF: case DEBUG_EXPR: case VALUE: case SCRATCH: case CONST_DOUBLE: case CONST_FIXED: case DEBUG_IMPLICIT_PTR: case DEBUG_PARAMETER_REF: return hash; default: break; } fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) switch (fmt[i]) { case 'w': hash = iterative_hash_object (XWINT (x, i), hash); break; case 'n': case 'i': hash = iterative_hash_object (XINT (x, i), hash); break; case 'V': case 'E': j = XVECLEN (x, i); hash = iterative_hash_object (j, hash); for (j = 0; j < XVECLEN (x, i); j++) hash = iterative_hash_rtx (XVECEXP (x, i, j), hash); break; case 'e': hash = iterative_hash_rtx (XEXP (x, i), hash); break; case 'S': case 's': if (XSTR (x, i)) hash = iterative_hash (XSTR (x, 0), strlen (XSTR (x, 0)) + 1, hash); break; default: break; } return hash;}
开发者ID:keparo,项目名称:gcc,代码行数:71,
示例15: rtx_equal_pintrtx_equal_p (const_rtx x, const_rtx y){ int i; int j; enum rtx_code code; const char *fmt; if (x == y) return 1; if (x == 0 || y == 0) return 0; code = GET_CODE (x); /* Rtx's of different codes cannot be equal. */ if (code != GET_CODE (y)) return 0; /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. (REG:SI x) and (REG:HI x) are NOT equivalent. */ if (GET_MODE (x) != GET_MODE (y)) return 0; /* MEMs referring to different address space are not equivalent. */ if (code == MEM && MEM_ADDR_SPACE (x) != MEM_ADDR_SPACE (y)) return 0; /* Some RTL can be compared nonrecursively. */ switch (code) { case REG: return (REGNO (x) == REGNO (y)); case LABEL_REF: return XEXP (x, 0) == XEXP (y, 0); case SYMBOL_REF: return XSTR (x, 0) == XSTR (y, 0); case DEBUG_EXPR: case VALUE: case SCRATCH: case CONST_DOUBLE: case CONST_INT: case CONST_FIXED: return 0; case DEBUG_IMPLICIT_PTR: return DEBUG_IMPLICIT_PTR_DECL (x) == DEBUG_IMPLICIT_PTR_DECL (y); case DEBUG_PARAMETER_REF: return DEBUG_PARAMETER_REF_DECL (x) == DEBUG_PARAMETER_REF_DECL (y); case ENTRY_VALUE: return rtx_equal_p (ENTRY_VALUE_EXP (x), ENTRY_VALUE_EXP (y)); default: break; } /* Compare the elements. If any pair of corresponding elements fail to match, return 0 for the whole thing. */ fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { switch (fmt[i]) { case 'w': if (XWINT (x, i) != XWINT (y, i)) return 0; break; case 'n': case 'i': if (XINT (x, i) != XINT (y, i)) {#ifndef GENERATOR_FILE if (((code == ASM_OPERANDS && i == 6) || (code == ASM_INPUT && i == 1)) && locator_eq (XINT (x, i), XINT (y, i))) break;#endif return 0; } break; case 'V': case 'E': /* Two vectors must have the same length. */ if (XVECLEN (x, i) != XVECLEN (y, i)) return 0; /* And the corresponding elements must match. */ for (j = 0; j < XVECLEN (x, i); j++) if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) return 0;//.........这里部分代码省略.........
开发者ID:keparo,项目名称:gcc,代码行数:101,
示例16: add_rtxvoidadd_rtx (const_rtx x, hash &hstate){ enum rtx_code code; machine_mode mode; int i, j; const char *fmt; if (x == NULL_RTX) return; code = GET_CODE (x); hstate.add_object (code); mode = GET_MODE (x); hstate.add_object (mode); switch (code) { case REG: hstate.add_int (REGNO (x)); return; case CONST_INT: hstate.add_object (INTVAL (x)); return; case CONST_WIDE_INT: for (i = 0; i < CONST_WIDE_INT_NUNITS (x); i++) hstate.add_object (CONST_WIDE_INT_ELT (x, i)); return; case CONST_POLY_INT: for (i = 0; i < NUM_POLY_INT_COEFFS; ++i) hstate.add_wide_int (CONST_POLY_INT_COEFFS (x)[i]); break; case SYMBOL_REF: if (XSTR (x, 0)) hstate.add (XSTR (x, 0), strlen (XSTR (x, 0)) + 1); return; case LABEL_REF: case DEBUG_EXPR: case VALUE: case SCRATCH: case CONST_DOUBLE: case CONST_FIXED: case DEBUG_IMPLICIT_PTR: case DEBUG_PARAMETER_REF: return; default: break; } fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) switch (fmt[i]) { case 'w': hstate.add_hwi (XWINT (x, i)); break; case 'n': case 'i': hstate.add_int (XINT (x, i)); break; case 'p': hstate.add_poly_int (SUBREG_BYTE (x)); break; case 'V': case 'E': j = XVECLEN (x, i); hstate.add_int (j); for (j = 0; j < XVECLEN (x, i); j++) inchash::add_rtx (XVECEXP (x, i, j), hstate); break; case 'e': inchash::add_rtx (XEXP (x, i), hstate); break; case 'S': case 's': if (XSTR (x, i)) hstate.add (XSTR (x, 0), strlen (XSTR (x, 0)) + 1); break; default: break; }}
开发者ID:MaxKellermann,项目名称:gcc,代码行数:80,
示例17: find_addressstatic intfind_address (rtx *address_of_x){ rtx x = *address_of_x; enum rtx_code code = GET_CODE (x); const char *const fmt = GET_RTX_FORMAT (code); int i; int value = 0; int tem; if (code == MEM && rtx_equal_p (XEXP (x, 0), inc_insn.reg_res)) { /* Match with *reg0. */ mem_insn.mem_loc = address_of_x; mem_insn.reg0 = inc_insn.reg_res; mem_insn.reg1_is_const = true; mem_insn.reg1_val = 0; mem_insn.reg1 = GEN_INT (0); return -1; } if (code == MEM && GET_CODE (XEXP (x, 0)) == PLUS && rtx_equal_p (XEXP (XEXP (x, 0), 0), inc_insn.reg_res)) { rtx b = XEXP (XEXP (x, 0), 1); mem_insn.mem_loc = address_of_x; mem_insn.reg0 = inc_insn.reg_res; mem_insn.reg1 = b; mem_insn.reg1_is_const = inc_insn.reg1_is_const; if (CONST_INT_P (b)) { /* Match with *(reg0 + reg1) where reg1 is a const. */ HOST_WIDE_INT val = INTVAL (b); if (inc_insn.reg1_is_const && (inc_insn.reg1_val == val || inc_insn.reg1_val == -val)) { mem_insn.reg1_val = val; return -1; } } else if (!inc_insn.reg1_is_const && rtx_equal_p (inc_insn.reg1, b)) /* Match with *(reg0 + reg1). */ return -1; } if (code == SIGN_EXTRACT || code == ZERO_EXTRACT) { /* If REG occurs inside a MEM used in a bit-field reference, that is unacceptable. */ if (find_address (&XEXP (x, 0))) return 1; } if (x == inc_insn.reg_res) return 1; /* Time for some deep diving. */ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') { tem = find_address (&XEXP (x, i)); /* If this is the first use, let it go so the rest of the insn can be checked. */ if (value == 0) value = tem; else if (tem != 0) /* More than one match was found. */ return 1; } else if (fmt[i] == 'E') { int j; for (j = XVECLEN (x, i) - 1; j >= 0; j--) { tem = find_address (&XVECEXP (x, i, j)); /* If this is the first use, let it go so the rest of the insn can be checked. */ if (value == 0) value = tem; else if (tem != 0) /* More than one match was found. */ return 1; } } } return value;}
开发者ID:nevinhappy,项目名称:gcc,代码行数:88,
示例18: replacement//.........这里部分代码省略......... update_sp_offset, full_p); if (new_rtx != SUBREG_REG (x)) { int x_size = GET_MODE_SIZE (GET_MODE (x)); int new_size = GET_MODE_SIZE (GET_MODE (new_rtx)); if (MEM_P (new_rtx) && x_size <= new_size) { SUBREG_REG (x) = new_rtx; alter_subreg (&x, false); return x; } else if (! subst_p) { /* LRA can transform subregs itself. So don't call simplify_gen_subreg until LRA transformations are finished. Function simplify_gen_subreg can do non-trivial transformations (like truncation) which might make LRA work to fail. */ SUBREG_REG (x) = new_rtx; return x; } else return simplify_gen_subreg (GET_MODE (x), new_rtx, GET_MODE (new_rtx), SUBREG_BYTE (x)); } return x; case MEM: /* Our only special processing is to pass the mode of the MEM to our recursive call and copy the flags. While we are here, handle this case more efficiently. */ return replace_equiv_address_nv (x, lra_eliminate_regs_1 (insn, XEXP (x, 0), GET_MODE (x), subst_p, update_p, update_sp_offset, full_p)); case USE: /* Handle insn_list USE that a call to a pure function may generate. */ new_rtx = lra_eliminate_regs_1 (insn, XEXP (x, 0), VOIDmode, subst_p, update_p, update_sp_offset, full_p); if (new_rtx != XEXP (x, 0)) return gen_rtx_USE (GET_MODE (x), new_rtx); return x; case CLOBBER: case SET: gcc_unreachable (); default: break; } /* Process each of our operands recursively. If any have changed, make a copy of the rtx. */ fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) { if (*fmt == 'e') { new_rtx = lra_eliminate_regs_1 (insn, XEXP (x, i), mem_mode, subst_p, update_p, update_sp_offset, full_p); if (new_rtx != XEXP (x, i) && ! copied) { x = shallow_copy_rtx (x); copied = 1; } XEXP (x, i) = new_rtx; } else if (*fmt == 'E') { int copied_vec = 0; for (j = 0; j < XVECLEN (x, i); j++) { new_rtx = lra_eliminate_regs_1 (insn, XVECEXP (x, i, j), mem_mode, subst_p, update_p, update_sp_offset, full_p); if (new_rtx != XVECEXP (x, i, j) && ! copied_vec) { rtvec new_v = gen_rtvec_v (XVECLEN (x, i), XVEC (x, i)->elem); if (! copied) { x = shallow_copy_rtx (x); copied = 1; } XVEC (x, i) = new_v; copied_vec = 1; } XVECEXP (x, i, j) = new_rtx; } } } return x;}
开发者ID:paranoiacblack,项目名称:gcc,代码行数:101,
示例19: find_memstatic boolfind_mem (rtx *address_of_x){ rtx x = *address_of_x; enum rtx_code code = GET_CODE (x); const char *const fmt = GET_RTX_FORMAT (code); int i; if (code == MEM && REG_P (XEXP (x, 0))) { /* Match with *reg0. */ mem_insn.mem_loc = address_of_x; mem_insn.reg0 = XEXP (x, 0); mem_insn.reg1_is_const = true; mem_insn.reg1_val = 0; mem_insn.reg1 = GEN_INT (0); if (find_inc (true)) return true; } if (code == MEM && GET_CODE (XEXP (x, 0)) == PLUS && REG_P (XEXP (XEXP (x, 0), 0))) { rtx reg1 = XEXP (XEXP (x, 0), 1); mem_insn.mem_loc = address_of_x; mem_insn.reg0 = XEXP (XEXP (x, 0), 0); mem_insn.reg1 = reg1; if (CONST_INT_P (reg1)) { mem_insn.reg1_is_const = true; /* Match with *(reg0 + c) where c is a const. */ mem_insn.reg1_val = INTVAL (reg1); if (find_inc (true)) return true; } else if (REG_P (reg1)) { /* Match with *(reg0 + reg1). */ mem_insn.reg1_is_const = false; if (find_inc (true)) return true; } } if (code == SIGN_EXTRACT || code == ZERO_EXTRACT) { /* If REG occurs inside a MEM used in a bit-field reference, that is unacceptable. */ return false; } /* Time for some deep diving. */ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') { if (find_mem (&XEXP (x, i))) return true; } else if (fmt[i] == 'E') { int j; for (j = XVECLEN (x, i) - 1; j >= 0; j--) if (find_mem (&XVECEXP (x, i, j))) return true; } } return false;}
开发者ID:nevinhappy,项目名称:gcc,代码行数:68,
示例20: walk_insn_part//.........这里部分代码省略......... break; case MATCH_OPERAND: if (XINT (part, 0) > max_recog_operands) max_recog_operands = XINT (part, 0); return; case MATCH_OP_DUP: case MATCH_PAR_DUP: ++dup_operands_seen_this_insn; /* FALLTHRU */ case MATCH_SCRATCH: case MATCH_PARALLEL: case MATCH_OPERATOR: if (XINT (part, 0) > max_recog_operands) max_recog_operands = XINT (part, 0); /* Now scan the rtl's in the vector inside the MATCH_OPERATOR or MATCH_PARALLEL. */ break; case LABEL_REF: if (GET_CODE (LABEL_REF_LABEL (part)) == MATCH_OPERAND || GET_CODE (LABEL_REF_LABEL (part)) == MATCH_DUP) break; return; case MATCH_DUP: ++dup_operands_seen_this_insn; if (XINT (part, 0) > max_recog_operands) max_recog_operands = XINT (part, 0); return; case CC0: if (recog_p) have_cc0_flag = 1; return; case LO_SUM: if (recog_p) have_lo_sum_flag = 1; return; case ROTATE: if (recog_p) have_rotate_flag = 1; return; case ROTATERT: if (recog_p) have_rotatert_flag = 1; return; case SET: walk_insn_part (SET_DEST (part), 0, recog_p); walk_insn_part (SET_SRC (part), recog_p, GET_CODE (SET_DEST (part)) != PC); return; case IF_THEN_ELSE: /* Only consider this machine as having a conditional move if the two arms of the IF_THEN_ELSE are both MATCH_OPERAND. Otherwise, we have some specific IF_THEN_ELSE construct (like the doz instruction on the RS/6000) that can't be used in the general context we want it for. */ if (recog_p && non_pc_set_src && GET_CODE (XEXP (part, 1)) == MATCH_OPERAND && GET_CODE (XEXP (part, 2)) == MATCH_OPERAND) have_cmove_flag = 1; break; case COND_EXEC: if (recog_p) have_cond_exec_flag = 1; break; case REG: case CONST_INT: case SYMBOL_REF: case PC: return; default: break; } format_ptr = GET_RTX_FORMAT (GET_CODE (part)); for (i = 0; i < GET_RTX_LENGTH (GET_CODE (part)); i++) switch (*format_ptr++) { case 'e': case 'u': walk_insn_part (XEXP (part, i), recog_p, non_pc_set_src); break; case 'E': if (XVEC (part, i) != NULL) for (j = 0; j < XVECLEN (part, i); j++) walk_insn_part (XVECEXP (part, i, j), recog_p, non_pc_set_src); break; }}
开发者ID:markus-oberhumer,项目名称:gcc,代码行数:101,
示例21: replace_oldest_value_addr//.........这里部分代码省略......... index_code = GET_CODE (*locI); } else if (code1 == MULT || code1 == SIGN_EXTEND || code1 == TRUNCATE || code1 == ZERO_EXTEND || code0 == MEM) { locI = &XEXP (x, 1); locB = &XEXP (x, 0); index_code = GET_CODE (*locI); } else if (code0 == CONST_INT || code0 == CONST || code0 == SYMBOL_REF || code0 == LABEL_REF) { locB = &XEXP (x, 1); index_code = GET_CODE (XEXP (x, 0)); } else if (code1 == CONST_INT || code1 == CONST || code1 == SYMBOL_REF || code1 == LABEL_REF) { locB = &XEXP (x, 0); index_code = GET_CODE (XEXP (x, 1)); } else if (code0 == REG && code1 == REG) { int index_op; unsigned regno0 = REGNO (op0), regno1 = REGNO (op1); if (REGNO_OK_FOR_INDEX_P (regno1) && regno_ok_for_base_p (regno0, mode, as, PLUS, REG)) index_op = 1; else if (REGNO_OK_FOR_INDEX_P (regno0) && regno_ok_for_base_p (regno1, mode, as, PLUS, REG)) index_op = 0; else if (regno_ok_for_base_p (regno0, mode, as, PLUS, REG) || REGNO_OK_FOR_INDEX_P (regno1)) index_op = 1; else if (regno_ok_for_base_p (regno1, mode, as, PLUS, REG)) index_op = 0; else index_op = 1; locI = &XEXP (x, index_op); locB = &XEXP (x, !index_op); index_code = GET_CODE (*locI); } else if (code0 == REG) { locI = &XEXP (x, 0); locB = &XEXP (x, 1); index_code = GET_CODE (*locI); } else if (code1 == REG) { locI = &XEXP (x, 1); locB = &XEXP (x, 0); index_code = GET_CODE (*locI); } if (locI) changed |= replace_oldest_value_addr (locI, INDEX_REG_CLASS, mode, as, insn, vd); if (locB) changed |= replace_oldest_value_addr (locB, base_reg_class (mode, as, PLUS, index_code), mode, as, insn, vd); return changed; } case POST_INC: case POST_DEC: case POST_MODIFY: case PRE_INC: case PRE_DEC: case PRE_MODIFY: return false; case MEM: return replace_oldest_value_mem (x, insn, vd); case REG: return replace_oldest_value_reg (loc, cl, insn, vd); default: break; } fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { if (fmt[i] == 'e') changed |= replace_oldest_value_addr (&XEXP (x, i), cl, mode, as, insn, vd); else if (fmt[i] == 'E') for (j = XVECLEN (x, i) - 1; j >= 0; j--) changed |= replace_oldest_value_addr (&XVECEXP (x, i, j), cl, mode, as, insn, vd); } return changed;}
开发者ID:Mustaavalkosta,项目名称:toolchain_gcc,代码行数:101,
示例22: rtx_equal_pintrtx_equal_p (rtx x, rtx y){ int i; int j; enum rtx_code code; const char *fmt; if (x == y) return 1; if (x == 0 || y == 0) return 0; code = GET_CODE (x); /* Rtx's of different codes cannot be equal. */ if (code != GET_CODE (y)) return 0; /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. (REG:SI x) and (REG:HI x) are NOT equivalent. */ if (GET_MODE (x) != GET_MODE (y)) return 0; /* Some RTL can be compared nonrecursively. */ switch (code) { case REG: return (REGNO (x) == REGNO (y)); case LABEL_REF: return XEXP (x, 0) == XEXP (y, 0); case SYMBOL_REF: return XSTR (x, 0) == XSTR (y, 0); case SCRATCH: case CONST_DOUBLE: case CONST_INT: return 0; default: break; } /* Compare the elements. If any pair of corresponding elements fail to match, return 0 for the whole thing. */ fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { switch (fmt[i]) { case 'w': if (XWINT (x, i) != XWINT (y, i)) return 0; break; case 'n': case 'i': if (XINT (x, i) != XINT (y, i)) return 0; break; case 'V': case 'E': /* Two vectors must have the same length. */ if (XVECLEN (x, i) != XVECLEN (y, i)) return 0; /* And the corresponding elements must match. */ for (j = 0; j < XVECLEN (x, i); j++) if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) return 0; break; case 'e': if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0) return 0; break; case 'S': case 's': if ((XSTR (x, i) || XSTR (y, i)) && (! XSTR (x, i) || ! XSTR (y, i) || strcmp (XSTR (x, i), XSTR (y, i)))) return 0; break; case 'u': /* These are just backpointers, so they don't matter. */ break; case '0': case 't': break; /* It is believed that rtx's at this level will never contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. *///.........这里部分代码省略.........
开发者ID:ochafik,项目名称:gccxml,代码行数:101,
示例23: gen_exp//.........这里部分代码省略......... return; case PC: printf ("pc_rtx"); return; case RETURN: printf ("ret_rtx"); return; case SIMPLE_RETURN: printf ("simple_return_rtx"); return; case CLOBBER: if (REG_P (XEXP (x, 0))) { printf ("gen_hard_reg_clobber (%smode, %i)", GET_MODE_NAME (GET_MODE (XEXP (x, 0))), REGNO (XEXP (x, 0))); return; } break; case CC0: printf ("cc0_rtx"); return; case CONST_INT: if (INTVAL (x) == 0) printf ("const0_rtx"); else if (INTVAL (x) == 1) printf ("const1_rtx"); else if (INTVAL (x) == -1) printf ("constm1_rtx"); else if (-MAX_SAVED_CONST_INT <= INTVAL (x) && INTVAL (x) <= MAX_SAVED_CONST_INT) printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", (int) INTVAL (x)); else if (INTVAL (x) == STORE_FLAG_VALUE) printf ("const_true_rtx"); else { printf ("GEN_INT ("); printf (HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x)); printf (")"); } return; case CONST_DOUBLE: case CONST_FIXED: case CONST_WIDE_INT: /* These shouldn't be written in MD files. Instead, the appropriate routines in varasm.c should be called. */ gcc_unreachable (); default: break; } printf ("gen_rtx_"); print_code (code); printf (" (%smode", GET_MODE_NAME (GET_MODE (x))); fmt = GET_RTX_FORMAT (code); len = GET_RTX_LENGTH (code); for (i = 0; i < len; i++) { if (fmt[i] == '0') break; printf (",/n/t"); switch (fmt[i]) { case 'e': case 'u': gen_exp (XEXP (x, i), subroutine_type, used); break; case 'i': printf ("%u", XINT (x, i)); break; case 's': printf ("/"%s/"", XSTR (x, i)); break; case 'E': { int j; printf ("gen_rtvec (%d", XVECLEN (x, i)); for (j = 0; j < XVECLEN (x, i); j++) { printf (",/n/t/t"); gen_exp (XVECEXP (x, i, j), subroutine_type, used); } printf (")"); break; } default: gcc_unreachable (); } } printf (")");}
开发者ID:CookieChen,项目名称:gcc,代码行数:101,
示例24: copy_rtxrtxcopy_rtx (rtx orig){ rtx copy; int i, j; RTX_CODE code; const char *format_ptr; code = GET_CODE (orig); switch (code) { case REG: case DEBUG_EXPR: case VALUE: case CONST_INT: case CONST_DOUBLE: case CONST_FIXED: case CONST_VECTOR: case SYMBOL_REF: case CODE_LABEL: case PC: case CC0: case RETURN: case SIMPLE_RETURN: case SCRATCH: /* SCRATCH must be shared because they represent distinct values. */ return orig; case CLOBBER: if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER) return orig; break; case CONST: if (shared_const_p (orig)) return orig; break; /* A MEM with a constant address is not sharable. The problem is that the constant address may need to be reloaded. If the mem is shared, then reloading one copy of this mem will cause all copies to appear to have been reloaded. */ default: break; } /* Copy the various flags, fields, and other information. We assume that all fields need copying, and then clear the fields that should not be copied. That is the sensible default behavior, and forces us to explicitly document why we are *not* copying a flag. */ copy = shallow_copy_rtx (orig); /* We do not copy the USED flag, which is used as a mark bit during walks over the RTL. */ RTX_FLAG (copy, used) = 0; format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++) switch (*format_ptr++) { case 'e': if (XEXP (orig, i) != NULL) XEXP (copy, i) = copy_rtx (XEXP (orig, i)); break; case 'E': case 'V': if (XVEC (orig, i) != NULL) { XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i)); for (j = 0; j < XVECLEN (copy, i); j++) XVECEXP (copy, i, j) = copy_rtx (XVECEXP (orig, i, j)); } break; case 't': case 'w': case 'i': case 's': case 'S': case 'T': case 'u': case 'B': case '0': /* These are left unchanged. */ break; default: gcc_unreachable (); } return copy;}
开发者ID:keparo,项目名称:gcc,代码行数:94,
示例25: print_rtxstatic voidprint_rtx (const_rtx in_rtx){ int i = 0; int j; const char *format_ptr; int is_insn; if (sawclose) { if (flag_simple) fputc (' ', outfile); else fprintf (outfile, "/n%s%*s", print_rtx_head, indent * 2, ""); sawclose = 0; } if (in_rtx == 0) { fputs ("(nil)", outfile); sawclose = 1; return; } else if (GET_CODE (in_rtx) > NUM_RTX_CODE) { fprintf (outfile, "(??? bad code %d/n%s%*s)", GET_CODE (in_rtx), print_rtx_head, indent * 2, ""); sawclose = 1; return; } is_insn = INSN_P (in_rtx); /* Print name of expression code. */ if (flag_simple && CONST_INT_P (in_rtx)) fputc ('(', outfile); else fprintf (outfile, "(%s", GET_RTX_NAME (GET_CODE (in_rtx))); if (! flag_simple) { if (RTX_FLAG (in_rtx, in_struct)) fputs ("/s", outfile); if (RTX_FLAG (in_rtx, volatil)) fputs ("/v", outfile); if (RTX_FLAG (in_rtx, unchanging)) fputs ("/u", outfile); if (RTX_FLAG (in_rtx, frame_related)) fputs ("/f", outfile); if (RTX_FLAG (in_rtx, jump)) fputs ("/j", outfile); if (RTX_FLAG (in_rtx, call)) fputs ("/c", outfile); if (RTX_FLAG (in_rtx, return_val)) fputs ("/i", outfile); /* Print REG_NOTE names for EXPR_LIST and INSN_LIST. */ if ((GET_CODE (in_rtx) == EXPR_LIST || GET_CODE (in_rtx) == INSN_LIST || GET_CODE (in_rtx) == INT_LIST) && (int)GET_MODE (in_rtx) < REG_NOTE_MAX) fprintf (outfile, ":%s", GET_REG_NOTE_NAME (GET_MODE (in_rtx))); /* For other rtl, print the mode if it's not VOID. */ else if (GET_MODE (in_rtx) != VOIDmode) fprintf (outfile, ":%s", GET_MODE_NAME (GET_MODE (in_rtx)));#ifndef GENERATOR_FILE if (GET_CODE (in_rtx) == VAR_LOCATION) { if (TREE_CODE (PAT_VAR_LOCATION_DECL (in_rtx)) == STRING_CST) fputs (" <debug string placeholder>", outfile); else print_mem_expr (outfile, PAT_VAR_LOCATION_DECL (in_rtx)); fputc (' ', outfile); print_rtx (PAT_VAR_LOCATION_LOC (in_rtx)); if (PAT_VAR_LOCATION_STATUS (in_rtx) == VAR_INIT_STATUS_UNINITIALIZED) fprintf (outfile, " [uninit]"); sawclose = 1; i = GET_RTX_LENGTH (VAR_LOCATION); }#endif }#ifndef GENERATOR_FILE if (CONST_DOUBLE_AS_FLOAT_P (in_rtx)) i = 5;#endif /* Get the format string and skip the first elements if we have handled them already. */ format_ptr = GET_RTX_FORMAT (GET_CODE (in_rtx)) + i;//.........这里部分代码省略.........
开发者ID:hnaik,项目名称:gcc,代码行数:101,
示例26: copy_rtxrtxcopy_rtx (rtx orig){ rtx copy; int i, j; RTX_CODE code; const char *format_ptr; code = GET_CODE (orig); switch (code) { case REG: case DEBUG_EXPR: case VALUE: CASE_CONST_ANY: case SYMBOL_REF: case CODE_LABEL: case PC: case CC0: case RETURN: case SIMPLE_RETURN: case SCRATCH: /* SCRATCH must be shared because they represent distinct values. */ return orig; case CLOBBER: /* Share clobbers of hard registers (like cc0), but do not share pseudo reg clobbers or clobbers of hard registers that originated as pseudos. This is needed to allow safe register renaming. */ if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER && ORIGINAL_REGNO (XEXP (orig, 0)) == REGNO (XEXP (orig, 0))) return orig; break; case CLOBBER_HIGH: gcc_assert (REG_P (XEXP (orig, 0))); return orig; case CONST: if (shared_const_p (orig)) return orig; break; /* A MEM with a constant address is not sharable. The problem is that the constant address may need to be reloaded. If the mem is shared, then reloading one copy of this mem will cause all copies to appear to have been reloaded. */ default: break; } /* Copy the various flags, fields, and other information. We assume that all fields need copying, and then clear the fields that should not be copied. That is the sensible default behavior, and forces us to explicitly document why we are *not* copying a flag. */ copy = shallow_copy_rtx (orig); format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); for (i = 0; i < GET_RTX_LENGTH (GET_CODE (copy)); i++) switch (*format_ptr++) { case 'e': if (XEXP (orig, i) != NULL) XEXP (copy, i) = copy_rtx (XEXP (orig, i)); break; case 'E': case 'V': if (XVEC (orig, i) != NULL) { XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i)); for (j = 0; j < XVECLEN (copy, i); j++) XVECEXP (copy, i, j) = copy_rtx (XVECEXP (orig, i, j)); } break; case 't': case 'w': case 'i': case 'p': case 's': case 'S': case 'T': case 'u': case 'B': case '0': /* These are left unchanged. */ break; default: gcc_unreachable (); } return copy;}
开发者ID:vinriviere,项目名称:m68k-atari-mint-gcc,代码行数:96,
注:本文中的GET_RTX_LENGTH函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GET_RTX_NAME函数代码示例 C++ GET_REQ_SOCK_ERROR函数代码示例 |