* GAS 4kc question...
@ 2002-07-30 22:28 Zajerko-McKee, Nick
2002-07-30 23:08 ` Thiemo Seufer
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Zajerko-McKee, Nick @ 2002-07-30 22:28 UTC (permalink / raw)
To: Linux-Mips (E-mail)
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
Hi,
I'm trying to write some inline assembler code that needs the madd and mulu
op codes found on the 4KC processor. I've tried setting the cpu to 4650,
but it failed to recognize the mulu instruction. Can someone give me the
magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
guess one way I can attack it for now is to build the op code by hand, but
that is quite dirty, IMHO...
[-- Attachment #2: Nick Zajerko-McKee.vcf --]
[-- Type: application/octet-stream, Size: 164 bytes --]
BEGIN:VCARD
VERSION:2.1
N:Zajerko-McKee;Nick
FN:Nick Zajerko-McKee
TEL;WORK;VOICE:301 515 6586
EMAIL;PREF;INTERNET:nmckee@telogy.com
REV:20000810T163037Z
END:VCARD
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAS 4kc question...
2002-07-30 22:28 GAS 4kc question Zajerko-McKee, Nick
@ 2002-07-30 23:08 ` Thiemo Seufer
2002-07-31 0:31 ` Ralf Baechle
2002-07-31 6:03 ` Carsten Langgaard
2 siblings, 0 replies; 6+ messages in thread
From: Thiemo Seufer @ 2002-07-30 23:08 UTC (permalink / raw)
To: Zajerko-McKee, Nick; +Cc: Linux-Mips (E-mail)
Zajerko-McKee, Nick wrote:
> Hi,
>
> I'm trying to write some inline assembler code that needs the madd and mulu
> op codes found on the 4KC processor. I've tried setting the cpu to 4650,
> but it failed to recognize the mulu instruction. Can someone give me the
> magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
> guess one way I can attack it for now is to build the op code by hand, but
> that is quite dirty, IMHO...
At least the assembler in current binutils does not know about "mulu" at all.
I don't know if Montavista has added such a feature to their derivative.
Thiemo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAS 4kc question...
2002-07-30 22:28 GAS 4kc question Zajerko-McKee, Nick
2002-07-30 23:08 ` Thiemo Seufer
@ 2002-07-31 0:31 ` Ralf Baechle
2002-07-31 6:03 ` Carsten Langgaard
2 siblings, 0 replies; 6+ messages in thread
From: Ralf Baechle @ 2002-07-31 0:31 UTC (permalink / raw)
To: Zajerko-McKee, Nick; +Cc: Linux-Mips (E-mail)
On Tue, Jul 30, 2002 at 06:28:32PM -0400, Zajerko-McKee, Nick wrote:
> I'm trying to write some inline assembler code that needs the madd and mulu
> op codes found on the 4KC processor. I've tried setting the cpu to 4650,
> but it failed to recognize the mulu instruction. Can someone give me the
> magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
> guess one way I can attack it for now is to build the op code by hand, but
> that is quite dirty, IMHO...
That's an inconsistence in the MIPS instruction set. The old two operand
multiply instruction exists as both signed and unsigned (mult / multu)
but the new-style signed multiply only in an unsigned flavour. In other
words, there is no mulu instruction.
I guess the reason was that this instruction is mainly used for DSP-style
stuff which need signed arithmetics while burning valuable space in the
instruction set for a mulu instruction wasn't considered worth the
instruction space.
Ralf
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAS 4kc question...
2002-07-30 22:28 GAS 4kc question Zajerko-McKee, Nick
2002-07-30 23:08 ` Thiemo Seufer
2002-07-31 0:31 ` Ralf Baechle
@ 2002-07-31 6:03 ` Carsten Langgaard
2002-07-31 7:04 ` Kevin D. Kissell
2 siblings, 1 reply; 6+ messages in thread
From: Carsten Langgaard @ 2002-07-31 6:03 UTC (permalink / raw)
To: Zajerko-McKee, Nick; +Cc: Linux-Mips (E-mail)
I guess you mean madd and mul (not mulu).
These instructions are MIPS32 instructions and are most likely not recognized
by your toolchain.
Try use the compiler option "-mips32" to verify it.
So for now I'm afraid you need to hardcode these by hand. We are very close to
release a MIPS32 compiler, so we don't need these hacks in the future.
/Carsten
"Zajerko-McKee, Nick" wrote:
> Hi,
>
> I'm trying to write some inline assembler code that needs the madd and mulu
> op codes found on the 4KC processor. I've tried setting the cpu to 4650,
> but it failed to recognize the mulu instruction. Can someone give me the
> magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
> guess one way I can attack it for now is to build the op code by hand, but
> that is quite dirty, IMHO...
>
> ------------------------------------------------------------------------
>
> Nick Zajerko-McKee.vcfName: Nick Zajerko-McKee.vcf
> Type: VCard (text/x-vcard)
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAS 4kc question...
2002-07-31 6:03 ` Carsten Langgaard
@ 2002-07-31 7:04 ` Kevin D. Kissell
2002-07-31 7:04 ` Kevin D. Kissell
0 siblings, 1 reply; 6+ messages in thread
From: Kevin D. Kissell @ 2002-07-31 7:04 UTC (permalink / raw)
To: Carsten Langgaard, Zajerko-McKee, Nick; +Cc: Linux-Mips (E-mail)
To try to reconcile some seemingly contradictory responses,
the multiply-accumulate and the 3-operand, or "targeted" multiply
instruction were first supported by the IDT R4650 as a superset
of the MIPS III ISA. As they proved useful and popular, they
were later integrated into the MIPS32 ISA spec. Prior to MIPS32
standardizing things, there were several variations on the multiply-accumulate
instruction mnemonics (madd, mac, etc.) and even some variants
on the encoding. MIPS32 adopted "madd" as the standard
mnemonic, and uses the same encoding as the R4650. I'm
not sure what you mean by "mulu". The origininal MIPS mnemonic
for a 2-operand multiply is "mult", and it has an unsigned counterpart
"multu". The 3-operand multiply was standardized with the mnemonic
"mul". If an "unsigned" version of that instruction existed, it would be
"mulu", but no such version exists, and it's not clear to me that it would
make any sense, given that the definition of the targeted multiply is that
the specified target GPR gets the *least significant* 32 bits of the product.
As Carsten indicates, "madd" and "mul" are enabled by -mips32
in newer assemblers, but it is also true that -m4650 will cause them
to be assembled correctly in older assemblers. I have run madd code
generated with the 4650 option successfully on a MIPS 4Kc.
Regards,
Kevin K.
----- Original Message -----
From: "Carsten Langgaard" <carstenl@mips.com>
To: "Zajerko-McKee, Nick" <nmckee@telogy.com>
Cc: "Linux-Mips (E-mail)" <linux-mips@oss.sgi.com>
Sent: Wednesday, July 31, 2002 8:03 AM
Subject: Re: GAS 4kc question...
> I guess you mean madd and mul (not mulu).
> These instructions are MIPS32 instructions and are most likely not recognized
> by your toolchain.
> Try use the compiler option "-mips32" to verify it.
> So for now I'm afraid you need to hardcode these by hand. We are very close to
> release a MIPS32 compiler, so we don't need these hacks in the future.
>
> /Carsten
>
> "Zajerko-McKee, Nick" wrote:
>
> > Hi,
> >
> > I'm trying to write some inline assembler code that needs the madd and mulu
> > op codes found on the 4KC processor. I've tried setting the cpu to 4650,
> > but it failed to recognize the mulu instruction. Can someone give me the
> > magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
> > guess one way I can attack it for now is to build the op code by hand, but
> > that is quite dirty, IMHO...
> >
> > ------------------------------------------------------------------------
> >
> > Nick Zajerko-McKee.vcfName: Nick Zajerko-McKee.vcf
> > Type: VCard (text/x-vcard)
>
> --
> _ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
> |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
> | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
> TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
> Denmark http://www.mips.com
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAS 4kc question...
2002-07-31 7:04 ` Kevin D. Kissell
@ 2002-07-31 7:04 ` Kevin D. Kissell
0 siblings, 0 replies; 6+ messages in thread
From: Kevin D. Kissell @ 2002-07-31 7:04 UTC (permalink / raw)
To: Carsten Langgaard, Zajerko-McKee, Nick; +Cc: Linux-Mips (E-mail)
To try to reconcile some seemingly contradictory responses,
the multiply-accumulate and the 3-operand, or "targeted" multiply
instruction were first supported by the IDT R4650 as a superset
of the MIPS III ISA. As they proved useful and popular, they
were later integrated into the MIPS32 ISA spec. Prior to MIPS32
standardizing things, there were several variations on the multiply-accumulate
instruction mnemonics (madd, mac, etc.) and even some variants
on the encoding. MIPS32 adopted "madd" as the standard
mnemonic, and uses the same encoding as the R4650. I'm
not sure what you mean by "mulu". The origininal MIPS mnemonic
for a 2-operand multiply is "mult", and it has an unsigned counterpart
"multu". The 3-operand multiply was standardized with the mnemonic
"mul". If an "unsigned" version of that instruction existed, it would be
"mulu", but no such version exists, and it's not clear to me that it would
make any sense, given that the definition of the targeted multiply is that
the specified target GPR gets the *least significant* 32 bits of the product.
As Carsten indicates, "madd" and "mul" are enabled by -mips32
in newer assemblers, but it is also true that -m4650 will cause them
to be assembled correctly in older assemblers. I have run madd code
generated with the 4650 option successfully on a MIPS 4Kc.
Regards,
Kevin K.
----- Original Message -----
From: "Carsten Langgaard" <carstenl@mips.com>
To: "Zajerko-McKee, Nick" <nmckee@telogy.com>
Cc: "Linux-Mips (E-mail)" <linux-mips@oss.sgi.com>
Sent: Wednesday, July 31, 2002 8:03 AM
Subject: Re: GAS 4kc question...
> I guess you mean madd and mul (not mulu).
> These instructions are MIPS32 instructions and are most likely not recognized
> by your toolchain.
> Try use the compiler option "-mips32" to verify it.
> So for now I'm afraid you need to hardcode these by hand. We are very close to
> release a MIPS32 compiler, so we don't need these hacks in the future.
>
> /Carsten
>
> "Zajerko-McKee, Nick" wrote:
>
> > Hi,
> >
> > I'm trying to write some inline assembler code that needs the madd and mulu
> > op codes found on the 4KC processor. I've tried setting the cpu to 4650,
> > but it failed to recognize the mulu instruction. Can someone give me the
> > magic incantation? I'm running right now GCC 2.95.3 from Montavista. I
> > guess one way I can attack it for now is to build the op code by hand, but
> > that is quite dirty, IMHO...
> >
> > ------------------------------------------------------------------------
> >
> > Nick Zajerko-McKee.vcfName: Nick Zajerko-McKee.vcf
> > Type: VCard (text/x-vcard)
>
> --
> _ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
> |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
> | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
> TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
> Denmark http://www.mips.com
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-07-31 7:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-30 22:28 GAS 4kc question Zajerko-McKee, Nick
2002-07-30 23:08 ` Thiemo Seufer
2002-07-31 0:31 ` Ralf Baechle
2002-07-31 6:03 ` Carsten Langgaard
2002-07-31 7:04 ` Kevin D. Kissell
2002-07-31 7:04 ` Kevin D. Kissell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox