simd-everywhere / simde

Implementations of SIMD instruction sets for systems which don't natively support them.
https://simd-everywhere.github.io/blog/
MIT License
2.26k stars 235 forks source link

x87 functions #1161

Open Torinde opened 3 months ago

Torinde commented 3 months ago

x87 (instructions list: current, obsolete Intel/IIT/Cyrix, obsolete NEC: part1, part2)

CPU flag in Linux is fpu.

x87 Non-Waiting FPU Control Instructions

x87 Floating-point Load/Store/Move Instructions

x87 Integer Load/Store Instructions

x87 Basic Arithmetic Instructions

x87 Basic Arithmetic Instructions with Stack Pop

x87 Basic Arithmetic Instructions with Integer Source Argument

x87 Additional Arithmetic Instructions

x87 Transcendental Instructions

Other x87 Instructions

x87 Non-Waiting Control Instructions added in 80287

x87 Instructions added in 80387

x87 Instructions added in Pentium Pro

x87 Non-Waiting Instructions added in Pentium II, AMD K7 and SSE

x87 Instructions added as part of SSE3

x87 Instructions present in specific 80387 models

x87 Instructions present in NEC μPD72091

x87 Instructions present in NEC μPD72191/D9008D

mr-c commented 3 months ago

@Torinde Do you know of any header files for these functions?

Torinde commented 3 months ago

Do you know of any header files for these functions?

No. @kklobe, do you know a header file for x87 functions?

kklobe commented 3 months ago

Do you know of any header files for these functions?

No. @kklobe, do you know a header file for x87 functions?

I'm not aware of any. I think a header file for these functions would be a tall order, especially on non-x86 platforms to perform the 80-bit extended precision calculations.

Torinde commented 3 months ago

Isn't that taken care of by SoftFloat (and the projects using it - see links at the first bullet in OP)?

The latest release of SoftFloat implements five floating-point formats: 16-bit half-precision, 32-bit single-precision, 64-bit double-precision, 80-bit double-extended-precision, and 128-bit quadruple-precision. All required rounding modes, exception flags, and special values are supported. Fused multiply-add is also implemented for all formats except 80-bit double-extended-precision. Target-specific code is provided for various Intel x86 and ARM processors.

kklobe commented 3 months ago

Isn't that taken care of by SoftFloat (and the projects using it - see links at the first bullet in OP)?

The latest release of SoftFloat implements five floating-point formats: 16-bit half-precision, 32-bit single-precision, 64-bit double-precision, 80-bit double-extended-precision, and 128-bit quadruple-precision. All required rounding modes, exception flags, and special values are supported. Fused multiply-add is also implemented for all formats except 80-bit double-extended-precision. Target-specific code is provided for various Intel x86 and ARM processors.

That strikes me as quite outside the scope of this project. The x87 instructions aren't really SIMD, and would require adding something like SoftFloat as a dependency, so now you no longer have a header-only solution to translate from SIMD instruction set to SIMD instruction set.

If I'm misunderstanding your suggestion, let me know.

Torinde commented 3 months ago

I thought parts of SoftFloat can be useful for the creation of a header file.

Torinde commented 1 week ago

xbyak:

a JIT assembler for x86(IA-32)/x64(AMD64, x86-64) MMX/SSE/SSE2/SSE3/SSSE3/SSE4/FPU/AVX/AVX2/AVX-512 by C++ header

Will that be useful?

mr-c commented 1 week ago

xbyak:

a JIT assembler for x86(IA-32)/x64(AMD64, x86-64) MMX/SSE/SSE2/SSE3/SSSE3/SSE4/FPU/AVX/AVX2/AVX-512 by C++ header

Will that be useful?

I won't speak for others, but that sounds too big to be apart of this project. However it could be a companion project to SIMDe, managed here in this GitHub organization or elsewhere. Code sharing is welcome, of course

Torinde commented 1 day ago

that sounds too big

Sorry, I meant to pick only the x87/FPU part from it (not everything), e.g. as answer to:

Do you know of any header files for these functions?