Finish part1
This commit is contained in:
parent
f7198add5e
commit
c5d97c5df9
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ target:
|
|||||||
mkdir -p target
|
mkdir -p target
|
||||||
|
|
||||||
target/nbody.c: target
|
target/nbody.c: target
|
||||||
$(cc) -O3 -fomit-frame-pointer -march=native -funroll-loops \
|
$(CC) -O3 -fomit-frame-pointer -march=native -funroll-loops \
|
||||||
nbody.c -o target/nbody.c -lm
|
nbody.c -o target/nbody.c -lm
|
||||||
|
|
||||||
target/nbody-1:
|
target/nbody-1:
|
||||||
|
@ -189,6 +189,7 @@ unsafe fn advance(bodies: *mut body) {
|
|||||||
_mm_div_pd(_mm_set1_pd(0.01), distance_Squared),
|
_mm_div_pd(_mm_set1_pd(0.01), distance_Squared),
|
||||||
distance_Reciprocal,
|
distance_Reciprocal,
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut k = 0;
|
let mut k = 0;
|
||||||
@ -210,7 +211,6 @@ unsafe fn advance(bodies: *mut body) {
|
|||||||
(*bodies.add(i)).position[m] += 0.01 * (*bodies.add(i)).velocity[m];
|
(*bodies.add(i)).position[m] += 0.01 * (*bodies.add(i)).velocity[m];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user