FreeBSD/contrib/binutils/gas/config/tc-mips.c
/* Generate a sequence of instructions to do a load or store from a constant
   offset off of a base register (breg) into/from a target register (treg),
   using AT if necessary.  */
Generate a sequence of instructions to do a load or store from a constant
offset off of a base register (breg) into/from a target register (treg),
using AT if necessary.
Generate a sequence of instructions to do a load or store from a constant offset off of a base register ( breg ) into / from a target register ( treg ) using AT if necessary .
static void
macro_build_ldst_constoffset (expressionS *ep, const char *op,
			      int treg, int breg, int dbl)
{
  assert (ep->X_op == O_constant);
  if (!dbl)
    normalize_constant_expr (ep);
  if (! IS_SEXT_32BIT_NUM(ep->X_add_number + 0x8000))
    as_warn (_("operand overflow"));
  if (IS_SEXT_16BIT_NUM(ep->X_add_number))
    {
      macro_build (ep, op, "t,o(b)", treg, BFD_RELOC_LO16, breg);
    }
  else
    {
      macro_build_lui (ep, AT);
      macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
      macro_build (ep, op, "t,o(b)", treg, BFD_RELOC_LO16, AT);
      if (mips_opts.noat)
	as_bad (_("Macro used $at after \".set noat\""));
    }
}
static void macro_build_ldst_constoffset ( expressionS * ep , const char * op , int treg , int breg , int dbl ) { assert ( ep -> X_op == O_constant ) ; if ( ! dbl ) normalize_constant_expr ( ep ) ; if ( ! IS_SEXT_32BIT_NUM ( ep -> X_add_number + 0x8000 ) ) as_warn ( _ ( " " ) ) ; if ( IS_SEXT_16BIT_NUM ( ep -> X_add_number ) ) { macro_build ( ep , op , " " , treg , BFD_RELOC_LO16 , breg ) ; } else { macro_build_lui ( ep , AT ) ; macro_build ( NULL , ADDRESS_ADD_INSN , " " , AT , AT , breg ) ; macro_build ( ep , op , " " , treg , BFD_RELOC_LO16 , AT ) ; if ( mips_opts . noat ) as_bad ( _ ( " \" \" " ) ) ; } }
Generate a sequence of instructions to do a load or store from a constant
offset off of a base register (breg) into/from a target register (treg),
using AT if necessary.
Generate a sequence of instructions to do a load or store from a constant offset off of a base register ( breg ) into / from a target register ( treg ) using AT if necessary .
/* Sign-extending 32-bit constants makes their handling easier.  */ /* Right now, this routine can only handle signed 32-bit constants.  */ /* Signed 16-bit offset will fit in the op.  Easy!  */ /* 32-bit offset, need multiple instructions and AT, like:
	   lui      $tempreg,const_hi       (BFD_RELOC_HI16_S)
	   addu     $tempreg,$tempreg,$breg
           <op>     $treg,const_lo($tempreg)   (BFD_RELOC_LO16)
         to handle the complete offset.  */