P
pfalstad
Hi, is there any documentation out there which will tell me how to best
take advantage of SSE/SSE2? Is there any way to figure out if my java
applet is using SSE instructions or not?
I have a loop that looks like this:
for (j = 0; j < max; j++) {
for (i = 0; i < max; i++) {
float previ = func[i-1][j];
float nexti = func[i+1][j];
float prevj = func[j-1];
float nextj = func[j+1];
float basis = (nexti+previ+nextj+prevj)*.25f;
if (exceptional[j]) { ... handle rare/messy cases ... }
float a = (func[j] - basis) * damp[j];
float b = funci[j] * damp[j];
func [j] = basis + a*const1 - b*const2;
funci[j] = b*const1 + a*const2;
}
}
This loop seems like it could take advantage of SSE, but I doubt the
java compiler is smart enough to figure out how to do it without my
help. I also have no way of knowing what the JIT is doing internally.
Does anyone have any ideas on how I can best optimize this loop (aside
from trial-and-error)?
take advantage of SSE/SSE2? Is there any way to figure out if my java
applet is using SSE instructions or not?
I have a loop that looks like this:
for (j = 0; j < max; j++) {
for (i = 0; i < max; i++) {
float previ = func[i-1][j];
float nexti = func[i+1][j];
float prevj = func[j-1];
float nextj = func[j+1];
float basis = (nexti+previ+nextj+prevj)*.25f;
if (exceptional[j]) { ... handle rare/messy cases ... }
float a = (func[j] - basis) * damp[j];
float b = funci[j] * damp[j];
func [j] = basis + a*const1 - b*const2;
funci[j] = b*const1 + a*const2;
}
}
This loop seems like it could take advantage of SSE, but I doubt the
java compiler is smart enough to figure out how to do it without my
help. I also have no way of knowing what the JIT is doing internally.
Does anyone have any ideas on how I can best optimize this loop (aside
from trial-and-error)?