pulp-platform / pulpino

An open-source microcontroller system based on RISC-V
http://www.pulp-platform.org
Other
899 stars 298 forks source link

pulpino floating point unit #344

Closed Ankasysemre closed 4 years ago

Ankasysemre commented 4 years ago

Hi, After fpu is up in pulpino. I can not use it from software part without inline assembly. Anyone can help How can I do for example multupication operation like "3.4*2.43" in c software part. Thanks.

sunil3690 commented 4 years ago

Are you sure about to enable the fpu unit in pulpino platform.(RISCY core)

On Tue, May 5, 2020, 9:30 PM Ankasysemre notifications@github.com wrote:

Hi, After fpu is up in pulpino. I can not use it from software part without inline assembly. Anyone can help How can I do for example multupication operation like "3.4*2.43" in c software part. Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pulp-platform/pulpino/issues/344, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANAORJNB4Q6TLQ4C2YKD6ATRQAZ2NANCNFSM4MZWJJYQ .

Ankasysemre commented 4 years ago

Hi sunil3690 , Sorry there is wrong word in up . I use it with inline assembly in simulation enviroment. My main question How can I use it like "3.4*2.43". I suppose that something goes wrong with c compilization part. For example may be there is some flags to generate instruction with fpu support during compilizaiton c source code.

sunil3690 commented 4 years ago

Pulpino support only integer multiplication (RV32IM) IMXPulpv2. It might be wrong with your c code, you needed to write simple two integer multiplication c code and run on it will be on right way if successfully executed. But as per your requirement two(2.4*3.4)floating point multiplication is not supported. It will not executed with fpu. For that we need to configure for fpu then only it is possible. Present it is configured only for RV32IM. Not for RV32F=1. According to my study. Because I am also trying to go for fpu(RISCY)

On Tue, May 5, 2020, 10:13 PM Ankasysemre notifications@github.com wrote:

Hi sunil3690 , Sorry there is wrong word in up . I use it with inline assembly in simulation enviroment. My main question How can I use it like "3.4*2.43". I suppose that something goes wrong with c compilization part. For example may be there is some flags to generate instruction with fpu support during compilizaiton c source code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pulp-platform/pulpino/issues/344#issuecomment-624166514, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANAORJMNMK66RRQNAS677VDRQA6ZXANCNFSM4MZWJJYQ .

barrydebruin commented 4 years ago

To add; its maybe convenient to error on all implicit double promotions i.e. add the following -fsingle-precision-constant -mfpdouble=float -Werror=double-promotion to your TARGET_C_FLAGS variable.

The RISC-V core doesn't support any double instructions.