This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [PATCH] Support PowerPC single-precision float


Joseph S. Myers wrote:
On Sun, 25 May 2008, Michael Eager wrote:

The attached patch adds a check for object file computability
for PowerPC files compiled with -msingle-float.  This is needed
to support a patch submitted to gcc-patches.

binutils/ChangeLog
2008-05-25  Michael Eager <eager@eagercon.com>

	* bfd/elf32-ppc.c (ppc_elf_merge_obj_attributes):
	Check compatibility between single-float, double-float,
	and soft-float.
	* binutils/readelf.c (display_power_gnu_attribute):
	Display single-precision hard float
	include/elf/ppc.h: Add description of single-precision
	* ld/testsuite/ld-powerpc/powerpc.exp: Update or add tests

This is missing documentation updates under "PowerPC Attributes" in gas/doc/as.texinfo.

Added documentation to the patch.


--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
2008-05-25  Michael Eager <eager@eagercon.com>

	* bfd/elf32-ppc.c (ppc_elf_merge_obj_attributes):
	Check compatibility between single-float, double-float,
	and soft-float.
	* binutils/readelf.c (display_power_gnu_attribute):
	Display single-precision hard float
	include/elf/ppc.h: Add description of single-precision
	* ld/testsuite/ld-powerpc/powerpc.exp: Update or add tests
	* gas/doc/as.texinfo: Add description of single-precision
	attribute.
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/bfd/elf32-ppc.c binutils/bfd/elf32-ppc.c
--- binutils-orig/bfd/elf32-ppc.c	2008-06-01 13:46:36.000000000 -0700
+++ binutils/bfd/elf32-ppc.c	2008-06-01 13:47:30.000000000 -0700
@@ -3849,10 +3849,22 @@ ppc_elf_merge_obj_attributes (bfd *ibfd,
       else if (out_attr->i == 1 && in_attr->i == 2)
 	_bfd_error_handler
 	  (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd);
-      else if (out_attr->i == 2 && in_attr->i == 1)
+      else if (out_attr->i == 1 && in_attr->i == 3)
+	_bfd_error_handler
+	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"), 
+	  obfd, ibfd);
+      else if (out_attr->i == 3 && in_attr->i == 1)
+	_bfd_error_handler
+	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"), 
+	  ibfd, obfd);
+      else if (out_attr->i == 3 && in_attr->i == 2)
+	_bfd_error_handler
+	  (_("Warning: %B uses soft float, %B uses single-precision hard float"), 
+	  ibfd, obfd);
+      else if (out_attr->i == 2 && (in_attr->i == 1 || in_attr->i == 3))
 	_bfd_error_handler
 	  (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd);
-      else if (in_attr->i > 2)
+      else if (in_attr->i > 3)
 	_bfd_error_handler
 	  (_("Warning: %B uses unknown floating point ABI %d"), ibfd,
 	   in_attr->i);
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/binutils/readelf.c binutils/binutils/readelf.c
--- binutils-orig/binutils/readelf.c	2008-06-01 13:46:22.000000000 -0700
+++ binutils/binutils/readelf.c	2008-06-01 13:47:30.000000000 -0700
@@ -8930,6 +8930,9 @@ display_power_gnu_attribute (unsigned ch
 	case 2:
 	  printf ("Soft float\n");
 	  break;
+	case 3:
+	  printf ("Single-precision hard float\n");
+	  break;
 	default:
 	  printf ("??? (%d)\n", val);
 	  break;
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/gas/doc/as.texinfo binutils/gas/doc/as.texinfo
--- binutils-orig/gas/doc/as.texinfo	2008-06-01 13:46:24.000000000 -0700
+++ binutils/gas/doc/as.texinfo	2008-06-01 13:50:12.000000000 -0700
@@ -6507,9 +6507,11 @@ The floating-point ABI used by this obje
 @item
 0 for files not affected by the floating-point ABI.
 @item
-1 for files using the hardware floating-point ABI.
+1 for files using double-precision hardware floating-point ABI.
 @item
 2 for files using the software floating-point ABI.
+@item
+3 for files using single-precision hardware floating-point ABI.
 @end itemize
 
 @item Tag_GNU_Power_ABI_Vector (8)
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/include/elf/ppc.h binutils/include/elf/ppc.h
--- binutils-orig/include/elf/ppc.h	2008-06-01 13:46:31.000000000 -0700
+++ binutils/include/elf/ppc.h	2008-06-01 13:47:30.000000000 -0700
@@ -177,7 +177,8 @@ enum
 {
   /* 0-3 are generic.  */
   Tag_GNU_Power_ABI_FP = 4, /* Value 1 for hard-float, 2 for
-			       soft-float; 0 for not tagged or not
+			       soft-float, 3 for single=precision 
+			       hard-float; 0 for not tagged or not
 			       using any ABIs affected by the
 			       differences.  */
 
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-03.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-03.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-03.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-03.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,10 @@
+#source: attr-gnu-4-0.s
+#source: attr-gnu-4-3.s
+#as: -a32
+#ld: -r -melf32ppc
+#readelf: -A
+#target: powerpc*-*-*
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_Power_ABI_FP: Single-precision hard float
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-13.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-13.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-13.d	2008-06-01 13:46:21.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-13.d	2008-06-01 13:47:30.000000000 -0700
@@ -2,5 +2,5 @@
 #source: attr-gnu-4-3.s
 #as: -a32
 #ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 3
+#warning: Warning: .* uses double-precision hard float, .* uses single-precision hard float
 #target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-14.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-14.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-14.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-14.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-1.s
+#source: attr-gnu-4-4.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses unknown floating point ABI 4
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-23.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-23.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-23.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-23.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-2.s
+#source: attr-gnu-4-3.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses hard float, .* uses soft float
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-24.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-24.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-24.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-24.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-2.s
+#source: attr-gnu-4-4.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses unknown floating point ABI 4
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-31.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-31.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-31.d	2008-06-01 13:46:21.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-31.d	2008-06-01 13:47:30.000000000 -0700
@@ -2,5 +2,5 @@
 #source: attr-gnu-4-1.s
 #as: -a32
 #ld: -r -melf32ppc
-#warning: Warning: .* uses unknown floating point ABI 3
+#warning: Warning: .* uses double-precision hard float, .* uses single-precision hard float
 #target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-32.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-32.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-32.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-32.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-3.s
+#source: attr-gnu-4-2.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses soft float, .* uses single-precision hard float
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-33.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-33.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-33.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-33.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,10 @@
+#source: attr-gnu-4-3.s
+#source: attr-gnu-4-3.s
+#as: -a32
+#ld: -r -melf32ppc
+#readelf: -A
+#target: powerpc*-*-*
+
+Attribute Section: gnu
+File Attributes
+  Tag_GNU_Power_ABI_FP: Single-precision hard float
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-34.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-34.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-34.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-34.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-3.s
+#source: attr-gnu-4-4.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses unknown floating point ABI 4
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-41.d binutils/ld/testsuite/ld-powerpc/attr-gnu-4-41.d
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-41.d	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-41.d	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1,6 @@
+#source: attr-gnu-4-4.s
+#source: attr-gnu-4-1.s
+#as: -a32
+#ld: -r -melf32ppc
+#warning: Warning: .* uses unknown floating point ABI 4
+#target: powerpc*-*-*
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-4.s binutils/ld/testsuite/ld-powerpc/attr-gnu-4-4.s
--- binutils-orig/ld/testsuite/ld-powerpc/attr-gnu-4-4.s	1969-12-31 16:00:00.000000000 -0800
+++ binutils/ld/testsuite/ld-powerpc/attr-gnu-4-4.s	2008-06-01 13:47:30.000000000 -0700
@@ -0,0 +1 @@
+.gnu_attribute 4,4
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn binutils-orig/ld/testsuite/ld-powerpc/powerpc.exp binutils/ld/testsuite/ld-powerpc/powerpc.exp
--- binutils-orig/ld/testsuite/ld-powerpc/powerpc.exp	2008-06-01 13:46:21.000000000 -0700
+++ binutils/ld/testsuite/ld-powerpc/powerpc.exp	2008-06-01 13:47:30.000000000 -0700
@@ -157,14 +157,22 @@ run_dump_test "plt1"
 run_dump_test "attr-gnu-4-00"
 run_dump_test "attr-gnu-4-01"
 run_dump_test "attr-gnu-4-02"
+run_dump_test "attr-gnu-4-03"
 run_dump_test "attr-gnu-4-10"
 run_dump_test "attr-gnu-4-11"
 run_dump_test "attr-gnu-4-12"
 run_dump_test "attr-gnu-4-13"
+run_dump_test "attr-gnu-4-14"
 run_dump_test "attr-gnu-4-20"
 run_dump_test "attr-gnu-4-21"
 run_dump_test "attr-gnu-4-22"
+run_dump_test "attr-gnu-4-23"
+run_dump_test "attr-gnu-4-24"
 run_dump_test "attr-gnu-4-31"
+run_dump_test "attr-gnu-4-32"
+run_dump_test "attr-gnu-4-33"
+run_dump_test "attr-gnu-4-34"
+run_dump_test "attr-gnu-4-41"
 
 run_dump_test "attr-gnu-8-11"
 run_dump_test "attr-gnu-8-23"

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