Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.
This repository was archived by the owner on May 7, 2024. It is now read-only.

"remove -mrvv compile option" make newlib library code has side effect.... #360

@chihinko

Description

@chihinko

library newlib is built with -O2 by default, the -O2 option imply auto-vectorization -mriscv-vector-bits=128,
this would make library code generate vector code that only work for spike --varch=vlen:128,elen:64,slen:128
when execute.

Here is an example:
riscv64-unknown-elf-gcc -O2 -mriscv-vector-bits=64 tmp.c -o tmp.64.x
spike --varch=vlen:64,elen:32,slen:64 --isa=RV64IMAFDCV pk tmp.64.x
b = 0.000 c = 0.000
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
b = 1.380 c = 1.380
should be
b = 0.000 c = 0.000
b = 1.000 c = 2.000
b = 2.000 c = 4.000
b = 3.000 c = 6.000
b = 4.000 c = 8.000
b = 5.000 c = 10.000
b = 6.000 c = 12.000
b = 7.000 c = 14.000
b = 8.000 c = 16.000
b = 9.000 c = 18.000

tmp.c.gz

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