Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
@ 2004-12-15 16:27 Joel Soete
  2004-12-15 16:39 ` [parisc-linux] " Randolph Chung
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Soete @ 2004-12-15 16:27 UTC (permalink / raw)
  To: parisc-linux; +Cc: dave

Hello all,

In the memcpy.c stand this comment:
 * TODO:
[...]
 * - try not to use the post-increment address modifiers; they create add=
itional
 *   interlocks
[...]

I right a test case which is precompile as:
        { register double r1;
                __asm__ __volatile__ ( "\t" "fldd" " 0(" "%%sr0" ",%1),
%0\n" : "=3Df"(r1) : "r"(pds) : "r8");
        while (len >=3D 8*sizeof(double)) {




                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "0" "(" "%%s=
r0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "8" "(" "%%s=
r0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "16" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "24" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");

                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "32" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "40" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "48" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                __asm__ __volatile__ ( "1:\t" "fstd" " %1, " "56" "(" "%%=
sr0"
",%0)\n" : "+r"(pdd) : "f"(r1) : "r8");
                pdd -=3D 8;
                len -=3D 8*sizeof(double);
        }
        };

it failed to build because:

gcc -save-temps -o tmset5 tmset5.c
tmset5.s: Assembler messages:
tmset5.s:122: Error: Invalid operands 
tmset5.s:130: Error: Invalid operands 
tmset5.s:138: Error: Invalid operands 
tmset5.s:146: Error: Invalid operands 
tmset5.s:154: Error: Invalid operands 
tmset5.s:162: Error: Invalid operands 

this tmset5.s looks like:
[...]
    101 .L11:
    102         ldw 56(%r3),%r20
    103         ldo 64(%r3),%r19
    104         fldds 0(%r19),%fr22
    105 #APP
    106         1:      fstd %fr22, 0(%sr0,%r20)
    107
    108 #NO_APP
    109         stw %r20,56(%r3)
    110         ldw 56(%r3),%r20
    111         ldo 64(%r3),%r19
    112         fldds 0(%r19),%fr22
    113 #APP
    114         1:      fstd %fr22, 8(%sr0,%r20)
    115
    116 #NO_APP
    117         stw %r20,56(%r3)
    118         ldw 56(%r3),%r20
    119         ldo 64(%r3),%r19
    120         fldds 0(%r19),%fr22
    121 #APP
    122         1:      fstd %fr22, 16(%sr0,%r20)
    123
    124 #NO_APP
    125         stw %r20,56(%r3)
    126         ldw 56(%r3),%r20
    127         ldo 64(%r3),%r19
    128         fldds 0(%r19),%fr22
    129 #APP
    130         1:      fstd %fr22, 24(%sr0,%r20)
    131
    132 #NO_APP
    133         stw %r20,56(%r3)
    134         ldw 56(%r3),%r20
    135         ldo 64(%r3),%r19
    136         fldds 0(%r19),%fr22
    137 #APP
    138         1:      fstd %fr22, 32(%sr0,%r20)
    139 
    140 #NO_APP
    141         stw %r20,56(%r3)
    142         ldw 56(%r3),%r20
    143         ldo 64(%r3),%r19
    144         fldds 0(%r19),%fr22
    145 #APP
    146         1:      fstd %fr22, 40(%sr0,%r20)
    147
    148 #NO_APP
    149         stw %r20,56(%r3)
    150         ldw 56(%r3),%r20
    151         ldo 64(%r3),%r19
    152         fldds 0(%r19),%fr22
    153 #APP
    154         1:      fstd %fr22, 48(%sr0,%r20)
    155 
    156 #NO_APP
    157         stw %r20,56(%r3)
    158         ldw 56(%r3),%r20
    159         ldo 64(%r3),%r19
    160         fldds 0(%r19),%fr22
    161 #APP
    162         1:      fstd %fr22, 56(%sr0,%r20)
    163
    164 #NO_APP
    165         stw %r20,56(%r3)
    166         ldw 56(%r3),%r19
    167         ldo -64(%r19),%r19
    168         stw %r19,56(%r3)
    169         ldw -44(%r3),%r19
    170         ldo -64(%r19),%r19
    171         stw %r19,-44(%r3)
    172         b,n .L9
[...]

in lines: 
    106         1:      fstd %fr22, 0(%sr0,%r20)
[...]
    114         1:      fstd %fr22, 8(%sr0,%r20)
[...]

no pb but for following ones:

[...]
    122         1:      fstd %fr22, 16(%sr0,%r20)
[...]
    130         1:      fstd %fr22, 24(%sr0,%r20)
[...]
    138         1:      fstd %fr22, 32(%sr0,%r20)
[...]
    146         1:      fstd %fr22, 40(%sr0,%r20)
[...]
    154         1:      fstd %fr22, 48(%sr0,%r20)
[...]
    162         1:      fstd %fr22, 56(%sr0,%r20)
[...]

it seems that if d>8 there is a pb?
Did I miss something?

Thanks in advance for help,
    Joel

-------------------------------------------------------------------------=
--
Tiscali vous offre 3 mois d'ADSL et 3 mois de DVD gratuits...profitez-en.=
..
http://reg.tiscali.be/adsl/default.asp?lg=3DFR




_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
  2004-12-15 16:27 [parisc-linux] Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?] Joel Soete
@ 2004-12-15 16:39 ` Randolph Chung
  2004-12-15 17:18   ` Matthew Wilcox
  0 siblings, 1 reply; 7+ messages in thread
From: Randolph Chung @ 2004-12-15 16:39 UTC (permalink / raw)
  To: Joel Soete; +Cc: dave, parisc-linux

> it failed to build because:
> 
> gcc -save-temps -o tmset5 tmset5.c
> tmset5.s: Assembler messages:
> tmset5.s:122: Error: Invalid operands
> tmset5.s:130: Error: Invalid operands
> tmset5.s:138: Error: Invalid operands
> tmset5.s:146: Error: Invalid operands
> tmset5.s:154: Error: Invalid operands
> tmset5.s:162: Error: Invalid operands
[...]
> it seems that if d>8 there is a pb?
> Did I miss something?

No, this is a known bug with binutils; nobody has bothered to look
into/fix it yet :(

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
  2004-12-15 16:39 ` [parisc-linux] " Randolph Chung
@ 2004-12-15 17:18   ` Matthew Wilcox
  2004-12-15 18:04     ` Grant Grundler
  2004-12-15 19:01     ` John David Anglin
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Wilcox @ 2004-12-15 17:18 UTC (permalink / raw)
  To: Randolph Chung; +Cc: dave, parisc-linux

On Wed, Dec 15, 2004 at 08:39:07AM -0800, Randolph Chung wrote:
> > it seems that if d>8 there is a pb?
> > Did I miss something?
> 
> No, this is a known bug with binutils; nobody has bothered to look
> into/fix it yet :(

Quick look at page 9-24 of the Kane book indicates that for d between +15
and -16 we use format 42 and for d outside that range, we use format 3.
Looks like nobody bothered to teach binutils about this longer form yet.
Is it possible it's only available for PA2.0 processors?

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
  2004-12-15 17:18   ` Matthew Wilcox
@ 2004-12-15 18:04     ` Grant Grundler
  2004-12-15 18:25       ` Joel Soete
  2004-12-15 19:01     ` John David Anglin
  1 sibling, 1 reply; 7+ messages in thread
From: Grant Grundler @ 2004-12-15 18:04 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: dave, parisc-linux

On Wed, Dec 15, 2004 at 05:18:13PM +0000, Matthew Wilcox wrote:
> Quick look at page 9-24 of the Kane book indicates that for d between +15
> and -16 we use format 42 and for d outside that range, we use format 3.
> Looks like nobody bothered to teach binutils about this longer form yet.
> Is it possible it's only available for PA2.0 processors?

Yes - that seems to be the case.
FSTD is PA2.0 Mnemonic. Page J-4 of the same book.

The two corresponding PA 1.1 ops are FSTDS and FSTDX.
FSTDS is the short form (5 bits immediate).
We could use FSTDX but it will require another register in the asm.

grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
  2004-12-15 18:04     ` Grant Grundler
@ 2004-12-15 18:25       ` Joel Soete
  2004-12-15 19:12         ` [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, John David Anglin
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Soete @ 2004-12-15 18:25 UTC (permalink / raw)
  To: Grant Grundler, Matthew Wilcox; +Cc: dave, parisc-linux


> 
> On Wed, Dec 15, 2004 at 05:18:13PM +0000, Matthew Wilcox wrote:
> > Quick look at page 9-24 of the Kane book indicates that for d between=

+15
> > and -16 we use format 42 and for d outside that range, we use format
3.
> > Looks like nobody bothered to teach binutils about this longer form
yet.
> > Is it possible it's only available for PA2.0 processors?
(mmm I just forget to memtioned that I used -march=3D2.0)
> 
> Yes - that seems to be the case.
> FSTD is PA2.0 Mnemonic. Page J-4 of the same book.
> 
> The two corresponding PA 1.1 ops are FSTDS and FSTDX.
> FSTDS is the short form (5 bits immediate).
> We could use FSTDX but it will require another register in the asm.
> 
> grant

Well ok I want that works for the two arch I had better to incr %0 ?
I will check perf.

Thanks for all advises,
    Joel

-------------------------------------------------------------------------=
--
Tiscali vous offre 3 mois d'ADSL et 3 mois de DVD gratuits...profitez-en.=
..
http://reg.tiscali.be/adsl/default.asp?lg=3DFR




_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22,
  2004-12-15 17:18   ` Matthew Wilcox
  2004-12-15 18:04     ` Grant Grundler
@ 2004-12-15 19:01     ` John David Anglin
  1 sibling, 0 replies; 7+ messages in thread
From: John David Anglin @ 2004-12-15 19:01 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: parisc-linux

> Quick look at page 9-24 of the Kane book indicates that for d between +15
> and -16 we use format 42 and for d outside that range, we use format 3.
> Looks like nobody bothered to teach binutils about this longer form yet.

Yes, I hit this a couple of years ago in GCC.  Binutils needs to be
taught some new relocations to support the long fp displacements.

> Is it possible it's only available for PA2.0 processors?

This is only available in PA 2.0.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22,
  2004-12-15 18:25       ` Joel Soete
@ 2004-12-15 19:12         ` John David Anglin
  0 siblings, 0 replies; 7+ messages in thread
From: John David Anglin @ 2004-12-15 19:12 UTC (permalink / raw)
  To: Joel Soete; +Cc: parisc-linux, matthew

> > > Is it possible it's only available for PA2.0 processors?
> (mmm I just forget to memtioned that I used -march=2.0)

-march=2.0 only affects the code generated by GCC.  How, would
it change an asm?

You must remember that GAS isn't really a general purpose assembler.
It's handles what GCC generates.  When you step outside those bounds
it may break.  Of course, a patch to add the missing relocations would
be welcome but no one has found time to do it yet.  This also involves
fixing the linker.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-15 19:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-15 16:27 [parisc-linux] Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?] Joel Soete
2004-12-15 16:39 ` [parisc-linux] " Randolph Chung
2004-12-15 17:18   ` Matthew Wilcox
2004-12-15 18:04     ` Grant Grundler
2004-12-15 18:25       ` Joel Soete
2004-12-15 19:12         ` [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22, John David Anglin
2004-12-15 19:01     ` John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox