mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
13 lines
276 B
Perl
13 lines
276 B
Perl
|
|
terra sum(input : &float, N : int)
|
|
var acc : vector(float,4) = vector(0.f,0.f,0.f,0.f)
|
|
for i = 0,N,4 do
|
|
--cast the floats to float4s and load
|
|
var entry = @[&vector(float,4)](input + i)
|
|
acc = acc + entry
|
|
end
|
|
return acc[0] + acc[1] + acc[2] + acc[3]
|
|
end
|
|
|
|
sum:disas()
|