NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: jishnu@123 on December 30, 2014, 04:16:42 AM

Title: floating point numbers
Post by: jishnu@123 on December 30, 2014, 04:16:42 AM
I am attempting to write some software to operate on 128-bit quadruple precision floating point numbers. I could use some additional clarification on how to implement __float128l__, __float128h__, __infinity__, __float80m__, float80e__, and __NaN__.

How do you define, declare, and setup these tokens for use in NASM? How do I get the values defined by __float128l__ and __128h__ into an XMM register?

Thanks in advance.
jishnu@123
Title: Re: floating point numbers
Post by: encryptor256 on December 30, 2014, 06:30:12 PM
Well, I'm too lazy to test it out, but this might be towards some uncertain direction:

Code: [Select]
bits 64
section .data

align 16
myfloat128: dq __float128l__(3.141592653589793238462),__float128h__(3.141592653589793238462)


section .text
global main
main:

        ; The quick brown fox jumps over the lazy dog

movdqa xmm0,[myfloat128]
movdqu xmm0,[myfloat128]

ret

Basically __float128l__ and __float128h__ defines low - high - quadword of that - appropriate floating point number.