x87 Questions
1
Solved
I recently tried to read assemblies of the binary of my code and found that a lot of floating-point operations are done using XMM registers and SSE instructions. For example, the following code:
fl...
Deposit asked 11/9, 2024 at 11:52
6
Solved
0
I have a curious problem porting working numerical code from Intel 2023 & MSC Visual C++ 2022.
The code compiled with GCC is perfectly accurate (too accurate) since some library calls are worki...
Circumpolar asked 25/10, 2023 at 16:36
2
I am working on a language that is compiled with LLVM. Just for fun, I wanted to do some microbenchmarks. In one, I run some million sin / cos computations in a loop. In pseudocode, it looks like t...
Helio asked 18/9, 2012 at 21:18
2
Solved
I have a short program that performs a numerical computation, and obtains an incorrect NaN result when some specific conditions hold. I cannot see how this NaN result can arise. Note that I am not ...
Poohpooh asked 8/12, 2022 at 10:38
6
Solved
I want to implement the equivalent of C's uint-to-double cast in the GHC Haskell compiler. We already implement int-to-double using FILD or CVTSI2SD. Is there unsigned versions of these operations ...
Wearable asked 5/12, 2012 at 23:9
1
Solved
On Intel processors, x87 trigonometric instructions such as FSIN have limited accuracy due to the use of a 66-bit approximation of pi even though the computation itself is otherwise accurate to the...
Colonize asked 17/2, 2020 at 16:49
1
Does anyone know whether Linux supports the use of the x87-FPU in 64-bit-mode, i.e. if the instructions are not trapped and the registers are saved on context-switch. I don't want to use it and I k...
2
Solved
The following documentation is provided in the Intel Instruction Reference for the COMISD instruction:
Compares the double-precision floating-point values in the low
quadwords of operand 1 (fir...
1
The cos() in math.h run faster than the x86 asm fcos.
The following code is compare between the x86 fcos and the cos() in math.h.
In this code, 1000000 times asm fcos cost 150ms; 1000000 times co...
Metric asked 13/4, 2019 at 13:0
1
Solved
If I have 2 denormal floating point numbers with different bit patterns and compare them for equality, can the result be affected by the Denormals-Are-Zero flag, the Flush-to-Zero flag, or other fl...
Gigantes asked 4/1, 2019 at 23:13
4
Solved
I have strange a memory corruption problem. After many hours debugging and trying I think I found something.
For example: I do a simple string assignment:
sTest := 'SET LOCK_TIMEOUT ';
However,...
Supat asked 6/4, 2010 at 12:11
5
Solved
When I try to compile this code:
#include <stdio.h>
main(int argc, char *argv[]) {
double y = 0;
__asm__ ("fldl $150;"
"fsqrt;"
"fstl %0;" : : "g" (y) );
printf("%f\n", y);
return...
Nicol asked 29/6, 2011 at 0:26
2
Solved
I've heard that the x87 FPU works with 80-bit floats, so even if I want to calculate using 64-bit numbers, it would calculate it with 80-bit and then convert it. But which is fastest in Swift on x8...
Servomechanism asked 23/7, 2017 at 13:1
4
Solved
At my university we were just introduced to IA32 x87 FPU. But we weren't informed how to clear the FPU-Stack of no longer demanded elements.
Imagine we're performing a simple calculation like (5.6...
Distemper asked 10/11, 2013 at 16:39
1
Solved
In a codebase of ours I found this snippet for fast, towards-negative-infinity1 rounding on x87:
inline int my_int(double x)
{
int r;
#ifdef _GCC_
asm ("fldl %1\n"
"fistpl %0\n"
:"=m"(r)
:"m"...
3
Solved
Where can I find the information about error ranges for trigonometric function instructions on x86 processors, like fsincos?
Stalky asked 20/2, 2014 at 13:15
3
The FISTP instruction changes 0.75 to 1 (because of rounding)
I want 0.75 to turn into 0, not 1.
Is there an alternative to FIST/FISTP that truncates instead of rounds?
4
Solved
I was reading today about researchers discovering that NVidia's Phys-X libraries use x87 FP vs. SSE2. Obviously this will be suboptimal for parallel datasets where speed trumps precision. However, ...
Supranational asked 8/7, 2010 at 16:57
1
Solved
Value of x87 floating point control word can be checked with _control87. When a new thread starts, on my platform it seems to inherit value of floating point control word from the parent thread.
I...
Sitter asked 29/8, 2016 at 11:33
1
Solved
I wrote a vector structure like this:
struct vector {
float x1, x2, x3, x4;
};
Then I created a function which does some operations with inline assembly using the vector:
struct vector *adding(co...
Requital asked 29/5, 2016 at 11:54
2
The program I'm reversing does simple multiplication between float number and 8 byte integer:
section .data
va: dt 1.4426950408889634074
vb: dd 0x42424242
dd 0x41414141
section .text
global mai...
Hockey asked 3/2, 2016 at 16:30
3
Solved
I want to emulate the x86 extended precision type and perform arithmetic operations and casts to other types in Java.
I could try to implement it using BigDecimal, but covering all the special cas...
Biphenyl asked 29/10, 2015 at 15:56
3
Solved
I've recently read up quite a bit on IEEE 754 and the x87 architecture. I was thinking of using NaN as a "missing value" in some numeric calculation code I'm working on, and I was hoping that using...
Rothstein asked 11/2, 2010 at 20:19
5
Solved
Yeah, I meant to say 80-bit. That's not a typo...
My experience with floating point variables has always involved 4-byte multiples, like singles (32 bit), doubles (64 bit), and long doubles (which ...
Carnivore asked 4/3, 2009 at 21:25
1 Next >
© 2022 - 2025 — McMap. All rights reserved.