* i386: gcc & asm(): wrong constraint for "mull"
@ 2000-12-29 9:54 Ulrich Windl
2000-12-29 10:17 ` Jakub Jelinek
2000-12-29 10:30 ` Ulrich Windl
0 siblings, 2 replies; 3+ messages in thread
From: Ulrich Windl @ 2000-12-29 9:54 UTC (permalink / raw)
To: linux-kernel
Hello,
I noticed (with some inspiration from Andy Kleen) that some asm()
instructions for the ia32 use the "g" constraint for "mull", where my
Intel 386 Assembly Language Manual suggests the "MUL" instruction needs
an r/m operand. So I guess the correct constraint is "rm" in gcc, and
not "g". That change identical assembly output for gcc-2.95.2, but some
gcc-2.96.x will try a multiplication with an immediate (constant)
operand for the "g" constarint, and the as will choke on that.
(Redhat 7.0 ships such a version of gcc).
As I won't be online next week, let me say
regards and a good new year to all!
Ulrich
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: i386: gcc & asm(): wrong constraint for "mull"
2000-12-29 9:54 i386: gcc & asm(): wrong constraint for "mull" Ulrich Windl
@ 2000-12-29 10:17 ` Jakub Jelinek
2000-12-29 10:30 ` Ulrich Windl
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2000-12-29 10:17 UTC (permalink / raw)
To: Ulrich Windl; +Cc: linux-kernel
On Fri, Dec 29, 2000 at 10:54:38AM +0100, Ulrich Windl wrote:
> Hello,
>
> I noticed (with some inspiration from Andy Kleen) that some asm()
> instructions for the ia32 use the "g" constraint for "mull", where my
> Intel 386 Assembly Language Manual suggests the "MUL" instruction needs
> an r/m operand. So I guess the correct constraint is "rm" in gcc, and
> not "g". That change identical assembly output for gcc-2.95.2, but some
> gcc-2.96.x will try a multiplication with an immediate (constant)
> operand for the "g" constarint, and the as will choke on that.
> (Redhat 7.0 ships such a version of gcc).
gcc 2.95.2 md.texi sais:
@cindex @samp{g} in constraint
@item @samp{g}
Any register, memory or immediate integer operand is allowed, except for
registers that are not general registers.
(2.95.2 was chosen to make it clear it is not something new in gcc).
That means gcc is really free to choose which of register, memory or
immediate it puts in and the fact that some gcc version choose one and
others choose other is perfectly correct.
Fix the constraints and be happy (at least during the upcoming millenium) :)
Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: i386: gcc & asm(): wrong constraint for "mull"
2000-12-29 9:54 i386: gcc & asm(): wrong constraint for "mull" Ulrich Windl
2000-12-29 10:17 ` Jakub Jelinek
@ 2000-12-29 10:30 ` Ulrich Windl
1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Windl @ 2000-12-29 10:30 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: linux-kernel
On 29 Dec 2000, at 5:17, Jakub Jelinek wrote:
> On Fri, Dec 29, 2000 at 10:54:38AM +0100, Ulrich Windl wrote:
> > Hello,
> >
> > I noticed (with some inspiration from Andy Kleen) that some asm()
> > instructions for the ia32 use the "g" constraint for "mull", where my
> > Intel 386 Assembly Language Manual suggests the "MUL" instruction needs
> > an r/m operand. So I guess the correct constraint is "rm" in gcc, and
> > not "g". That change identical assembly output for gcc-2.95.2, but some
> > gcc-2.96.x will try a multiplication with an immediate (constant)
> > operand for the "g" constarint, and the as will choke on that.
> > (Redhat 7.0 ships such a version of gcc).
>
> gcc 2.95.2 md.texi sais:
> @cindex @samp{g} in constraint
> @item @samp{g}
> Any register, memory or immediate integer operand is allowed, except for
> registers that are not general registers.
>
> (2.95.2 was chosen to make it clear it is not something new in gcc).
> That means gcc is really free to choose which of register, memory or
> immediate it puts in and the fact that some gcc version choose one and
> others choose other is perfectly correct.
> Fix the constraints and be happy (at least during the upcoming millenium) :)
Oh, if it wasn't clear: It's what I wanted to say. As I don't have a
patch ready for that, maybe start at arch/i386/kernel/time.c; there are
at least two of these "mull" instructions.
Ulrich
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-12-29 11:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-29 9:54 i386: gcc & asm(): wrong constraint for "mull" Ulrich Windl
2000-12-29 10:17 ` Jakub Jelinek
2000-12-29 10:30 ` Ulrich Windl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox