From 251b1dd8a9677b5a08b44a1037485c8e1a57252e Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Sat, 9 Sep 2023 08:28:18 +0300

Subject: [PATCH 1/1] Math: SSE variant of xy_F3


include/the_Foundation/math_sse.h | 5 +++++

tests/t_math.c | 5 +++--

2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/the_Foundation/math_sse.h b/include/the_Foundation/math_sse.h

index 8980aff..84427fa 100644

--- a/include/the_Foundation/math_sse.h

+++ b/include/the_Foundation/math_sse.h

@@ -266,6 +266,11 @@ iLocalDef iFloatVec3 values_F3(const iFloat3 d) {

#define iFloat3Shuffle3(d, X, Y, Z) (iFloat3){ _mm_shuffle_ps((d).m, (d).m, _MM_SHUFFLE(Z, Y, X, 0)) }

+iLocalDef iFloat3 xy_F3(const iFloat3 d) {

+}

iLocalDef iFloat3 yzx_F3(const iFloat3 d) {

 return iFloat3Shuffle3(d, 2, 3, 1);

}

diff --git a/tests/t_math.c b/tests/t_math.c

index fd44355..ad001bf 100644

--- a/tests/t_math.c

+++ b/tests/t_math.c

@@ -125,7 +125,7 @@ int main(int argc, char **argv) {

             iMaxf(3.f, 5.f),

             iClampf(1, 3, 5), iClampf(7, 3, 5), iClampf(4, 3, 5));

 }

     print_("zero", zero_F4());

     print_("init4", init_F4(1, 2, 3, 4)); {

         float f[4];

@@ -147,7 +147,8 @@ int main(int argc, char **argv) {

            length_F3(init_F3(0, -2, 0)),

            length_F3(init_F3(0, 0, -2)));

     printf("Sum: F3: %f F4: %f\n", sum_F3(init_F3(1, 2, 3)), sum_F4(init_F4(1, 2, 3, 4)));

         iFloat3 v3 = init_F3(1, 1, 1);

         setX_F3(&v3, 2);

         print_("set x", v3);

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/the_Foundation/main/patch/251b1dd8a9677b5a08b44a1037485c8e1a57252e.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
26.765731 milliseconds
Gemini-to-HTML Time
1.853974 milliseconds

This content has been proxied by September (ba2dc).