Questions tagged [fpu]

A floating-point unit is a part of a computer system specially designed to carry out operations on floating point numbers.

From Wikipedia:

A floating-point unit (FPU, colloquially a math coprocessor) is a part of a computer system specially designed to carry out operations on floating point numbers. Typical operations are addition, subtraction, multiplication, division, and square root. Some systems (particularly older, microcode-based architectures) can also perform various transcendental functions such as exponential or trigonometric calculations, though in most modern processors these are done with software library routines.

234 questions
27
votes
5 answers

Benefits of x87 over SSE

I know that x87 has higher internal precision, which is probably the biggest difference that people see between it and SSE operations. But I have to wonder, is there any other benefit to using x87? I have a habit of typing -mfpmath=sse…
Tom
  • 10,273
  • 3
  • 39
  • 49
11
votes
2 answers

Why an application starts with FPU Control Word different than Default8087CW?

Could you please help me to understand what is going on with FPU Control Word in my Delphi application, on Win32 platform. When we create a new VCL application, the control word is set up to 1372h. This is the first thing I don't understand, why it…
Wodzu
  • 6,705
  • 8
  • 57
  • 99
10
votes
2 answers

Third party code is modifying the FPU control word

The introduction - the long and boring part (The question is at the end) I am getting severe head aches over a third party COM component that keeps changing the FPU control word. My development environment is Windows and Visual C++ 2008. The normal…
Jörgen Sigvardsson
  • 4,626
  • 2
  • 24
  • 50
10
votes
1 answer

Can the x86 do FPU operations independently or in parallel?

My teacher claims that the processor can sometimes do FPU operations in parallel. Like this: float a = 3.14; float b = 5.12; float c; float d = 3.02; float e = 2.52; float f; c = a + b; f = e + d; So, as I've heard, the 2 add operations above would…
minecraftplayer1234
  • 1,697
  • 3
  • 17
  • 47
9
votes
1 answer

Scope of MXCSR control register?

I'm wondering what is the lifetime of the value stored in the MXCSR control register (including FTZ and DAZ config for denormal floating-point numbers): is it in the scope of the thread, or is it common for all processing on the CPU/FPU? What I want…
moala
  • 4,580
  • 6
  • 41
  • 64
9
votes
4 answers

Free the x87 FPU Stack (ia32)

At my university we were just introduced to IA32 x87 FPU. But we weren't informed how to clear the FPU-Stack of no longer demanded elements. Imagine we're performing a simple calculation like (5.6 * 2.4) + (3.9 * 10.3). .data value1: .float…
tmuecksch
  • 5,045
  • 3
  • 33
  • 55
7
votes
2 answers

Detecting FPU presence on Android

I want to get the most performance of my mobile application on Android. I would like to know if someone is aware of a trick to check if the phone possesses an FPU. After some research it seems that using FloatMath class is slower on a unit that…
gimpycpu
  • 607
  • 6
  • 16
7
votes
2 answers

Newbie problem with gcc 4.2 compiler (Mac OSX): fpu_control.h: No such file or directory

I am trying to compile a program in c/c++, but am getting the error message: fpu_control.h: No such file or directory From google, I have found out that this problem is about the way floating point precision is handled. I read that not all…
Ant
  • 669
  • 1
  • 9
  • 22
7
votes
2 answers

What algorithms do FPUs use to compute transcendental functions?

What methods would a modern FPU use to compute transcendental functions? For example, Intel CPUs provide instructions such as FSIN, FCOS, FYL2X, etc. I am curious as to what algorithms would be used to actually implement these in hardware. My naïve…
NPE
  • 438,426
  • 93
  • 887
  • 970
6
votes
1 answer

VPU vs FPU vs GPU vs ALU

I want to better understand the difference between Vector Processing Graphics (VPU), Floating Point Unit, Graphics Processing Unit and Arithmetic and Logic Unit. I understand that inside a CPU there's a FPU and a ALU, but is that also true for…
testin3r
  • 107
  • 1
  • 9
6
votes
3 answers

C/C++ NaN or boolean?

I have to keep one double value cached. After it is used, it should be invalidated. Two alternatives One is to add boolean flag, true when cached value is good, when it is used set it to false, and when flag is false, recalculate and refill. Second…
Severin Pappadeux
  • 15,291
  • 3
  • 27
  • 51
6
votes
2 answers

Delphi 64 bits asm compiling error

The following functions do not compile with the 64 bits Delphi XE2 compiler. (The errors all relate to the fld instructions.) [dcc64 Error] Project1.dpr(12): E2116 Invalid combination of opcode and operands [dcc64 Error] Project1.dpr(13): E2116…
user1238784
  • 1,682
  • 3
  • 18
  • 31
6
votes
1 answer

Performance comparison of FPU with software emulation

While I know (so I have been told) that Floating-point coprocessors work faster than any software implementation of floating-point arithmetic, I totally lack the gut feeling how large this difference is, in order of magnitudes. The answer probably…
shuhalo
  • 4,851
  • 6
  • 37
  • 53
5
votes
2 answers

Does decimal math use the FPU

Does decimal math use the FPU? I would think that the answer is yes, but I'm not sure, since a decimal is not a floating point, but a fixed precision number. I'm looking mostly for .NET, but a general answer would be useful too.
CodeMonkey1313
  • 14,477
  • 17
  • 71
  • 109
5
votes
2 answers

FPU operations generated by GCC during casting integer to float

I want to perform division on an FPU in C (using integer values): float foo; uint32_t *ptr1, *ptr2; foo = (float)*(ptr1) / (float)*(ptr2); And in NASM (from object compiled via GCC) it has following representation: mov rax, QWORD [ptr1] …
saleph
  • 149
  • 10
1
2 3
15 16