![]() |
|
|
#1 |
|
Oct 2007
Manchester, UK
101010010112 Posts |
Hi guys, I've tried to find this out from reading around the net but can't. Basically I have a niche use for the 80 bit extended precision data type on Intel x86 CPUs, sometimes called Long Double, but I don't know if this is included in Ryzen CPUs. I know it's an older and slower part of the core from yesteryear, but still of some use to me.
Anyway, I was hoping that someone with a Ryzen CPU might run the following C++ code and just test it out directly. ryzen_test.cpp: Code:
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
int main()
{
std::cout << "Char size: " << sizeof(char) << std::endl;
std::cout << "Short size: " << sizeof(short) << std::endl;
std::cout << "Int size: " << sizeof(int) << std::endl;
std::cout << "Long Int size: " << sizeof(long) << std::endl;
std::cout << "Long Long Int size: " << sizeof(long long) << std::endl
<< std::endl;
std::cout << "Float size: " << sizeof(float) << std::endl;
std::cout << "Double size: " << sizeof(double) << std::endl;
std::cout << "Long Double size: " << sizeof(long double) << std::endl
<< std::endl;
std::cout << "Float fraction: " << std::numeric_limits<float>::digits
<< std::endl;
std::cout << "Double fraction: " << std::numeric_limits<double>::digits
<< std::endl;
std::cout << "Long Double fraction: "
<< std::numeric_limits<long double>::digits << std::endl
<< std::endl;
std::cout << std::setprecision(20);
std::cout << std::sqrt(5.0F) << std::endl;
std::cout << std::sqrt(5.0) << std::endl;
std::cout << std::sqrt(5.0L) << std::endl << std::endl;
return 0;
}
Code:
g++ ryzen_test.cpp -march=native -o main_test && ./ryzen_test &> ryzen_test_results.txt |
|
|
|
|
|
#2 |
|
Sep 2016
22×83 Posts |
The x87 FPU instructions still exist on Ryzen. There's way too much legacy software that still uses it. So they can't get rid of it. Though it probably will get progressively slower as time goes on.
So the real question here is whether the compiler still supports generating these instructions. |
|
|
|
|
|
#3 | |
|
Oct 2007
Manchester, UK
5·271 Posts |
Quote:
The compilers still definitely support those instructions, I've tested with Intel, GCC and Clang compilers. I have wondered about the possibility of removing instructions from x86, but it honestly seems too difficult. Perhaps when mainstream computing moves to another architecture (RISC-V?) 80 bit floats will die. |
|
|
|
|
|
|
#4 | |
|
"Oliver"
Mar 2005
Germany
11×101 Posts |
Quote:
Oliver |
|
|
|
|
|
|
#5 |
|
∂2ω=0
Sep 2002
República de California
103×113 Posts |
By 'legacy x86/x87' we typically refer to the common core instruction set which predates introduction of the various SIMDs, with regard to which Intel and AMD did a great job fragmenting and mutually incompatible-izing. A small bit of inline assembly or compiler-intrinsic for parsing CPUID is handy in terms of sorting out the various features which may or may not be available on a particular x86-based CPU.
|
|
|
|
|
|
#6 |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
22×1,549 Posts |
I think the FPU code will live forever.
And I mean that the code will live and work, but not necessarily the hardware behind it. For now the hardware is still supporting it, so no problem. But in the future, if there is some good emulator code available, it might be decided to let the OS do it in software to make room for some other new killer hardware feature. |
|
|
|
|
|
#7 | |
|
Sep 2016
33210 Posts |
Quote:
So Intel is already in the process of gutting out the x87 hardware. Though whether it actually disappears at some point is harder take since the only reason to get rid of it is that it becomes a burden on the rest of the chip.
*Speaking of which, the integer multiply and the x87 fmul go into different execution ports. So it's possible to write a benchmark to determine whether "fmul" uses the same 64-bit multiplier as "mul/imul/mulx". Anyone want to volunteer to try this benchmark? |
|
|
|
|
|
|
#8 |
|
Feb 2016
UK
1B016 Posts |
x87 has been included in CPU hardware since... 486DX? Over 25 years ago... and optionally as co-pro long before that. Still I wonder how much code today depends on it that can't be done adequately with FP64. The only software I use that could fit that would be genefer. What would be the performance cost to transparently emulate it in either hardware or software (assuming OS has capability to do so)?
I also wonder why we've seemingly stuck at 64 bits for a long time. No 128-bit data size? I mean, excluding SIMD-like operations on multiple smaller sizes at once. More so in GPUs we see the ability to split FP64 units into smaller sizes, can't they go the other way? Combine two 64-bit units to perform as a single 128-bit unit? I assume I'm ignorant of some implementation cost making it undesirable for the few use cases it might be used for. On Mysticial's last question, it's way beyond my ability but sounds like something that might be in Agner Fog's architecture guide. |
|
|
|
|
|
#9 |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
22×1,549 Posts |
You'd need to convince Intel/AMD of the need for 128 bit values.
I don't imagine there are any hard problems with widening the arithmetic units. Aside from allocating some more transistors and wiring them up there isn't much to do to support it. The basics of making wider adders and multipliers is well known. But no company will do that if the usage case is only a tiny fraction of applications. |
|
|
|
|
|
#10 | |
|
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest
31×173 Posts |
Quote:
Last fiddled with by kriesel on 2019-05-30 at 15:18 |
|
|
|
|
|
|
#11 | |||
|
Sep 2016
22×83 Posts |
Quote:
At one of the conferences I went to the last year, they were talking about using 1-bit precision for DL. Quote:
Quote:
Current Intel chips seem to be very natively designed around 64-bit data widths. No execution unit can cross a 64-bit boundary except for the shuffle unit. Looking at the die-shots of Skylake, a single FMA lane is actually pretty big already. If they double it up in size, we're looking at maybe 20% of the entire core - including all the L1. And having all that silicon that's only for 128-bit FP is probably going to hurt yields as well. Last fiddled with by Mysticial on 2019-05-30 at 15:50 |
|||
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ryzen help | Prime95 | Hardware | 9 | 2018-05-14 04:06 |
| Ryzen 2 efficiency improvements | M344587487 | Hardware | 3 | 2018-04-25 15:23 |
| Help to choose components for a Ryzen rig | robert44444uk | Hardware | 50 | 2018-04-07 20:41 |
| 29.2 benchmark help #2 (Ryzen only) | Prime95 | Software | 10 | 2017-05-08 13:24 |
| AMD Ryzen is risin' up. | jasong | Hardware | 11 | 2017-03-02 19:56 |