mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
To: <musl@lists.openwall.com>
Cc: Brian Cain <bcain@quicinc.com>, Sid Manning <sidneym@quicinc.com>,
	"Rich Felker" <dalias@libc.org>, Fangrui Song <i@maskray.me>,
	Szabolcs Nagy <nsz@port70.net>
Subject: [musl] [RFC PATCH 3/5] hexagon: add fma/fmaxf/fminf routines
Date: Wed, 30 Aug 2023 09:22:28 -0300	[thread overview]
Message-ID: <7b59f86b784cba366df72635f2b38edf2614450f.1693396649.git.quic_mathbern@quicinc.com> (raw)
In-Reply-To: <cover.1693396649.git.quic_mathbern@quicinc.com>

From: Sid Manning <sidneym@quicinc.com>

---
 src/math/hexagon/fmaf.c  | 8 ++++++++
 src/math/hexagon/fmaxf.c | 8 ++++++++
 src/math/hexagon/fminf.c | 8 ++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 src/math/hexagon/fmaf.c
 create mode 100644 src/math/hexagon/fmaxf.c
 create mode 100644 src/math/hexagon/fminf.c

diff --git a/src/math/hexagon/fmaf.c b/src/math/hexagon/fmaf.c
new file mode 100644
index 00000000..7ce1996c
--- /dev/null
+++ b/src/math/hexagon/fmaf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+float fmaf(float x, float y, float z)
+{
+	__asm__ ("%[z]+=sfmpy(%[x], %[y])"
+                 : [z]"+r"(z) : [x]"r"(x), [y]"r"(y));
+	return z;
+}
diff --git a/src/math/hexagon/fmaxf.c b/src/math/hexagon/fmaxf.c
new file mode 100644
index 00000000..0dc52b25
--- /dev/null
+++ b/src/math/hexagon/fmaxf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+float fmaxf(float x, float y)
+{
+	__asm__ ("%[x]=sfmax(%[x], %[y])"
+                : [x]"+r"(x) : [y]"r"(y));
+	return x;
+}
diff --git a/src/math/hexagon/fminf.c b/src/math/hexagon/fminf.c
new file mode 100644
index 00000000..aeb20ae0
--- /dev/null
+++ b/src/math/hexagon/fminf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+float fminf(float x, float y)
+{
+	__asm__ ("%[x]=sfmin(%[x], %[y])"
+                : [x]"+r"(x) : [y]"r"(y));
+	return x;
+}
-- 
2.37.2


  parent reply	other threads:[~2023-08-30 12:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 12:22 [musl] [RFC PATCH 0/5] Add support to Hexagon DSP Matheus Tavares Bernardino
2023-08-30 12:22 ` [musl] [RFC PATCH 1/5] Add support to Hexagon arch Matheus Tavares Bernardino
2023-08-30 12:22 ` [musl] [RFC PATCH 2/5] hexagon: add fenv header and implementation Matheus Tavares Bernardino
2023-08-30 12:22 ` Matheus Tavares Bernardino [this message]
2023-08-30 12:22 ` [musl] [RFC PATCH 4/5] hexagon: add bits/user.h Matheus Tavares Bernardino
2023-08-30 12:22 ` [musl] [RFC PATCH 5/5] INSTALL: add 'Hexagon' to list of supported targets Matheus Tavares Bernardino
2023-09-08 11:18 ` [musl] [RFC PATCH 0/5] Add support to Hexagon DSP Matheus Tavares Bernardino
2023-09-26 16:43 ` Rob Landley
2023-09-26 16:48   ` Brian Cain
2023-09-26 17:55     ` Rob Landley
2023-09-26 18:13       ` Brian Cain
2023-09-27  0:05         ` Brian Cain
2023-09-27  1:49         ` Rob Landley
2023-09-27  2:10           ` Brian Cain
2023-09-27 13:19             ` Rob Landley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b59f86b784cba366df72635f2b38edf2614450f.1693396649.git.quic_mathbern@quicinc.com \
    --to=quic_mathbern@quicinc.com \
    --cc=bcain@quicinc.com \
    --cc=dalias@libc.org \
    --cc=i@maskray.me \
    --cc=musl@lists.openwall.com \
    --cc=nsz@port70.net \
    --cc=sidneym@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).