NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/52142: mips64 soft-float problems



The following reply was made to PR toolchain/52142; it has been noted by GNATS.

From: coypu%sdf.org@localhost
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: toolchain/52142: mips64 soft-float problems
Date: Fri, 9 Jun 2017 01:50:06 +0000

 This diff fixes things, it's caused because there was no GCC mknative
 (running configure) after a binutils update on mips64el.
 
 Specifically the HAVE_AS_DOT_MODULE 1 will cause it to generate .module
 things instead of .gnu_attribute 4,3 for soft float (and rest is
 inferrred).
 
 See GCC mips.c:
 
  9260 #ifdef HAVE_AS_DOT_MODULE
  9261   /* Record the FP ABI.  See below for comments.  */
  9262   if (TARGET_NO_FLOAT)
  9263 #ifdef HAVE_AS_GNU_ATTRIBUTE
  9264     fputs ("\t.gnu_attribute 4, 0\n", asm_out_file);
  9265 #else
  9266     ;
  9267 #endif
  9268   else if (!TARGET_HARD_FLOAT_ABI)
  9269     fputs ("\t.module\tsoftfloat\n", asm_out_file);
  9270   else if (!TARGET_DOUBLE_FLOAT)
  9271     fputs ("\t.module\tsinglefloat\n", asm_out_file);
  9272   else if (TARGET_FLOATXX)
  9273     fputs ("\t.module\tfp=xx\n", asm_out_file);
  9274   else if (TARGET_FLOAT64)
  9275     fputs ("\t.module\tfp=64\n", asm_out_file);
  9276   else
  9277     fputs ("\t.module\tfp=32\n", asm_out_file);
  9278 
  9279   if (TARGET_ODD_SPREG)
  9280     fputs ("\t.module\toddspreg\n", asm_out_file);
  9281   else
  9282     fputs ("\t.module\tnooddspreg\n", asm_out_file);
  9283 
  9284 #else
  9285 #ifdef HAVE_AS_GNU_ATTRIBUTE
  9286   {
  9287     int attr;
  9288 
  9289     /* No floating-point operations, -mno-float.  */
  9290     if (TARGET_NO_FLOAT)
  9291       attr = 0;
  9292     /* Soft-float code, -msoft-float.  */
  9293     else if (!TARGET_HARD_FLOAT_ABI)
  9294       attr = 3;
 
 ...
 
  9314 
  9315     fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n", attr);
  9316   }
  9317 #endif
  9318 #endif
 
 
 
 Tested diff:
 
 ===================================================================
 RCS file: /cvsroot/src/external/gpl3/gcc/usr.bin/gcc/arch/mips64el/auto-host.h,v
 retrieving revision 1.10
 diff -u -r1.10 auto-host.h
 --- gcc/usr.bin/gcc/arch/mips64el/auto-host.h	7 Jun 2016 18:53:03 -0000	1.10
 +++ gcc/usr.bin/gcc/arch/mips64el/auto-host.h	9 Jun 2017 01:47:05 -0000
 @@ -297,7 +297,7 @@
  
  /* Define if your assembler supports .module. */
  #ifndef USED_FOR_TARGET
 -/* #undef HAVE_AS_DOT_MODULE */
 +#define HAVE_AS_DOT_MODULE 1
  #endif
  
  
 @@ -509,7 +509,7 @@
  
  /* Define if the assembler understands -mnan=. */
  #ifndef USED_FOR_TARGET
 -/* #undef HAVE_AS_NAN */
 +#define HAVE_AS_NAN 1
  #endif
  
  
 


Home | Main Index | Thread Index | Old Index