* MIPS/NEC VR4181 issues..
@ 2001-08-23 7:07 Kaj Wiik
0 siblings, 0 replies; only message in thread
From: Kaj Wiik @ 2001-08-23 7:07 UTC (permalink / raw)
To: gcc-help
Hi!
I am developing for a Linux platform with a VR4181 CPU.
The standard distribution seems to be compiled using -mips1 (2?) to be
binary compatible with other MIPS platforms. The problem arises when I
want to use the VR4100-specific instruction 'madd16' (multiply&accumulate
in 1 cycle).
If I use
$CC -Wa,-m4100 -o test test.c
assembly is OK but linking has problems:
/opt/snow-gcc/bin/../lib/gcc-lib/mipsel-linux/2.97/../../../../mipsel-linux/bin/ld:
/tmp/ccAnzuz3.o: ISA mismatch (-mips3) with previous modules (-mips1)
Bad value: failed to merge target specific data of file /tmp/ccAnzuz3.o
collect2: ld returned 1 exit status
---
If I ignore the mismatch:
$CC -Wa,-m4100 -Wl,-no-warn-mismatch -o test test.c
I get
/mnt/algol/asm$ ./test
Illegal Instruction
when I run it in the target.
---
Here is my test.c:
#include <stdio.h>
main(void) {
int in1,in2,out1,outhi,outlo,tmp;
in1 = 1;
in2 = 1;
tmp = 0;
out1 = in1 + in2;
asm(".set mips3");
asm("mthi %0": :"ri" (tmp));
asm("mtlo %0": :"ri" (tmp));
asm("madd16 %0,%1": :"r" (in1), "r" (in2));
asm("add %0,%1,%2" :"=r" (out1) :"r" (in1), "r" (in2) );
asm("mfhi %0": "=r" (outhi));
asm("mflo %0": "=r" (outlo));
asm(".set mips1");
printf("%d %d\n", outhi, outlo);
printf("%d\n", out1);
}
Best regards,
Kaj
kaj.wiik@iki.fi
PS. I see 'move' instructions in the objdump -d, is that a macro, only
mips16 should have move...?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-08-23 7:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23 7:07 MIPS/NEC VR4181 issues Kaj Wiik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).