aboutsummaryrefslogtreecommitdiff
path: root/bench/main.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-11-29 21:19:16 +0000
committerrodri <rgl@antares-labs.eu>2023-11-29 21:19:16 +0000
commita0b600a89c2e6e636579fe727235d036c08c7a9d (patch)
tree48be9afc10ab59f68aa4670d7b8b929e4d569d5f /bench/main.c
parent092bcb0cb43b4a1ca351a3085c512bf6afa89989 (diff)
downloadamd64-simd-a0b600a89c2e6e636579fe727235d036c08c7a9d.tar.gz
amd64-simd-a0b600a89c2e6e636579fe727235d036c08c7a9d.tar.bz2
amd64-simd-a0b600a89c2e6e636579fe727235d036c08c7a9d.zip
remove instructions recently added to 9front. implemented some tests.
Diffstat (limited to 'bench/main.c')
-rw-r--r--bench/main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/bench/main.c b/bench/main.c
index 060a3d3..6f4886f 100644
--- a/bench/main.c
+++ b/bench/main.c
@@ -5,6 +5,7 @@
#include "../bench9/b.h"
double min(double, double);
+double dotvec2_sse(Point2, Point2);
double dotvec2_sse4(Point2, Point2);
double dotvec2_avx(Point2, Point2);
double dotvec3_sse4(Point3, Point3);
@@ -64,14 +65,15 @@ static void
bdotvec2(int fd)
{
Bgr g;
- B *b0, *b1, *b2;
+ B *b0, *b1, *b2, *b3;
Point2 a, b;
int i;
benchinitgr(&g, "2d dot product");
b0 = benchadd(&g, "dotvec2");
- b1 = benchadd(&g, "dotvec2_sse4");
- b2 = benchadd(&g, "dotvec2_avx");
+ b1 = benchadd(&g, "dotvec2_sse");
+ b2 = benchadd(&g, "dotvec2_sse4");
+ b3 = benchadd(&g, "dotvec2_avx");
while(b0->n > 0 || b1->n > 0){
a = Vec2(truerand()*frand(), truerand()*frand());
@@ -84,13 +86,18 @@ bdotvec2(int fd)
benchin(b1);
for(i = 0; i < 1e6; i++)
- dotvec2_sse4(a, b);
+ dotvec2_sse(a, b);
benchout(b1);
benchin(b2);
for(i = 0; i < 1e6; i++)
- dotvec2_avx(a, b);
+ dotvec2_sse4(a, b);
benchout(b2);
+
+ benchin(b3);
+ for(i = 0; i < 1e6; i++)
+ dotvec2_avx(a, b);
+ benchout(b3);
}
benchprintgr(&g, fd);