07-29-2024, 08:08 AM

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?

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?