aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-09-19 15:41:16 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-09-19 15:41:16 -0400
commitdf3d94ed38439480dca837415ccd2181d982a23c (patch)
tree407a428a7ffea8de9bf1c916f16f133fd4aaee3f /gcc
parentef457bda4a234a0b51446e9d04a7666183ef32db (diff)
downloadgcc-df3d94ed38439480dca837415ccd2181d982a23c.zip
gcc-df3d94ed38439480dca837415ccd2181d982a23c.tar.gz
gcc-df3d94ed38439480dca837415ccd2181d982a23c.tar.bz2
(print_operand, case 'h', 'H', 'w'): Minor cleanups.
From-SVN: r2168
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/rs6000/rs6000.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e1e5301..0864b9e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -710,7 +710,8 @@ print_operand (file, x, code)
switch (code)
{
case 'h':
- /* If constant, output low-order six bits. Otherwise, write normally. */
+ /* If constant, output low-order five bits. Otherwise,
+ write normally. */
if (INT_P (x))
fprintf (file, "%d", INT_LOWPART (x) & 31);
else
@@ -718,7 +719,7 @@ print_operand (file, x, code)
return;
case 'H':
- /* X must be a constant. Output the low order 6 bits plus 24. */
+ /* X must be a constant. Output the low order 5 bits plus 24. */
if (! INT_P (x))
output_operand_lossage ("invalid %%H value");
@@ -737,7 +738,8 @@ print_operand (file, x, code)
/* If constant, low-order 16 bits of constant, signed. Otherwise, write
normally. */
if (INT_P (x))
- fprintf (file, "%d", (INT_LOWPART (x) << 16) >> 16);
+ fprintf (file, "%d",
+ (INT_LOWPART (x) & 0xffff) - 2 * (INT_LOWPART (x) & 0x8000));
else
print_operand (file, x, 0);
return;