Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

release / riscv-demo

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • riscv-demo
  • simple
  • tests
  • float
  • float_asm.c
  • Martin's avatar
    Release 2022.1 · a22edae1
    Martin committed Sep 07, 2022
    a22edae1 Browse Files
float_asm.c 383 Bytes
BlameHistoryPermalink
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
////C: '-msoft-fp-single'

int main(void)
{
  asm("fmv.s	f0,f1");
  asm("fneg.s	f0,f1");
  asm("fabs.s	f0,f1");
  asm("fadd.s	f0,f1,f2");
  asm("fsub.s	f0,f1,f2");
  asm("fmul.s	f0,f1,f2");
  asm("fdiv.s	f0,f1,f2");
  asm("fsqrt.s	f0,f1");
  asm("fcvt.s.w	f0,t1");
  asm("fcvt.w.s	t0,f1");
  asm("feq.s	t0,f0,f1");
  asm("flt.s	t0,f0,f1");
  asm("fle.s	t0,f0,f1");

  return 0;
}