aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-11-27 09:57:54 +0000
committerrodri <rgl@antares-labs.eu>2023-11-27 09:57:54 +0000
commit092bcb0cb43b4a1ca351a3085c512bf6afa89989 (patch)
tree8fb05b7897c8737de9b285542ff8c8fffa8552b4 /main.c
parented1a42eb5035b0ba8d0dab7c17a6372995b403a2 (diff)
downloadamd64-simd-092bcb0cb43b4a1ca351a3085c512bf6afa89989.tar.gz
amd64-simd-092bcb0cb43b4a1ca351a3085c512bf6afa89989.tar.bz2
amd64-simd-092bcb0cb43b4a1ca351a3085c512bf6afa89989.zip
idem.
Diffstat (limited to 'main.c')
-rw-r--r--main.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/main.c b/main.c
index 02fc11c..51a2f89 100644
--- a/main.c
+++ b/main.c
@@ -11,6 +11,7 @@ Point2 Pt2b(double, double, double);
Point3 crossvec3_sse(Point3, Point3);
double hsubpd(double, double);
double fma(double, double, double);
+Point2 addpt2_sse(Point2, Point2);
Point2 addpt2_avx(Point2, Point2);
Point3 addpt3_avx(Point3, Point3);
@@ -40,8 +41,10 @@ main(int argc, char *argv[])
a = strtod(argv[0], nil);
b = strtod(argv[1], nil);
+ r = 0;
r = fmin(a, b);
print("fmin(%g, %g) = %g\n", a, b, r);
+ r = 0;
r = min(a, b);
print("min(%g, %g) = %g\n", a, b, r);
@@ -49,10 +52,13 @@ main(int argc, char *argv[])
p0 = Pt2b(a, 1, 1);
p1 = Pt2b(b, 3, 1);
- r = dotvec2_sse4(p0, p1);
- print("dotvec2_sse4(%v, %v) = %g\n", p0, p1, r);
+ r = 0;
r = dotvec2(p0, p1);
print("dotvec2(%v, %v) = %g\n", p0, p1, r);
+ r = 0;
+ r = dotvec2_sse4(p0, p1);
+ print("dotvec2_sse4(%v, %v) = %g\n", p0, p1, r);
+ r = 0;
r = dotvec2_avx(p0, p1);
print("dotvec2_avx(%v, %v) = %g\n", p0, p1, r);
@@ -60,15 +66,19 @@ main(int argc, char *argv[])
p0t = Pt3(a, 1, 9, 1);
p1t = Pt3(b, 3, 4, 1);
- r = dotvec3_sse4(p0t, p1t);
- print("dotvec3_sse4(%V, %V) = %g\n", p0t, p1t, r);
+ r = 0;
r = dotvec3(p0t, p1t);
print("dotvec3(%V, %V) = %g\n", p0t, p1t, r);
+ r = 0;
+ r = dotvec3_sse4(p0t, p1t);
+ print("dotvec3_sse4(%V, %V) = %g\n", p0t, p1t, r);
+ r = 0;
r = dotvec3_avx(p0t, p1t);
print("dotvec3_avx(%V, %V) = %g\n", p0t, p1t, r);
print("\n");
+ r = 0;
r = hsubpd(a, b);
print("hsubpd(%g, %g) = %g\n", a, b, r);
@@ -76,15 +86,19 @@ main(int argc, char *argv[])
p0t = Pt3(a, 1, 9, 1);
p1t = Pt3(b, 3, 4, 1);
- prt = crossvec3_sse(p0t, p1t);
- print("crossvec3_sse(%V, %V) = %V\n", p0t, p1t, prt);
+ prt = Vec3(0,0,0);
prt = crossvec3(p0t, p1t);
print("crossvec3(%V, %V) = %V\n", p0t, p1t, prt);
+ prt = Vec3(0,0,0);
+ prt = crossvec3_sse(p0t, p1t);
+ print("crossvec3_sse(%V, %V) = %V\n", p0t, p1t, prt);
print("\n");
+ r = 0;
r = madd(a, b, 21);
print("madd(%g, %g, 21) = %g\n", a, b, r);
+ r = 0;
r = fma(a, b, 21);
print("fma(%g, %g, 21) = %g\n", a, b, r);
@@ -92,8 +106,13 @@ main(int argc, char *argv[])
p0 = Pt2b(a, 1, 1);
p1 = Pt2b(b, 3, 1);
+ pr = Vec2(0,0);
pr = addpt2(p0, p1);
print("addpt2(%v, %v) = %v\n", p0, p1, pr);
+ pr = Vec2(0,0);
+ pr = addpt2_sse(p0, p1);
+ print("addpt2_sse(%v, %v) = %v\n", p0, p1, pr);
+ pr = Vec2(0,0);
pr = addpt2_avx(p0, p1);
print("addpt2_avx(%v, %v) = %v\n", p0, p1, pr);
@@ -101,8 +120,10 @@ main(int argc, char *argv[])
p0t = Pt3(a, 1, 1, b);
p1t = Pt3(b, 3, 1, a);
+ prt = Vec3(0,0,0);
prt = addpt3(p0t, p1t);
print("addpt3(%V, %V) = %V\n", p0t, p1t, prt);
+ prt = Vec3(0,0,0);
prt = addpt3_avx(p0t, p1t);
print("addpt3_avx(%V, %V) = %V\n", p0t, p1t, prt);