mailing list of musl libc
 help / color / mirror / code / Atom feed
From: zhangfei <zhang_fei_0403@163.com>
To: musl@lists.openwall.com
Cc: dalias@libc.org, zhangfei <zhangfei@nj.iscas.ac.cn>
Subject: [musl] [PATCH 0/1] RISC-V: Add math functions
Date: Fri, 28 Jul 2023 14:19:54 +0800	[thread overview]
Message-ID: <20230728061955.20156-1-zhang_fei_0403@163.com> (raw)

From: zhangfei <zhangfei@nj.iscas.ac.cn>

Hi,

I added 8 math function implementations for riscv64.These functions 
are implemented using riscv floating-point instructions instead of C
implementations.There is a similar implementation in glibc:

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/rv64/rvd/s_llrint.c;h=0fbe8e2d68977f05e2f37a2dc52e00ce005c37b8;hb=HEAD
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/rv64/rvd/s_llround.c;h=f3c6275c9f9b81e9c4ce626be0d379c005eee986;hb=HEAD
...

I used libc-test on the RISC-V SiFive U74 to do the test,and there was
no error in lrint and other test items.

Thanks,
Zhang Fei

zhangfei (1):
  RISC-V: Add some mathematical functions to riscv64

 src/math/riscv64/llrint.c   | 16 ++++++++++++++++
 src/math/riscv64/llrintf.c  | 16 ++++++++++++++++
 src/math/riscv64/llround.c  | 16 ++++++++++++++++
 src/math/riscv64/llroundf.c | 16 ++++++++++++++++
 src/math/riscv64/lrint.c    | 16 ++++++++++++++++
 src/math/riscv64/lrintf.c   | 16 ++++++++++++++++
 src/math/riscv64/lround.c   | 16 ++++++++++++++++
 src/math/riscv64/lroundf.c  | 16 ++++++++++++++++
 8 files changed, 128 insertions(+)
 create mode 100644 src/math/riscv64/llrint.c
 create mode 100644 src/math/riscv64/llrintf.c
 create mode 100644 src/math/riscv64/llround.c
 create mode 100644 src/math/riscv64/llroundf.c
 create mode 100644 src/math/riscv64/lrint.c
 create mode 100644 src/math/riscv64/lrintf.c
 create mode 100644 src/math/riscv64/lround.c
 create mode 100644 src/math/riscv64/lroundf.c


             reply	other threads:[~2023-07-28  6:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28  6:19 zhangfei [this message]
2023-07-28  6:19 ` [musl] [PATCH 1/1] RISC-V: Add some mathematical functions to riscv64 zhangfei
2023-07-28 16:46   ` Khem Raj
2023-07-28 18:50   ` Rich Felker

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=20230728061955.20156-1-zhang_fei_0403@163.com \
    --to=zhang_fei_0403@163.com \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=zhangfei@nj.iscas.ac.cn \
    /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).