Let's assume that there is a long double variable in memory. According to what i've found in the Net it is 12-bytes big. How can CPU operate on it if registers size is 64 bits? Is it divided somehow?
How can 12-bytes long double fit in 64 bits register?
94 views Asked by Huuulk99 At
1
There are 1 answers
Related Questions in MEMORY
- 9 Digit Addresses in Hexadecimal System in MacOS
- Memory location changing from 0 to 1 consistently on Mac
- Would event listeners prevent garbage collecting objects referenced in outer function scopes?
- tensorrt inference problem: CPU memory leak
- How to estimate the memory size of a binary voxelized geometry?
- Java Memory UTF-16 Vs UTF-8
- Spring Boot application container memory footprint (Java 21)
- Low memory Windows CE
- How to throw an error when a program acesses a block of memory created by you that has been deallocated by a call of free?
- Golang bufio.Scanner: token too long
- Get the address and size of a loaded shared object on memory from C
- In Redis Databases how do we need to calculate the table size
- ClickHouse Materialized View consuming a lot of Memory and CPU
- How to reduce memory usage for large matrix calculations?
- How to use memray with Gunicorn or flask dev server?
Related Questions in X86
- How to call a C language function from x86 assembly code?
- the difference between two style of inline ASM
- Understanding the differences between mov and lea instructions in x86 assembly
- ARM Assembly code is not executing in Vitis IDE
- x86 - compare numbers and push the result onto the stack
- Seeking for the the method for adding the DL (data register) value to DX register
- link.exe unresolved external symbol _mainCRTStartup
- x86 Wrote a boot loader that prints a message to the screen but the characters are completely different to what I expected
- How does CPU tell between MMIO(Memory Mapped IO) and normal memory access in x86 architecture
- Why do register arg values need to be re-assigned in NASM after an int 0x80 system call?
- Why does LLVM-MCA measure an execution stall?
- Why does shr eax, 32 not do anything?
- Evaluating this in Assembly (A % B) % (C % D)
- Understanding throughput of simd sum implementation x86
- Making portable execution errors
Related Questions in CPU-REGISTERS
- Understanding the differences between mov and lea instructions in x86 assembly
- Move immediate 8-bit value into RSI, RDI, RSP or RBP
- Maximum CPU Voltage reading
- Enabling one timer using another
- CMP ESI, -20. This part of code makes no sense to me. How does this magic work?
- Why doesn't this pop instruction restore the register values?
- Configuring timer channel as output
- Setting up Segment Registers, x86
- Why arm64 pass params throught register x8-x17?
- gdbserver and ymm0h register
- Unit tests on registers with bare metal programming
- Performance advantage of 32bit registers in AArch64?
- What is the meaning of "ptr" in assembly?
- What is the meaning of register1:register2 in assembly language?
- The SUB instruction in CPU
Related Questions in LONG-DOUBLE
- Values getting Overflowed while converting Bit into TB
- Need large integers and floats. Trouble with long long int and long double
- Cant recognise long long , long double in MinGW on Code::Blocks
- Are long doubles broken using MinGW-w64?
- Cholesky with floats 128 (Python)
- How can you set data type of #define to long double?
- gcc13: long double has almost the same precision of libquadmath; are they both 80-bit float implementations?
- Split up long C++ double literal into multiple lines
- Packing long double with int
- Why doesn't long double have more precision than double?
- Conversion between `long double` and `std::uintmax_t` loses precision on whole numbers
- What is stored in bits of long double variable?
- (C++) SQRT function only outputs four decimal places
- Why is double 0.1 more accurate than its long double version?
- Long double and Intellisense in Visual Studio
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
It doesn't. And the x87 hardware format is 80 bits (10 bytes) long, the width of the legacy x87 FPU registers (which still exist, and are useful for wider precision if you don't want to use something like Kahan summation or double-double techniques.
doubleandfloatare normally done in the low element of XMM registers with SSE2 instructions, except in 32-bit code compiled for compatibility with CPUs from the early 2000s or older.)The extra 2 bytes in
sizeof(long double)are padding to makesizeof(long double)a multiple ofalignof(long double) == 4in the i386 System V ABI (32-bit code).In the x86-64 System V ABI,
sizeofandalignof(long double)were bumped up to 16 so it can't split across cache lines. This is 6 bytes of padding, still 10 bytes of actual data accessed byfld m80andfstp m80instructions (which are several times slower than normal dword or qword float or double loads and stores, see my answer on the retrocomputing Q&A).80-bit
long doubleis never loaded into 128-bit XMM registers (except to copy it), or into 64-bit integer registers (except to copy it, or do integer stuff with the mantissa and exponent fields, like when implementinglogorexp.) There are only HW instructions for doing math on it in the x87 registers.Note that MSVC for x86 and x64 uses 64-bit
long double, with the same format asdouble. GCC has options to be ABI compatible with that, or to havelong doublebe the 80-bit x87 type to allow higher-precision FP conveniently. But on Windows beware of 32-bit libraries that set the x87 FPU precision bits to round off to fewer bits (which speeds up div and sqrt somewhat). See https://randomascii.wordpress.com/2012/03/21/intermediate-floating-point-precision/ re: DirectX libraries doing that.