Skip to content

Commit

Permalink
Fix softfloat integration build failure on macOS/Arm64
Browse files Browse the repository at this point in the history
Addressed compilation errors on macOS/Arm64 arising from conflicts
between SoftFloat and SDL headers. The solution involves explicitly
defining the conflicting types in SoftFloat to avoid clashes.
  • Loading branch information
visitorckw committed Nov 16, 2023
1 parent f237cec commit 129aca2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/riscv.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
#include <stdbool.h>
#include <stdint.h>
#if RV32_HAS(EXT_F)
#define float16_t softfloat_float16_t
#define bfloat16_t softfloat_bfloat16_t
#define float32_t softfloat_float32_t
#define float64_t softfloat_float64_t
#include "softfloat/softfloat.h"
#undef float16_t

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 20.5 rule Note

MISRA 20.5 rule
#undef bfloat16_t

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 20.5 rule Note

MISRA 20.5 rule
#undef float32_t

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 20.5 rule Note

MISRA 20.5 rule
#undef float64_t

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 20.5 rule Note

MISRA 20.5 rule
#endif

#ifdef __cplusplus
Expand Down Expand Up @@ -93,7 +101,7 @@ typedef uint16_t riscv_half_t;
typedef uint8_t riscv_byte_t;
typedef uint32_t riscv_exception_t;
#if RV32_HAS(EXT_F)
typedef float32_t riscv_float_t;
typedef softfloat_float32_t riscv_float_t;
#endif

/* memory read handlers */
Expand Down

1 comment on commit 129aca2

@jserv
Copy link
Contributor

@jserv jserv commented on 129aca2 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Benchmark suite Current: 129aca2 Previous: 42c10f6 Ratio
Dhrystone 1723.77 Average DMIPS over 10 runs 1577.12 Average DMIPS over 10 runs 0.91
Coremark 1447.526 Average iterations/sec over 10 runs 1435.919 Average iterations/sec over 10 runs 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.