fpu

FLD instruction x64 bit

倖福魔咒の 提交于 2019-12-01 17:59:08
I have a little problem with FLD instruction in x64 bit ... want to load Double value to the stack pointer FPU in st0 register, but it seem to be impossible. In Delphi x32, I can use this code : function DoSomething(X:Double):Double; asm FLD X // Do Something .. FST Result end; Unfortunately, in x64, the same code does not work. In x64 mode floating point parameters are passed in xmm-registers. So when Delphi tries to compile FLD X, it becomes FLD xmm0 but there is no such instruction. You first need to move it to memory. The same goes with the result, it should be passed back in xmm0. Try

FLD instruction x64 bit

南笙酒味 提交于 2019-12-01 17:13:27
问题 I have a little problem with FLD instruction in x64 bit ... want to load Double value to the stack pointer FPU in st0 register, but it seem to be impossible. In Delphi x32, I can use this code : function DoSomething(X:Double):Double; asm FLD X // Do Something .. FST Result end; Unfortunately, in x64, the same code does not work. 回答1: In x64 mode floating point parameters are passed in xmm-registers. So when Delphi tries to compile FLD X, it becomes FLD xmm0 but there is no such instruction.

Scope of MXCSR control register?

荒凉一梦 提交于 2019-12-01 03:49:45
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 to know is if I need to set it (MXCSR) at my needs at the beginning of each thread of a thread pool, or once in the app, or would it impact everything else in the app and/or the system? Thanks for any help! Yes of course, you must set the MXCSR register at the beginning of each thread. Any thread can have own MXCSR settings, so this is essential

Scope of MXCSR control register?

只愿长相守 提交于 2019-12-01 00:59:23
问题 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 to know is if I need to set it (MXCSR) at my needs at the beginning of each thread of a thread pool, or once in the app, or would it impact everything else in the app and/or the system? Thanks for any help! 回答1: Yes of course, you must set the

How are floating point operations emulated in software? [closed]

吃可爱长大的小学妹 提交于 2019-11-29 12:37:46
How does software perform floating point arithmetic when the CPU has no (or buggy) floating point unit? Examples would be the PIC, AVR, and 8051 microcontrollers architectures. "Emulated" is the wrong term in the context of PIC, AVR and 8051. Floating-point emulation refers to the emulation of FPU hardware on architectures that have an FPU option but for which not all parts include the FPU. This allows a binary containing floating point instructions to run on a variant without an FPU. Where used, FPU emulation is implemented as an invalid-instruction exception handler ; when an FPU instruction

MSVC win32: convert extended precision float (80-bit) to double (64-bit)

烈酒焚心 提交于 2019-11-29 02:34:28
What is the most portable and "right" way to do conversion from extended precision float (80-bit value, also known as "long double" in some compilers) to double (64-bit) in MSVC win32/win64? MSVC currently (as of 2010) assumes that "long double" is "double" synonym. I could probably write fld/fstp assembler pair in inline asm, but inline asm is not available for win64 code in MSVC. Do I need to move this assembler code to separate .asm file? Is that really so there are no good solution? If your compiler / platform doesn't have native support for 80 bit floating point values, you have to decode

Detecting FPU presence on Android

耗尽温柔 提交于 2019-11-28 12:14:55
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 possesses an FPU, so I would like to have best of both worlds. Most newer phones have an FPU, but I would like to get the most performance the device can offer. It's a Linux kernel underneath, and at least the default Android configuration will mount procfs . That means you can look into /proc/cpuinfo , which on an ARM system looks something like: # cat