diff mbox

rs6000: Put back the 's' output modifier

Message ID f8e5a252737d90d2135b0d89b10800e5c251b9cc.1453775847.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Jan. 26, 2016, 2:39 a.m. UTC
It turns out the 's' output modifier is used in some glibc math code,
and is in an installed header even.  So let's put it back, it is much
less of a burden supporting it a bit longer than to deal with the fallout.
(It is also being fixed for glibc.)

Tested on powerpc64-linux-gcc; is this okay for mainline?


Segher


2016-01-26  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (print_operand): Rollback 's' removal.

---
 gcc/config/rs6000/rs6000.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

David Edelsohn Jan. 26, 2016, 1:41 p.m. UTC | #1
On Mon, Jan 25, 2016 at 9:39 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> It turns out the 's' output modifier is used in some glibc math code,
> and is in an installed header even.  So let's put it back, it is much
> less of a burden supporting it a bit longer than to deal with the fallout.
> (It is also being fixed for glibc.)
>
> Tested on powerpc64-linux-gcc; is this okay for mainline?

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ba4aeab..2a3a441 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -19949,6 +19949,14 @@  print_operand (FILE *file, rtx x, int code)
 	fprintf (file, "%d", 128 >> (REGNO (x) - CR0_REGNO));
       return;
 
+    case 's':
+      /* Low 5 bits of 32 - value */
+      if (! INT_P (x))
+	output_operand_lossage ("invalid %%s value");
+      else
+	fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 31);
+      return;
+
     case 't':
       /* Like 'J' but get to the OVERFLOW/UNORDERED bit.  */
       gcc_assert (REG_P (x) && GET_MODE (x) == CCmode);