Gcc bug or I missunderstand? [ftsd %fr22, 56(%sr0, %r20) failed to build?]
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 [email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Quoted 10 lines
it failed to build because:
gcc -save-temps -o tmset5
tmset5.ctmset5.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
[...]
Quoted 2 lines
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
Signature · 7 lines
Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/ _______________________________________________ parisc-linux mailing list [email protected] http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Quoted 5 lines · Randolph Chung
Quoted 2 lines
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?
Signature · 10 lines
"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 [email protected] http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Quoted 4 lines · Matthew Wilcox
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
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Quoted 4 lines · Matthew Wilcox
Quoted 1 line
Quick look at page 9-24 of the Kane book indicates that for d between=
+15
Quoted 1 line
Quoted 1 line
and -16 we use format 42 and for d outside that range, we use format
3.
Quoted 1 line
Quoted 1 line
Looks like nobody bothered to teach binutils about this longer form
yet.
Quoted 1 line
Quoted 1 line
Is it possible it's only available for PA2.0 processors?
(mmm I just forget to memtioned that I used -march=3D2.0)
Quoted 9 lines
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
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22,
In reply to Matthew WilcoxQuoted 3 lines
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.
Quoted 1 line
Is it possible it's only available for PA2.0 processors?
This is only available in PA 2.0.
Dave
Signature · 6 lines
J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) _______________________________________________ parisc-linux mailing list [email protected] http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
Re: [parisc-linux] Re: Gcc bug or I missunderstand? [ftsd %fr22,
In reply to Joel SoeteQuoted 2 lines
Quoted 1 line
Quoted 1 line
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
Signature · 6 lines
J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) _______________________________________________ parisc-linux mailing list [email protected] http://lists.parisc-linux.org/mailman/listinfo/parisc-linux