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.

259 questions
3
votes
2 answers

x86: latency and throughput of transcendental functions

Intel® 64 and IA-32 Architectures Optimization Reference Manual lists latency and throughput figures for various CPU instructions. For transcendental functions (FSIN etc) some of the figures are listed as ranges (page C-29). Footnote 4…
NPE
  • 486,780
  • 108
  • 951
  • 1,012
3
votes
2 answers

gcc options to use i87, AVX simultaneously but nor SSE

When compiled for processor that support AVX extension (say -m64 -march=corei7-avx -mtune=corei7-avx is applicable), does it make sense to use -mfpmath=both -mavx keys at the same time? Does not it so much that it causes the compiler to use three…
Tomilov Anatoliy
  • 15,657
  • 10
  • 64
  • 169
3
votes
2 answers

How to move ST(0) to EAX?

Hullo, I am learning x86 FPU assembly, and I have got a simple question I cannot find answer for: How to move value from ST(0) ( top of the FPU stack ) to EAX ? also: is this code correct: ; multiply (dot) two vectors of 3 floats passed by pointers…
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
2
votes
1 answer

Pixel modifying code runs quick in main app, really slow in Delphi 6 DirectShow filter with other problems

I have a Delphi 6 application that sends bitmaps to a DirectShow DLL in real-time, 25 frames a second. The DirectShow DLL is my code too and is also written in Delphi 6 using the DSPACK DirectShow component suite. I have a simple block of code…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
2
votes
1 answer

Asm. How to set RC bits of CW?

How to set in control word of FPU bits in RC to 3? answer (editor's note: don't post answers as part of the question, but for now it's here) fstcw word ptr cw or word ptr cw, 110000000000b fldcw word ptr cw
Kovpaev Alexey
  • 1,725
  • 6
  • 19
  • 38
2
votes
1 answer

ARM Floating Point Operations

I have two questions regarding floating point operations regarding ARM Cortex M4, Cortex M33 and Cortex M0 core with floating point co-processor. Though optional, almost all major ARM Cortex M4 and Cortex M33 implementation generally have a FPU…
Dark Sorrow
  • 1,681
  • 14
  • 37
2
votes
1 answer

GCC [for ARM] force no floating point

I would like to create a build of my embedded C code which specifically checks that floating point operations aren't introduced into it by accident. I've tried adding +nofp to my [cortex-m3] processor architecture but GCC for ARM doesn't like that…
Rob
  • 865
  • 1
  • 8
  • 21
2
votes
1 answer

Floating Point Multiply Bug Using gcc 2.7.0 on Amiga with 68881 - Any Fixes/Workarounds?

For the heck of it, I decided to see if a program I started writing on an Amiga many years ago and much further developed on other machines would still compile and run on an Amiga (after being developed on other machines). I originally used Lattice…
lasermc
  • 55
  • 7
2
votes
1 answer

Why am I getting nonsensical numbers when performing operations with the FPU x87 instruction set in MASM Assembly?

I've started learning assembly recently, and I'm now learning about the FPU x86 architecture and the FPU stack. I have two simple functions for converting between Celsius and Fahrenheit and vice versa. I've looked into various different…
Matt Jones
  • 61
  • 1
  • 10
2
votes
2 answers

What is the relation between AVX and Floating Point, and why is AVX used for FP calculations?

I was studying about FP and AVX recently and on Wikipedia (https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Applications) I read that AVX is used for FP calculations. I can't figure out why an parallel environment FP are processes. Also…
2
votes
1 answer

Achieving identical floating point calculation result on different platforms/compilers?

Different platforms have varying FP capabilities with varying parameters and behaviors, as a result there is a degree of variance between the calculation results they produce, which cascade and amplify on each intermediate step. I am in a situation…
dtech
  • 47,916
  • 17
  • 112
  • 190
2
votes
1 answer

Throughput FMA and multiplication on X86 Broadwell

I am suspecting last Intel architecture to perform the mnemonic MUL like a FMA but with a null addition (on broadWell architecture). In details, I am currently performing product of Quatric polynomials (Pi), following the pattern. P1*P2*P3*P4…
Timocafé
  • 765
  • 6
  • 18
2
votes
1 answer

Storing the x87 FPU Control Word

I'm making a function which returns the FPU Control Word register (16bit). According to documentation, I have to use fstcw and a memory place. My place in memory is: fpuctl: .word 0 And my function is: .global getFPUControlState .type…
Fenrir
  • 151
  • 2
  • 14
2
votes
0 answers

Extended assembly, floating point division

I'm trying to use extended assembly to divide an array of 32bit floats located in a 4float vector structure. This is the compiler error: sisd.c: In function ‘divSISD’: sisd.c:182:9: error: ‘asm’ operand has impossible constraints asm( …
2
votes
1 answer

Floating Point Unit - Open Source Hardware Implementation

Boy, do these guys at StackOverflow really make you think before even trying to ask a question here - having a real stage fright writing this first question. I will provide some resources I found during my search, but let me first elaborate on the…
apaj
  • 191
  • 11