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
4
votes
2 answers

how to compile node-v4.2.4 with armv7 without fpu?

I have a device whose cpu is armv7 but without fpu. I can compile node with option --with-arm-float-abi=soft, but when I run "node", "Illegal instruction (core dumped)" happened. root@router:/tmp/target/bin# ./node -v v4.2.4 …
SmartXiaoMing
  • 121
  • 1
  • 6
4
votes
1 answer

hybrid assembly scalar/vector on Power7 architecture

Since 2 years, I am developing a library: cyme to perform SIMD computation over "friendly container". I am able to reach the maximum performance of the processor. Typically user defined container and write a kernel under the following syntax…
Timocafé
  • 765
  • 6
  • 18
4
votes
2 answers

Why is FLD1 loading NaN instead?

I have a one-liner C function that is just return value * pow(1.+rate, -delay); - it discounts a future value to a present value. The interesting part of the disassembly is 0x080555b9 : neg %eax 0x080555bb : push %eax 0x080555bc : …
Bernd Jendrissek
  • 1,088
  • 6
  • 15
4
votes
1 answer

Why does MSVC use SSE2 instruction for such trivial thing?

The code: double Ret_Value=0; on default settings VS2012 compiles to: 10112128 xorps xmm0,xmm0 1011212E movsd mmword ptr [Ret_Value],xmm0 If SSE2 is disabled in project settings this is compiled to: 101102AC fldz 101102AE lea …
Andrey
  • 59,039
  • 12
  • 119
  • 163
4
votes
0 answers

FPU instructions that check precision

Using the fldcw instruction it's possible to change the precision of the FPU unit to 24 or more bits. However after doing some testing I'm starting to think that very few x87 operations are in fact using that setting. I haven't tested all operations…
Marladu
  • 545
  • 5
  • 11
4
votes
1 answer

Is the FPU control word setting per-thread or per-process?

I need to change the FPU control word from its default setting in a multithreaded application. Is this setting per-thread or per-process? Does it have different scopes under Mac OS X and Windows?
4
votes
2 answers

Signalling NaN was corrupted when returning from x86 function (flds/fstps of x87)

I have strange behaviour with x86 (32-bit) linux gcc. I generate signalling NaN using gcc's builtin __builtin_nansf(""), which generates 0x7fa00000. After returning this value from function as float, it is modified into 0x7fe00000. There is short…
osgx
  • 90,338
  • 53
  • 357
  • 513
4
votes
1 answer

Print FPU registers in lldb

How do you print FPU registers using lldb? In gdb, you would do something like p $st0, however doing the same in lldb results in the error: error: use of undeclared identifier '$st0'. register read st0 doesn't work either and gives the error error:…
Tyilo
  • 28,998
  • 40
  • 113
  • 198
4
votes
1 answer

FPU. How to make a loop?

Why when it goes to the cycle in ECX there some big random value insted of 0? And is there other way to make cycle here? program Project2; {$APPTYPE CONSOLE} uses SysUtils; function FPUTest(a:Double):Double; asm FINIT FLD a MOV ecx,0 …
DanilGholtsman
  • 2,354
  • 4
  • 38
  • 69
4
votes
2 answers

Pow implementation for double

I am developing a code that will be used for motion control and I am having a issue with the pow function. I am using VS2010 as IDE. Here is my issue: I have: double p = 100.0000; double d = 1000.0000; t1 =…
4
votes
2 answers

How to use floating point numbers in x86-64 assembly?

I'm struggling with some x86-64 assembly, and floating point numbers are giving me a headache. For instance, when I run this code : section .data omega: dq 2.0 omega2: dq 3.0 section .text global func func: push rbp mov rgp, rsp …
Losiowaty
  • 7,911
  • 2
  • 32
  • 47
4
votes
4 answers

How to avoid FPU when given float numbers?

Well, this is not at all an optimization question. I am writing a (for now) simple Linux kernel module in which I need to find the average of some positions. These positions are stored as floating point (i.e. float) variables. (I am the author of…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
3
votes
1 answer

How FILD and FSTP work?

I've searched over the net, and everywhere it says: FILD converts the two's complement of an integer to 80 bit extended precision float, and puts it on top of the floats stack. So, I've had a program do that, but the result I get is…
user1291797
  • 31
  • 1
  • 2
3
votes
0 answers

How to fix VFP asm code made for armeabi (arm5 or 6) to run on ARM v7?

Here's a short introduction to what's this about. I come from the PSVita homebrew community, where Andy Nguyen made so-loader, basically a library that allows us to execute Android .so's by resolving their imports and applying some patches. This is…
3
votes
1 answer

What is Vector Floating Point (VFP)?

Someone told me that VFP is a hardware accelerator for floating-point arithmetic used in ARM processors. But how does it "accelerate" the processor? I know the basic concepts of hard-floating and soft-floating, but it seems to me VFP does not…
morimn
  • 513
  • 3
  • 10
1 2
3
17 18