From fc4e527110736174e2da94ee5073c70512e1b3ee Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 27 Oct 2018 04:41:53 +0100 Subject: [PATCH] add f32 redirects in sv_proc_t --- riscv/sv_insn_redirect.cc | 70 ++++++++++++++++++++++++++++++++++++++- riscv/sv_insn_redirect.h | 14 ++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/riscv/sv_insn_redirect.cc b/riscv/sv_insn_redirect.cc index 4db6ca6..4d34c03 100644 --- a/riscv/sv_insn_redirect.cc +++ b/riscv/sv_insn_redirect.cc @@ -697,13 +697,13 @@ sv_reg_t (sv_proc_t::mulhu)(sv_reg_t const& a, sv_reg_t const& b) return sv_reg_t(::mulhu(a, b)); } +// -------- float64_t (sv_proc_t::f64_add)( float64_t a, float64_t b ) { return ::f64_add(a, b); } - float64_t (sv_proc_t::f64_sub)( float64_t a, float64_t b ) { return ::f64_sub(a, b); @@ -765,3 +765,71 @@ bool (sv_proc_t::f64_lt_quiet)( float64_t a, float64_t b ) } +// -------- + +float32_t (sv_proc_t::f32_add)( float32_t a, float32_t b ) +{ + return ::f32_add(a, b); +} + +float32_t (sv_proc_t::f32_sub)( float32_t a, float32_t b ) +{ + return ::f32_sub(a, b); +} + +float32_t (sv_proc_t::f32_mul)( float32_t a, float32_t b ) +{ + return ::f32_mul(a, b); +} + +float32_t (sv_proc_t::f32_mulAdd)( float32_t a, float32_t b , float32_t c) +{ + return ::f32_mulAdd(a, b, c); +} + +float32_t (sv_proc_t::f32_div)( float32_t a, float32_t b ) +{ + return ::f32_div(a, b); +} + +float32_t (sv_proc_t::f32_rem)( float32_t a, float32_t b ) +{ + return ::f32_rem(a, b); +} + +float32_t (sv_proc_t::f32_sqrt)( float32_t a ) +{ + return ::f32_sqrt(a); +} + +bool (sv_proc_t::f32_eq)( float32_t a, float32_t b ) +{ + return ::f32_eq(a, b); +} + +bool (sv_proc_t::f32_le)( float32_t a, float32_t b ) +{ + return ::f32_le(a, b); +} + +bool (sv_proc_t::f32_lt)( float32_t a, float32_t b ) +{ + return ::f32_lt(a, b); +} + +bool (sv_proc_t::f32_eq_signaling)( float32_t a, float32_t b ) +{ + return ::f32_eq_signaling(a, b); +} + +bool (sv_proc_t::f32_le_quiet)( float32_t a, float32_t b ) +{ + return ::f32_le_quiet(a, b); +} + +bool (sv_proc_t::f32_lt_quiet)( float32_t a, float32_t b ) +{ + return ::f32_lt_quiet(a, b); +} + + diff --git a/riscv/sv_insn_redirect.h b/riscv/sv_insn_redirect.h index 6df0e00..24d5163 100644 --- a/riscv/sv_insn_redirect.h +++ b/riscv/sv_insn_redirect.h @@ -226,6 +226,20 @@ public: bool f64_le_quiet( float64_t, float64_t ); bool f64_lt_quiet( float64_t, float64_t ); + float32_t f32_add( float32_t, float32_t ); + float32_t f32_sub( float32_t, float32_t ); + float32_t f32_mul( float32_t, float32_t ); + float32_t f32_mulAdd( float32_t, float32_t, float32_t ); + float32_t f32_div( float32_t, float32_t ); + float32_t f32_rem( float32_t, float32_t ); + float32_t f32_sqrt( float32_t ); + bool f32_eq( float32_t, float32_t ); + bool f32_le( float32_t, float32_t ); + bool f32_lt( float32_t, float32_t ); + bool f32_eq_signaling( float32_t, float32_t ); + bool f32_le_quiet( float32_t, float32_t ); + bool f32_lt_quiet( float32_t, float32_t ); + #include "sv_insn_decl.h" -- 2.30.2