how can i occur fmadd instruction?
#1
how can i occur the fmadd instruction with c code?

in regression examples
      for (t=0; t<T; t++) {
        for (i=2; i<N-1; i++) {
          for (j=2; j<N-1; j++) {
            b[i][j]= 0.2f*(a[i][j]+a[i][j-1]+a[i][1+j]+a[1+i][j]+a[i-1][j]);
            printf("caculate finished # i=%d j=%d \n",i,j);
          }
        }
      }
This example occurs fadd instrctions. 
then, how can i occur fmadd instrctions? is there any special condition for it?
Reply
#2
I am not a compiler expert, but see this for LLVM:
https://discourse.llvm.org/t/risc-v-mult...ions/64194

It is quite possible that the compiler would need some help, they seem to be better when the operation is in fact: (rs1×rs2)+rs3 and not more complex. The compiler flags play sometime an important role as well.
Visit pulp-platform.org and follow us on twitter @pulp_platform
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)