Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

Can't execute instruction "fdiv.d" which generated by double div operation #35

Description

@GUIDINGLI

Hi,

Recently I use eth ri5cy toolchain to support pulp instruction.

Here is my steps.

  1. git clone https://github.com/pulp-platform/ri5cy_gnu_toolchain.git
  2. Compile toolchain with: make RISCY_FPU=1
  3. Compile C code with command:
    -march=RV32IMFDCXpulpv2 -mhard-float
    detail:
    ri5cy/bin/riscv32-unknown-elf-gcc -c -D__NuttX__ -fno-builtin -Wall -Wstrict-prototypes -Wshadow -Wundef -g -Os -msave-restore -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -ffunction-sections -fdata-sections -march=RV32IMFDCXpulpv2 -mhard-float fileA.c -o fileA.o

In my code, there is double operation:

#define RND1_CONSTP 999563
static double_t frand1(void)
{
unsigned long randint = 30;
return ((double_t)randint) / ((double_t)RND1_CONSTP);
}

Very simple double operation.
And after compile this C code will generate "fdiv.d" operation.
But my core can't support "fdiv.d", after run this bin in ri5cy core, core will crash and report " Instruction Abort".

So, I remove the 'D', and it become:
-march=RV32IMFCXpulpv2 -mhard-float

But this can't compile pass, meet:
cc1: error: -march=RV32IMFCXpulpv2: single-precision-only is not yet supported

How to resolve this ?

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions