3 ms·
Because two loops is really: n*(x + c) + n*(y + c) => n*x + n*y + 2*n*c Where c is some loop overhead, such as loading the arguments and work variables into r
by rowanG077 6mo ago
Because two loops is really:
n*(x + c) + n*(y + c) => n*x + n*y + 2*n*c
Where c is some loop overhead, such as loading the arguments and work variables into registers and storing them back, checking the loop end condition, increasing the counters etc.
So if you fuse you get:
n*x + n*y + n*c