Author Topic: floating point numbers  (Read 6213 times)

Offline jishnu@123

  • Jr. Member
  • *
  • Posts: 3
floating point numbers
« 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

Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: floating point numbers
« Reply #1 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.
Encryptor256's Investigation \ Research Department.