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]

-mfmovd enabled by default for SH2A but not for SH4


Hi,

SH2A, SH4 and SH4A FPU targets support mode switching i.e. switching 
between single precision and double precision. Double-precision FPU
is also available for the above mentioned targets. 

The option "-mfmovd" is enabled by default for SH2A which generates
"fmov.d" instruction by default. However, SH4 and SH4A targets
generates "fmov.d" instruction only after passing the option "-mfmovd". 

Can somebody clarify the reason behind above implementation?

The instruction "fmov.d" may generate "address error" exception in 
some cases as the address involved in "fmov.d" instruction is not 
always 8 byte aligned. This problem can be easily resolved by passing
option "-mdalign"(aligns double on 8 byte boundary). 

The option "-mfmovd" is enabled by default for SH2A but option 
"-mdalign" is not enabled by default. In case of SH4, SH4A neither of
the options are enabled by default. 

Can we enable option "-mdalign" by default for SH2A target?

The following testcase results in address error at "fmov.d" instruction.
========================================================================
void a (void);

void a()
{
  double b;
  b = b + 526;
}

int main(void)
{
  a();
  return 0;
} 
========================================================================

Regards,
Naveen.H.S.
KPIT Cummins Infosystems Ltd,
Pune (INDIA) 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
Free download of GNU based tool-chains for Renesas' SH, H8, R8C, M16C	
and M32C Series. The following site also offers free technical support	
to its users. Visit http://www.kpitgnutools.com for details. 	
Latest versions of KPIT GNU tools were released on February 4, 2008.	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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