You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/09 06:10:48 UTC

[GitHub] [nuttx] zyfeier commented on a diff in pull request #8042: Libc: Add more libc function for arm and riscv

zyfeier commented on code in PR #8042:
URL: https://github.com/apache/nuttx/pull/8042#discussion_r1064306399


##########
libs/libc/machine/risc-v/gnu/asm.h:
##########
@@ -0,0 +1,52 @@
+/****************************************************************************
+ * libs/libc/machine/risc-v/gnu/asm.h
+ *
+ * Copyright (c) 2017  SiFive Inc. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the FreeBSD License.   This program is distributed in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
+ * including the implied warranties of MERCHANTABILITY or FITNESS FOR
+ * A PARTICULAR PURPOSE.  A copy of this license is available at
+ *  http://www.opensource.org/licenses.
+ ****************************************************************************/
+
+#ifndef _ASM_H
+#define _ASM_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifdef CONFIG_ARCH_RV64
+#  define SZREG  8
+#  define REG_S sd
+#  define REG_L ld
+#elif defined(CONFIG_ARCH_RV32)
+#  define SZREG  4
+#  define REG_S sw
+#  define REG_L lw
+#endif
+
+#ifdef CONFIG_ARCH_QPFPU
+#  define SZFREG  16
+#  define FREG_S fsq
+#  define FREG_L flq
+#elif defined(CONFIG_ARCH_DPFPU)
+#  define SZFREG   8
+#  define FREG_S fsd
+#  define FREG_L fld
+#elif defined(CONFIG_ARCH_FPU)

Review Comment:
   These macros are only effective if fpu is supported.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org