RE: cmov for stores

2006-03-08 Thread rajagopal, dwarak
Behalf Of Steven Bosscher Sent: Thursday, February 09, 2006 1:31 PM To: gcc@gcc.gnu.org Cc: rajagopal, dwarak Subject: Re: cmov for stores On Thursday 09 February 2006 20:04, rajagopal, dwarak wrote: > The fact here is that in this case, A[k] will never trap because the > A[k] is already bee

Re: cmov for stores

2006-02-09 Thread Steven Bosscher
On Thursday 09 February 2006 20:04, rajagopal, dwarak wrote: > The fact here is that in this case, A[k] will never trap because the > A[k] is already been written once along the path from Entry to the "A[k] > = g". So it is safe to convert it to a cmov statement. But GCC doesn't know that this mem

cmov for stores

2006-02-09 Thread rajagopal, dwarak
int cmov(int* A ,int B ,int C ,int* D ,int* E ,int F ,int g) { int k,f; for (k = 1; k <= 1000; k++) { A[k] = B+C; g = D[k-1] + E[k-1]; if (g > A[k]) A[k]=g; /* This is not converted to cmov*/ f += g; } return f; } In the above code, the if-then statement is not conve