I want to use SSE intrinsics that will replace this code:
for (i=1;i<=imax;i++) {
for (j=1;j<=jmax;j++) {
if (flag[i][j] & C_F) {
float fcalc = f[i][j]-f[i-1][j];
float a = fcalc/delx;
float gcalc = g[i][j]-g[i][j-1];
float b = gcalc/dely;
float add = a+b;
rhs[i][j] = add/del_t;
}
}
flag is a 2D array of characters and C_F is a constant
#define C_F 0x0010
I am new to SSE and I know how basic branching works with floats but I have no idea how it works with constants and characters. Any help will be greatly appreciated