Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
4612b71560e33ec7bb8fa7fc3bb1f2489b4a6a50
/
.
/
examples
/
rust
/
Sum_over_array_(Optimized).rs
blob: f80d267f61622b7aa5888e0ddb9d74153edee797 [
file
] [
log
] [
blame
] [
raw
]
// Compile with -C opt-level=3 -C target-cpu=native to see autovectorization
#[
repr
(
align
(
64
))]
pub
struct
Aligned
<
T
:
?
Sized
>(
T
);
pub
fn
sum_array
(
input
:
&
Aligned
<[
i32
]>)
->
i32
{
input
.
0.iter
().
sum
()
}