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

nasm infinite loop with FPU

i'm trying to create a small nasm program which do this operation in floating point while(input <= 10^5) do begin input = input * 10 i = i - 1 end the equivilant program in nasm is as following section .data input: resd 1 n10: dd…
Ben Ishak
  • 629
  • 1
  • 10
  • 26
0
votes
0 answers

Why does dllMain overrides the control-word of my FPU?

I've seen here and here that dllMain changes the control-word of my FPU, and I need to: _control87(_CW_DEFAULT, _CW_DEFAULT); so it will return to normal. But no one states why it is done. Does anyone know why does my dllMain do that? On what…
speller
  • 1,290
  • 2
  • 13
  • 24
0
votes
0 answers

Compiling with FPU on ARM board

I am using mini6410 ARM 1176 board to run image processing application using OpenCV. I am using ARM toolchain 4.5.1 as supplied by the manufacturer of the board with certain options that may be of interest in this case: --with-cpu=arm1176jzf-s…
bonchenko
  • 547
  • 1
  • 9
  • 21
0
votes
2 answers

FLD floating-point instruction

According to http://cs.smith.edu/~thiebaut/ArtOfAssembly/CH14/CH14-4.html#HEADING4-5 14.4.4.1 The FLD Instruction fld mem_32 fld mem_64[bx] My objective is store a constant 10 into my fPU stack. Why I cant do this? __asm { move bx,…
user2306421
  • 73
  • 1
  • 2
  • 9
0
votes
1 answer

masm assembly how to divide and multiply numbers using the fpu

I am new to masm and assembly and need some help. I have spent probably 6 hours on this already. I have 3 text boxes and 2 buttons. I want one of the buttons to multiply the numbers in the text boxes and show the result in the third text box, and…
tandpcat
  • 7
  • 5
0
votes
0 answers

How to optimize an FPU routine

I have got some c-routine int n_mandelbrot(double c_im, double c_re, int N_ITER) { static double re, im, re2, im2; static int n; im2=im=0; re2=re=0; for(n=0; n
grunge fightr
  • 1,288
  • 1
  • 16
  • 34
0
votes
1 answer

_controlfp_s returning the high 32 bit?

I am seeing the return of the _controlfp_s unsigned int showing that the 32nd bit is being set (thought only 16 bits used) for some ODBC work? Anybody any ideas what this means? Normally we only see either 0x0008001F (64 bit) or 0x0009001F (32 bit)…
Skyline
  • 83
  • 1
  • 6
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
  • 6
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
  • 6
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
  • 252
  • 3
  • 9
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,246
  • 2
  • 41
  • 46
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.
  • 99
  • 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
  • 263
  • 2
  • 13
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
  • 5,375
  • 4
  • 33
  • 52
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,288
  • 1
  • 16
  • 34
1 2 3
15
16