From 2047d6eb7a88a1a28ebc6753a22f4b4e9e96c885 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Thu, 25 Apr 2024 12:33:03 +0300 Subject: [PATCH] remove fpu/softfloat16.h --- bochs/cpu/Makefile.in | 5 ++-- bochs/cpu/avx/Makefile.in | 15 +++++----- bochs/cpu/avx/avx512_cvt16.cc | 1 - bochs/cpu/avx/avx512_pfp16.cc | 1 - bochs/cpu/decoder/fetchdecode32.cc | 1 - bochs/cpu/fpu/softfloat16.h | 45 ------------------------------ bochs/cpu/simd_pfp.h | 8 +++++- 7 files changed, 16 insertions(+), 60 deletions(-) delete mode 100644 bochs/cpu/fpu/softfloat16.h diff --git a/bochs/cpu/Makefile.in b/bochs/cpu/Makefile.in index bd4c9e6a3..d7206b198 100644 --- a/bochs/cpu/Makefile.in +++ b/bochs/cpu/Makefile.in @@ -758,7 +758,7 @@ sse_pfp.o: sse_pfp.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../logio.h \ softfloat3e/include/softfloat-compare.h softfloat3e/include/softfloat.h \ softfloat3e/include/softfloat_types.h \ softfloat3e/include/softfloat-extra.h softfloat3e/include/internals.h \ - simd_pfp.h fpu/softfloat16.h simd_int.h + simd_pfp.h simd_int.h sse_rcp.o: sse_rcp.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../logio.h \ ../misc/bswap.h cpu.h ../bx_debug/debug.h ../config.h ../osdep.h \ ../cpu/decoder/decoder.h ../cpu/decoder/features.h decoder/decoder.h \ @@ -922,8 +922,7 @@ fetchdecode32.o: decoder/fetchdecode32.@CPP_SUFFIX@ ../bochs.h ../config.h \ decoder/fetchdecode_opmap_0f38.h decoder/fetchdecode_opmap_0f3a.h \ decoder/fetchdecode_x87.h decoder/fetchdecode_avx.h \ decoder/fetchdecode_xop.h decoder/fetchdecode_evex.h ../cpu/simd_int.h \ - ../cpu/fpu/softfloat16.h ../cpu/simd_pfp.h \ - ../cpu/simd_compare.h ../cpu/simd_vnni.h + ../cpu/simd_pfp.h ../cpu/simd_compare.h ../cpu/simd_vnni.h fetchdecode64.o: decoder/fetchdecode64.@CPP_SUFFIX@ ../bochs.h ../config.h \ ../osdep.h ../logio.h ../misc/bswap.h decoder/instr.h decoder/decoder.h \ decoder/features.h decoder/fetchdecode.h decoder/ia_opcodes.h \ diff --git a/bochs/cpu/avx/Makefile.in b/bochs/cpu/avx/Makefile.in index c26002f36..633ca946f 100644 --- a/bochs/cpu/avx/Makefile.in +++ b/bochs/cpu/avx/Makefile.in @@ -192,7 +192,7 @@ avx512_cvt16.o: avx512_cvt16.@CPP_SUFFIX@ ../../bochs.h ../../config.h \ ../softfloat3e/include/softfloat.h \ ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ - ../softfloat3e/include/internals.h ../simd_int.h ../fpu/softfloat16.h + ../softfloat3e/include/internals.h ../simd_int.h avx512_fma.o: avx512_fma.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h \ ../../logio.h ../../misc/bswap.h ../cpu.h ../../bx_debug/debug.h \ ../../config.h ../../osdep.h ../../cpu/decoder/decoder.h \ @@ -205,8 +205,7 @@ avx512_fma.o: avx512_fma.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h ../softfloat3e/include/softfloat.h \ ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ - ../softfloat3e/include/internals.h ../simd_int.h ../simd_pfp.h \ - ../fpu/softfloat16.h + ../softfloat3e/include/internals.h ../simd_int.h ../simd_pfp.h avx512_helpers.o: avx512_helpers.@CPP_SUFFIX@ ../../bochs.h ../../config.h \ ../../osdep.h ../../logio.h ../../misc/bswap.h ../cpu.h \ ../../bx_debug/debug.h ../../config.h ../../osdep.h \ @@ -275,7 +274,7 @@ avx512_pfp.o: avx512_pfp.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ ../softfloat3e/include/internals.h ../simd_int.h ../simd_pfp.h \ - ../fpu/softfloat16.h ../fpu/softfloat-specialize.h \ + ../fpu/softfloat-specialize.h \ ../fpu/../softfloat3e/include/softfloat_types.h avx512_pfp16.o: avx512_pfp16.@CPP_SUFFIX@ ../../bochs.h ../../config.h \ ../../osdep.h ../../logio.h ../../misc/bswap.h ../cpu.h \ @@ -290,8 +289,8 @@ avx512_pfp16.o: avx512_pfp16.@CPP_SUFFIX@ ../../bochs.h ../../config.h \ ../softfloat3e/include/softfloat.h \ ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ - ../softfloat3e/include/internals.h ../fpu/softfloat16.h ../simd_int.h \ - ../simd_pfp.h ../fpu/softfloat16.h ../fpu/softfloat-specialize.h \ + ../softfloat3e/include/internals.h ../simd_int.h \ + ../simd_pfp.h ../fpu/softfloat-specialize.h \ ../fpu/../softfloat3e/include/softfloat_types.h \ ../../cpu/decoder/ia_opcodes.h ../../cpu/decoder/ia_opcodes.def avx512_rcp14.o: avx512_rcp14.@CPP_SUFFIX@ ../../bochs.h ../../config.h \ @@ -347,7 +346,7 @@ avx_fma.o: avx_fma.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h \ ../softfloat3e/include/softfloat.h \ ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ - ../softfloat3e/include/internals.h ../simd_pfp.h ../fpu/softfloat16.h + ../softfloat3e/include/internals.h ../simd_pfp.h avx_ifma52.o: avx_ifma52.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h \ ../../logio.h ../../misc/bswap.h ../cpu.h ../../bx_debug/debug.h \ ../../config.h ../../osdep.h ../../cpu/decoder/decoder.h \ @@ -383,7 +382,7 @@ avx_pfp.o: avx_pfp.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h \ ../softfloat3e/include/softfloat.h \ ../softfloat3e/include/softfloat_types.h \ ../softfloat3e/include/softfloat-extra.h \ - ../softfloat3e/include/internals.h ../simd_pfp.h ../fpu/softfloat16.h \ + ../softfloat3e/include/internals.h ../simd_pfp.h \ ../simd_int.h gather.o: gather.@CPP_SUFFIX@ ../../bochs.h ../../config.h ../../osdep.h \ ../../logio.h ../../misc/bswap.h ../cpu.h ../../bx_debug/debug.h \ diff --git a/bochs/cpu/avx/avx512_cvt16.cc b/bochs/cpu/avx/avx512_cvt16.cc index cfbb6375a..e76936d57 100644 --- a/bochs/cpu/avx/avx512_cvt16.cc +++ b/bochs/cpu/avx/avx512_cvt16.cc @@ -32,7 +32,6 @@ extern softfloat_status_t mxcsr_to_softfloat_status_word(bx_mxcsr_t mxcsr); #include "softfloat3e/include/softfloat.h" #include "simd_int.h" -#include "fpu/softfloat16.h" // scalar diff --git a/bochs/cpu/avx/avx512_pfp16.cc b/bochs/cpu/avx/avx512_pfp16.cc index ba406af76..f1bcb1301 100644 --- a/bochs/cpu/avx/avx512_pfp16.cc +++ b/bochs/cpu/avx/avx512_pfp16.cc @@ -32,7 +32,6 @@ extern softfloat_status_t mxcsr_to_softfloat_status_word(bx_mxcsr_t mxcsr); extern void mxcsr_to_softfloat_status_word_imm_override(softfloat_status_t &status, Bit8u immb); #include "softfloat3e/include/softfloat-compare.h" -#include "fpu/softfloat16.h" #include "simd_int.h" #include "simd_pfp.h" diff --git a/bochs/cpu/decoder/fetchdecode32.cc b/bochs/cpu/decoder/fetchdecode32.cc index d0a4c8192..6070755c1 100644 --- a/bochs/cpu/decoder/fetchdecode32.cc +++ b/bochs/cpu/decoder/fetchdecode32.cc @@ -79,7 +79,6 @@ struct BxOpcodeDecodeDescriptor32 { #ifndef BX_STANDALONE_DECODER #include "cpu/simd_int.h" #include "cpu/softfloat3e/include/softfloat.h" -#include "cpu/fpu/softfloat16.h" #include "cpu/simd_pfp.h" #include "cpu/simd_compare.h" #include "cpu/simd_vnni.h" diff --git a/bochs/cpu/fpu/softfloat16.h b/bochs/cpu/fpu/softfloat16.h deleted file mode 100644 index 07ad25ea5..000000000 --- a/bochs/cpu/fpu/softfloat16.h +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================ -This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic -Package, Release 2b. - -Written by John R. Hauser. This work was made possible in part by the -International Computer Science Institute, located at Suite 600, 1947 Center -Street, Berkeley, California 94704. Funding was partially provided by the -National Science Foundation under grant MIP-9311980. The original version -of this code was written as part of a project to build a fixed-point vector -processor in collaboration with the University of California at Berkeley, -overseen by Profs. Nelson Morgan and John Wawrzynek. More information -is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ -arithmetic/SoftFloat.html'. - -THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has -been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES -RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS -AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, -COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE -EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE -INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR -OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. - -Derivative works are acceptable, even for commercial purposes, so long as -(1) the source code for the derivative work includes prominent notice that -the work is derivative, and (2) the source code includes prominent notice with -these four paragraphs for those parts of this code that are retained. -=============================================================================*/ - -/*============================================================================ - * Adapted for Bochs (x86 achitecture simulator) by - * Stanislav Shwartsman [sshwarts at sourceforge net] - * ==========================================================================*/ - -#ifndef _SOFTFLOAT_F16_HELPERS_H_ -#define _SOFTFLOAT_F16_HELPERS_H_ - -extern float32 convert_ne_fp16_to_fp32(float16 op); - -BX_CPP_INLINE float16 f16_scalef(float16 a, float16 b, softfloat_status_t *status) -{ - return f32_to_f16(f32_scalef(convert_ne_fp16_to_fp32(a), convert_ne_fp16_to_fp32(b), status), status); -} - -#endif diff --git a/bochs/cpu/simd_pfp.h b/bochs/cpu/simd_pfp.h index 0817890f6..8f702e757 100644 --- a/bochs/cpu/simd_pfp.h +++ b/bochs/cpu/simd_pfp.h @@ -964,7 +964,13 @@ BX_CPP_INLINE void xmm_scalefpd_mask(BxPackedXmmRegister *op1, const BxPackedXmm } } -#include "fpu/softfloat16.h" +// FIXME, f16_scalef should be implemented in softfloat3e +extern float32 convert_ne_fp16_to_fp32(float16 op); + +BX_CPP_INLINE float16 f16_scalef(float16 a, float16 b, softfloat_status_t *status) +{ + return f32_to_f16(f32_scalef(convert_ne_fp16_to_fp32(a), convert_ne_fp16_to_fp32(b), status), status); +} BX_CPP_INLINE void xmm_scalefph(BxPackedXmmRegister *op1, const BxPackedXmmRegister *op2, softfloat_status_t &status) {