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
0
votes
1 answer

Dividing longfloat and int in Assembly x86-64

I have a program where i loop for as long as the user enters Y (for yes). The user then inputs data of type long float. I also have a counter, r14, which will count each time they input a long float. After the loop ends, i wish to calculate the…
vap
  • 95
  • 1
  • 1
  • 7
0
votes
0 answers

tasm code fpu floating point unit

.MODEL SMALL .STACK 100h ASSUME CX:_TEXT, DS:_DATA _DATA SEGMENT DWORD PUBLIC 'DATA' xparr db 10 dup (?) TOW DB 2 CHECKER DB 2 XP DB 1 N DB (?) _DATA ENDS .CODE .386 .387 PUBLIC _XPN _XPN PROC NEAR PUSH BP MOV BP,SP MOV…
Deeb Andrawis
  • 13
  • 2
  • 7
0
votes
1 answer

FPU stores nan with fld

I'm writing a DOS program in assembly: I'm trying to draw the Mandelbrot set. I'm now trying to translate this piece of C code in assembly: double x0 = i * 3.2 / maxX - 2.1; //scaled x coordinate of pixel (-2.1, 1.1) I've translated it…
user1527576
  • 294
  • 3
  • 14
0
votes
2 answers

Implementing math.h functions in assembler

I have used gdb to step through the assembler code that implement the standard C sin() function in the standard C math library (-lm -march=pentium3 -mfpmath=387). There is a lot of stub there and I don't know why they have not simply inlined the…
Freeman
  • 5,810
  • 3
  • 47
  • 48
0
votes
1 answer

Assembly stack access

.data oldcw: .int clear: .long 0xF0FF round: .long 0x0D00 fstcw oldcw fwait mov oldcw,%ax and %ax,clear or %ax,round pushl %eax fldcw [%esp] popl %eax I get an error about the brackets. invalid char…
Ali U.
  • 119
  • 1
  • 1
  • 5
0
votes
0 answers

Active FPU Exceptions

all fine? Guys, would like to exchange an idea with yours. In my company, a colleague has a problem in your delphi where only on a project the exceptions of "Floating point divide by zero" are not showing up. I checked everywhere I know where that…
Delphiman
  • 373
  • 4
  • 15
0
votes
1 answer

Compute logarithm ln(x) using FPU assembly

I have a problem with simple logarithm computation using FPU. I am using MASM compiler integrated with Visual Studio 2012. LOCAL log_e_120 : REAL8; MOV eax, 120 MOVD mm0, eax MOVQ log_e_120, mm0 FINIT FLDLN2 ; load…
Athlan
  • 6,389
  • 4
  • 38
  • 56
0
votes
2 answers

fpu state (x87)

I am searching for info about how many values can be considered as part of current fpu state (I mean the values on which floating point code calculations depend on) I know that it would be 3 modes of precission, 4 modes of rounding, about 5 bit…
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
0
votes
1 answer

how to reverse divide 1/f on fpu?

Sorry for such simple question, (learning assembly from few days) but i was browsing through books and couldnt find answer what is a proper quick way to count 1/f where f is some float on x86 fpu is it fld dword [ebp+8] fld1 fdivrp …
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
0
votes
2 answers

some intersectRaySphere c procedure optymization through rewriting it to x86 asm (How?)

Hullo, I've got not to much knowledge in assembly, and i am thinking how to optimize it by rewriting this in x86 (32-bit fpu or sse2) assembly, thing should be optimized - rewritten in correct assembly, then I will test if I've got some speed up…
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
0
votes
1 answer

Debugger stops inside mathematical functions that have floating point arguments

I'm using Keil uVision with gcc compiler (Sourcery Codebenchlite for ARM EABI ) to program the STM32F4 cortex M4 chip. The compiler control strings I have set are: -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -std=gnu99…
soonhooi
  • 1
  • 2
-1
votes
1 answer

Which formalism / theorem prover was used to formally verify ARM VFP?

Background: I do believe that ARM VFP was formally verified. Is that correct? A simple question: which formalism / theorem prover was used to formally verify ARM VFP? Extra: where is to find more details about ARM VFP formal verification?
pmor
  • 5,392
  • 4
  • 17
  • 36
-1
votes
1 answer

Is there a macro to know if an architecture has an FPU in C/C++?

I'm writing a project in C++ using GCC. Is there a macro, preferably a standard one, that can tell me whether or not the architecture I am compiling to has an FPU?
Adel M.
  • 317
  • 1
  • 9
-1
votes
1 answer

Why is a FPU reset required to prevent a NaN result propagating to next calculation result?

I have a floating point calculation that results in -1.#IND0000 causing a -1.#IND0000 in the subsequent floating point calculation. What would cause this? The compiler is Visual Studio C++ 2013 18.00 x86. If I use GCC Version 7.4.0 the problem does…
electronpygmy
  • 51
  • 1
  • 5
-1
votes
2 answers

Emulating a 386

I'm applying for a contest that challenges people to write a program for a classical computer. I will apply with a PC/MS-DOS entry. The rules permit using a CPU up to a 386. I'm been investigating a little and I've found that the most powerful 386…
davidcm
  • 165
  • 3
  • 11
1 2 3
17
18