This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Restricted addressing modes in ColdFire FPU for DFmode



>> Is that GO_IF_LEGITMATE_ADDRESS()?
>
>Yes.

Thanks.  From that suggestion I abandoned my previous path, and
started hacking up a version for coldfire, and I have almost
everything working(or at least load/store, add/sub/mul/div) except for
addresses such as:  

   (mem/s:DF (plus:SI (reg:SI 36) (reg:SI 40)) 0)

I modified GO_IF_LEGITIMATE_ADDRESS to be:

#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
{ if (check_v4e_fpu_address(MODE, X)) { \
    GO_IF_NONINDEXED_ADDRESS (X, ADDR);					\
    GO_IF_INDEXED_ADDRESS (X, ADDR);					\
    if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS	\
        && LEGITIMATE_INDEX_P (XEXP (X, 0))				\
        && GET_CODE (XEXP (X, 1)) == LABEL_REF)				\
      goto ADDR; \
  } \
}

int check_v4e_legitimate_address(MODE, X)
     enum machine_mode MODE;
     rtx X;
{
  /* If v4e and float, only accept addressing modes 2, 3, 4, and 5 */
  if (TARGET_FPU_V4E && GET_MODE_CLASS (MODE) == MODE_FLOAT) {
    /* mode 2 */
    if (LEGITIMATE_BASE_REG_P(X))
      return TRUE;
    /* mode 3&4 */
    if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC)
        && LEGITIMATE_BASE_REG_P (XEXP (X, 0)))
      return TRUE;
    /* mode 5 */
    if (GET_CODE (X) == PLUS
        && LEGITIMATE_BASE_REG_P (XEXP (X, 0))
        && GET_CODE (XEXP (X, 1)) == CONST_INT
        && (((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000))
      return TRUE;
    
    return FALSE;
  }
  return TRUE;
}


I'd have thourhg that check_v4e_legitimate_address() would have
rejected double indexed addressing (addressing mode 6), but I
confident I can figure out what's gone wrong...

Again, thanks for the suggestion.

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]