* Mips16 toolchain?
@ 2002-03-25 13:58 Johannes Stezenbach
2002-03-25 14:59 ` Kevin D. Kissell
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Johannes Stezenbach @ 2002-03-25 13:58 UTC (permalink / raw)
To: linux-mips
Hi all,
I'm currently using a toolchain based on binutils 2.12.90.0.1
and gcc-2.95.4-debian for my Linux kernel work.
Since I'm developing for an embedded target, I wanted to
check out mips16 code generation for the userspace apps.
Unfortunately my gcc aborts with an internal error
on even the simplest test program:
$ cat t16.c
extern int write(int fd, const char *buf, unsigned int size);
int main(int argc, char *argv[])
{
write(0, "xy", 2);
return 0;
}
$ mips-linux-gcc -mips16 -Wall -S t16.c
t16.c: In function `main':
t16.c:8: Internal compiler error:
t16.c:8: Unable to generate reloads for:
(call_insn 18 16 21 (parallel[
(set (reg:SI 2 v0)
(call (mem:SI (symbol_ref:SI ("write")) 0)
(const_int 16 [0x10])))
(clobber (reg:SI 31 ra))
] ) 469 {call_value_internal2} (nil)
(nil)
(expr_list (use (reg:SI 6 a2))
(expr_list (use (reg:SI 5 a1))
(expr_list (use (reg:SI 4 a0))
(nil)))))
I saw that the algorithmics toolchain (which Dominic Sweetman
offered to the Linux/MIPS community here a month ago) claims
to have full support for the mips16 instruction set.
My questions:
Does anyone here have experiences with mips16 and/or with the
algorithmics toolchain?
Is there working support for mips16 in any other gcc-version?
How about gcc-3.x from CVS?
Any other comments or recommendations regarding mips16?
glibc support wrt mips16 is not an issue for us, since we
plan to use the dietlibc (http://www.fefe.de/dietlibc/).
MIPS support for the dietlibc is still bit rough, though.
Regards,
Johannes
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Mips16 toolchain?
2002-03-25 13:58 Mips16 toolchain? Johannes Stezenbach
@ 2002-03-25 14:59 ` Kevin D. Kissell
2002-03-25 14:59 ` Kevin D. Kissell
2002-03-26 8:10 ` Carsten Langgaard
2002-03-25 18:13 ` Dominic Sweetman
2002-03-26 18:53 ` Johannes Stezenbach
2 siblings, 2 replies; 7+ messages in thread
From: Kevin D. Kissell @ 2002-03-25 14:59 UTC (permalink / raw)
To: Johannes Stezenbach, linux-mips
> I saw that the algorithmics toolchain (which Dominic Sweetman
> offered to the Linux/MIPS community here a month ago) claims
> to have full support for the mips16 instruction set.
>
> My questions:
> Does anyone here have experiences with mips16 and/or with the
> algorithmics toolchain?
Yes. Both Algorithmics and Green Hills embedded
tool chains support it reasonably well. GHS has no
Linux target, though. Algorithmics has been working
on one, but I'm not sure what it's current status is.
> Is there working support for mips16 in any other gcc-version?
Cygnus (now part of Red Hat) did the very first MIPS16
support for gcc, most of which found its way into the
main development/maintence stream. But apparently
not enough of it, based on your experience.
> How about gcc-3.x from CVS?
No data there.
> Any other comments or recommendations regarding mips16?
MIPS16 requires more than just gcc support.
One needs a binutils that can distinguish a MIPS16
binary module (or function if you want to be fancy and
mix/match within modules) from a MIPS32/64 module
and perform fixups so that the right selections are made
between JAL and JALX on function invocations.
If you've got that, you should not need a seperate
MIPS16 libc.
To correctly support MIPS16, the Linux kernel does
need to be tweaked in those cases where user-mode
instructions are decoded and interpreted, as in
arch/mips/kernel/branch.c and unaligned.c.
I believe that code has been prototyped somewhere,
but it's not yet in any commonly used repository to
the best of my knowledge. If you avoid throwing
executing non-instructions, performing unaligned
accesses, etc, you should be able to tiptoe around
that deficiency.
Regards,
Kevin K.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Mips16 toolchain?
2002-03-25 14:59 ` Kevin D. Kissell
@ 2002-03-25 14:59 ` Kevin D. Kissell
2002-03-26 8:10 ` Carsten Langgaard
1 sibling, 0 replies; 7+ messages in thread
From: Kevin D. Kissell @ 2002-03-25 14:59 UTC (permalink / raw)
To: Johannes Stezenbach, linux-mips
> I saw that the algorithmics toolchain (which Dominic Sweetman
> offered to the Linux/MIPS community here a month ago) claims
> to have full support for the mips16 instruction set.
>
> My questions:
> Does anyone here have experiences with mips16 and/or with the
> algorithmics toolchain?
Yes. Both Algorithmics and Green Hills embedded
tool chains support it reasonably well. GHS has no
Linux target, though. Algorithmics has been working
on one, but I'm not sure what it's current status is.
> Is there working support for mips16 in any other gcc-version?
Cygnus (now part of Red Hat) did the very first MIPS16
support for gcc, most of which found its way into the
main development/maintence stream. But apparently
not enough of it, based on your experience.
> How about gcc-3.x from CVS?
No data there.
> Any other comments or recommendations regarding mips16?
MIPS16 requires more than just gcc support.
One needs a binutils that can distinguish a MIPS16
binary module (or function if you want to be fancy and
mix/match within modules) from a MIPS32/64 module
and perform fixups so that the right selections are made
between JAL and JALX on function invocations.
If you've got that, you should not need a seperate
MIPS16 libc.
To correctly support MIPS16, the Linux kernel does
need to be tweaked in those cases where user-mode
instructions are decoded and interpreted, as in
arch/mips/kernel/branch.c and unaligned.c.
I believe that code has been prototyped somewhere,
but it's not yet in any commonly used repository to
the best of my knowledge. If you avoid throwing
executing non-instructions, performing unaligned
accesses, etc, you should be able to tiptoe around
that deficiency.
Regards,
Kevin K.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Mips16 toolchain?
2002-03-25 14:59 ` Kevin D. Kissell
2002-03-25 14:59 ` Kevin D. Kissell
@ 2002-03-26 8:10 ` Carsten Langgaard
1 sibling, 0 replies; 7+ messages in thread
From: Carsten Langgaard @ 2002-03-26 8:10 UTC (permalink / raw)
To: Kevin D. Kissell; +Cc: Johannes Stezenbach, linux-mips
"Kevin D. Kissell" wrote:
> > I saw that the algorithmics toolchain (which Dominic Sweetman
> > offered to the Linux/MIPS community here a month ago) claims
> > to have full support for the mips16 instruction set.
> >
> > My questions:
> > Does anyone here have experiences with mips16 and/or with the
> > algorithmics toolchain?
>
> Yes. Both Algorithmics and Green Hills embedded
> tool chains support it reasonably well. GHS has no
> Linux target, though. Algorithmics has been working
> on one, but I'm not sure what it's current status is.
>
> > Is there working support for mips16 in any other gcc-version?
>
> Cygnus (now part of Red Hat) did the very first MIPS16
> support for gcc, most of which found its way into the
> main development/maintence stream. But apparently
> not enough of it, based on your experience.
>
> > How about gcc-3.x from CVS?
>
> No data there.
>
> > Any other comments or recommendations regarding mips16?
>
> MIPS16 requires more than just gcc support.
> One needs a binutils that can distinguish a MIPS16
> binary module (or function if you want to be fancy and
> mix/match within modules) from a MIPS32/64 module
> and perform fixups so that the right selections are made
> between JAL and JALX on function invocations.
> If you've got that, you should not need a seperate
> MIPS16 libc.
>
> To correctly support MIPS16, the Linux kernel does
> need to be tweaked in those cases where user-mode
> instructions are decoded and interpreted, as in
> arch/mips/kernel/branch.c and unaligned.c.
> I believe that code has been prototyped somewhere,
> but it's not yet in any commonly used repository to
> the best of my knowledge. If you avoid throwing
> executing non-instructions, performing unaligned
> accesses, etc, you should be able to tiptoe around
> that deficiency.
I don't think you need to tiptoe to get it working :-;
It should be easy to avoid non-instructions, unaligned accesses and co.
We have a few MIPS16 applications running using Algorithmics compiler
and a static non-PIC libc.
>
> Regards,
>
> Kevin K.
--
_ _ ____ ___ 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] 7+ messages in thread
* Re: Mips16 toolchain?
2002-03-25 13:58 Mips16 toolchain? Johannes Stezenbach
2002-03-25 14:59 ` Kevin D. Kissell
@ 2002-03-25 18:13 ` Dominic Sweetman
2002-03-26 18:53 ` Johannes Stezenbach
2 siblings, 0 replies; 7+ messages in thread
From: Dominic Sweetman @ 2002-03-25 18:13 UTC (permalink / raw)
To: Johannes Stezenbach; +Cc: linux-mips
Johannes Stezenbach (js@convergence.de) writes:
> Since I'm developing for an embedded target, I wanted to
> check out mips16 code generation for the userspace apps.
> Unfortunately my gcc aborts with an internal error
> on even the simplest test program:
No surprise, really.
> I saw that the algorithmics toolchain (which Dominic Sweetman
> offered to the Linux/MIPS community here a month ago) claims
> to have full support for the mips16 instruction set.
It does. If you want an 'embedded' toolchain (to generate software to
run standalone or in general without position-independent shared
libraries) then it's a mature product.
We are also developing a compiler from the same source tree, but
configured for Linux. That was the compiler we'll be looking for
beta-testers for in the next couple of months.
If you want to be able to build MIPS16 applications and then run them
on Linux, this is more challenging. You have to build everything
static: then it works mostly, and some people at MIPS have built and
run some programs.
It seems likely we'll be doing some development work over the
spring/summer to make this more robust and less painful.
> How about gcc-3.x from CVS?
We believe not. We'd like to converge our compiler (currently 2.96+
based) back to gcc 3.x so we can get most of our MIPS changes into the
mainstream tree, but it's not going to be easy.
--
Dominic Sweetman
Algorithmics Ltd
The Fruit Farm, Ely Road, Chittering, CAMBS CB5 9PH, ENGLAND
phone +44 1223 706200/fax +44 1223 706250/direct +44 1223 706205
http://www.algor.co.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Mips16 toolchain?
2002-03-25 13:58 Mips16 toolchain? Johannes Stezenbach
2002-03-25 14:59 ` Kevin D. Kissell
2002-03-25 18:13 ` Dominic Sweetman
@ 2002-03-26 18:53 ` Johannes Stezenbach
2 siblings, 0 replies; 7+ messages in thread
From: Johannes Stezenbach @ 2002-03-26 18:53 UTC (permalink / raw)
To: linux-mips
First of all, many thanks for your help!
I wrote:
> $ mips-linux-gcc -mips16 -Wall -S t16.c
> t16.c: In function `main':
> t16.c:8: Internal compiler error:
Non-PIC mips16 compilation seems to work with gcc-2.95.4-debian:
$ mips-linux-gcc -fno-pic -mno-abicalls -mips16 -Wall -c t16.c
yields a t16.o, which looks good when disassembled with
mips-linux-objdump.
Now I need a non-PIC version of libgcc to link against,
since mips-linux-ld cannot link PIC with non-PIC code.
I had built a non-PIC libgcc for earlier dietlibc experiments,
but discarded it in favor of a less experimental development
environment...
I feel I have to learn more about the Linux kernel's role
when executing mips16 code (unaligned.c etc.), and experiment
more with my toolchain, until I know what I'm really doing ;-)
I will post here when I have any meaningful results.
Regards,
Johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <no.id>]
* Re: Mips16 toolchain?
[not found] <no.id>
@ 2002-03-25 20:37 ` Hartvig Ekner
0 siblings, 0 replies; 7+ messages in thread
From: Hartvig Ekner @ 2002-03-25 20:37 UTC (permalink / raw)
To: linux-mips
Dominic Sweetman writes:
>
> We are also developing a compiler from the same source tree, but
> configured for Linux. That was the compiler we'll be looking for
> beta-testers for in the next couple of months.
>
> If you want to be able to build MIPS16 applications and then run them
> on Linux, this is more challenging. You have to build everything
> static: then it works mostly, and some people at MIPS have built and
> run some programs.
I have built glibc in a static and non-PIC version to allow linking against
M16 user apps (non-PIC required because current Linux compilers cannot
generate M16 PIC code). It worked fine using the Algo 5.0 Beta for Linux.
I successfully built a few applications (ones which only required libc).
It won't be really useful until somebody builds a complete library set
which is static and non-PIC, or PIC support gets included in the M16
code generator.
/Hartvig
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-03-26 18:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-25 13:58 Mips16 toolchain? Johannes Stezenbach
2002-03-25 14:59 ` Kevin D. Kissell
2002-03-25 14:59 ` Kevin D. Kissell
2002-03-26 8:10 ` Carsten Langgaard
2002-03-25 18:13 ` Dominic Sweetman
2002-03-26 18:53 ` Johannes Stezenbach
[not found] <no.id>
2002-03-25 20:37 ` Hartvig Ekner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox