[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug gas/818] New: error handling %farg[0-4] registers
From: |
Nick Clifton |
Subject: |
Re: [Bug gas/818] New: error handling %farg[0-4] registers |
Date: |
Mon, 11 Apr 2005 17:17:46 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (X11/20041206) |
Hi Eric, Hi David,
When gas encounters the statement:
fldws -4(%r22),%farg0
it issues the error:
Error: Field out of range [0..31] (-59).
Error: Invalid operands
similarly for %farg1, %farg2, and %farg3, it issues similar warnings with -58,
-57, and -56 as the constant.
HP's native assembler accepts the statement. When I disassemble the output of
the native assembler, it converted that statement to:
fldw -4(,r22),fr4
So it appears %farg0 should be a synonym for %fr4. As a workaround, I've
modified my code to use %fr[4-7] instead of %farg[0-3] and gas is happy with
this.
This bug is present in binutils-2.15 and in the binutils-050404 snapshot I just
tested.
The patch below appears to fix this problem, but I am not an expert on
the HPPA instruction set - David - do you think that the patch is OK ?
Cheers
Nick
gas/ChangeLog
2005-04-11 Nick Clifton <address@hidden>
PR gas/818
* config/tc-hppa.c (pre_defined_registers): Fix %farg[0-3]
synonyms.
Index: gas/config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.115
diff -c -3 -p -r1.115 tc-hppa.c
*** gas/config/tc-hppa.c 3 Mar 2005 11:47:50 -0000 1.115
--- gas/config/tc-hppa.c 11 Apr 2005 16:15:00 -0000
*************** static int print_errors = 1;
*** 811,816 ****
--- 811,817 ----
%r26 - %r23 have %arg0 - %arg3 as synonyms
%r28 - %r29 have %ret0 - %ret1 as synonyms
+ %fr4 - %fr7 have %farg0 - %farg3 as synonyms
%r30 has %sp as a synonym
%r27 has %dp as a synonym
%r2 has %rp as a synonym
*************** static const struct pd_reg pre_defined_r
*** 854,863 ****
{"%dp", 27},
{"%eiem", 15},
{"%eirr", 23},
! {"%farg0", 5},
! {"%farg1", 6},
! {"%farg2", 7},
! {"%farg3", 8},
{"%fr0", 0 + FP_REG_BASE},
{"%fr0l", 0 + FP_REG_BASE},
{"%fr0r", 0 + FP_REG_BASE + FP_REG_RSEL},
--- 855,864 ----
{"%dp", 27},
{"%eiem", 15},
{"%eirr", 23},
! {"%farg0", 4 + FP_REG_BASE},
! {"%farg1", 5 + FP_REG_BASE},
! {"%farg2", 6 + FP_REG_BASE},
! {"%farg3", 7 + FP_REG_BASE},
{"%fr0", 0 + FP_REG_BASE},
{"%fr0l", 0 + FP_REG_BASE},
{"%fr0r", 0 + FP_REG_BASE + FP_REG_RSEL},