



undefined reference to `___mulsi3'
by swaka on Jan 22, 2009 |
swaka
Posts: 9 Joined: Jan 8, 2009 Last seen: Mar 17, 2010 |
||
Hi
or32 cannot support multiply calculation? Are there any option to create assembler to emulate this? or32-uclinux-ld -Ttext 0x0 start.o utils.o cpu_model.o mb_compress.o -o cpu_model cpu_model.o: In function `compress': or1k/practice10/soft01/cpu_model.c:127: undefined reference to `___mulsi3' Line 127 (cpp_model.c) read(PPMBASE+(fh*info->exp_w+bh*info->exp_w+fv+bv)*4, d); Regards, swaka |
undefined reference to `___mulsi3'
by JeremyBennett on Jan 23, 2009 |
JeremyBennett
Posts: 815 Joined: May 29, 2008 Last seen: Jun 13, 2019 |
||
On Thu, 2009-01-22 at 12:49 +0100, swaka at hdlab.co.jp wrote:
Hi
Hi Swaka,
OR32 supports multiplication just fine - you wouldn't be able to run
Linux otherwise!
The simple example you are building on has no library support - it's a
bare metal test. That's why I have to add utils.c, to provide simple
character I/O by using the extended l.nop operations.
However if you link in the Linux/uClibc infrastructure, which are part
of the tool chain this will all work. There are other, simpler,
operating systems which run on OR32 (notably RTEMS), but I've never
tried using them.
Alternatively you can dig out just the implementation of ___mulsi3 etc
(it should be somewhere in the uClibc/Linux stuff and build a
mini-library of your own.
There may be someone else on this list, who has done more with this, who
can help. Try looking on Rich D'Addio's website: www.meansoffreedom.com.
If you make progress in this area, perhaps you could write up an
explanation and we'll put it on the website for the benefit of others.
HTH,
Jeremy
--
Tel: +44 (1202) 416955
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett at embecosm.com
Web: www.embecosm.com
or32 cannot support multiply calculation? Are there any option to create assembler to emulate this? or32-uclinux-ld -Ttext 0x0 start.o utils.o cpu_model.o mb_compress.o -o cpu_model cpu_model.o: In function `compress': or1k/practice10/soft01/cpu_model.c:127: undefined reference to `___mulsi3' Line 127 (cpp_model.c) read(PPMBASE+(fh*info->exp_w+bh*info->exp_w+fv+bv)*4, d); |
undefined reference to `___mulsi3'
by JeremyBennett on Jan 24, 2009 |
JeremyBennett
Posts: 815 Joined: May 29, 2008 Last seen: Jun 13, 2019 |
||
On Thu, 2009-01-22 at 12:49 +0100, swaka at hdlab.co.jp wrote:
or32 cannot support multiply calculation?
Hi Swaka,
My earlier comments were about using soft multiplication and division.
However all the functions are immediately available with hardware
multiplication and division. Just add the -mhard-div switch to your GCC
compilations:
or32-uclinux-gcc -mhard-div ....
That should be your easiest solution.
HTH,
Jeremy
--
Tel: +44 (1202) 416955
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett at embecosm.com
Web: www.embecosm.com
Are there any option to create assembler to emulate this? or32-uclinux-ld -Ttext 0x0 start.o utils.o cpu_model.o mb_compress.o -o cpu_model cpu_model.o: In function `compress': or1k/practice10/soft01/cpu_model.c:127: undefined reference to `___mulsi3' Line 127 (cpp_model.c) read(PPMBASE+(fh*info->exp_w+bh*info->exp_w+fv+bv)*4, d); |
undefined reference to `___mulsi3'
by swaka on Jan 26, 2009 |
swaka
Posts: 9 Joined: Jan 8, 2009 Last seen: Mar 17, 2010 |
||
Hi,
"-mhard-div" could not resolve this issue. But I found two solution. 1) libgcc.a was missing my environment. There are ___mulsi3 in libgcc.a. 2) or32-uclinux-gcc seems not create multiply/divider instruction by default. "-mhard-mul" option creates mul instruction. Regards, swaka |
undefined reference to `___mulsi3'
by JeremyBennett on Jan 26, 2009 |
JeremyBennett
Posts: 815 Joined: May 29, 2008 Last seen: Jun 13, 2019 |
||
On Mon, 2009-01-26 at 03:21 +0100, swaka at hdlab.co.jp wrote:
"-mhard-div" could not resolve this issue.
But I found two solution.
1)
Hi Swaka,
Looks like you have the problem solved. I'm not sure how much of
libgcc.a will work outside a Linux environment - let us know if you run
into problems.
My mistake on the hardware option. I thought -mhard-div implied
-mhard-mul. I now know correctly :-).
When you come to use the actual Verilog, bear in mind that the default
configuration creates the l.mul/l.mulu instructions, but NOT the
l.div/l.divu instructions. You have to configure these in one of the
Verilog headers if you want them.
Best wishes,
Jeremy
--
Tel: +44 (1202) 416955
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett at embecosm.com
Web: www.embecosm.com
libgcc.a was missing my environment. There are ___mulsi3 in libgcc.a. 2) or32-uclinux-gcc seems not create multiply/divider instruction by default. "-mhard-mul" option creates mul instruction. |
RE: undefined reference to `___mulsi3'
by nick02 on Mar 5, 2015 |
nick02
Posts: 9 Joined: Oct 21, 2014 Last seen: Dec 22, 2016 |
||
2)
or32-uclinux-gcc seems not create multiply/divider instruction by default. "-mhard-mul" option creates mul instruction. Hi all, I use the pre-compiled toolchain and have the same issue. Before adding "-mhard-mul", "-mhard-div" in or32-elf-gcc option, there is no any "l.mul/l.mulu/l.div/l.divu" instruction used in compiled program. Is there any other similar option? Any document about this option? Thanks. Nick |



