Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Converting a 12...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 4467 of 4822
Post > Topic >>

Converting a 128 integer into 80 bit floating point

by jacob navia <spamtrap@[EMAIL PROTECTED] > Jan 2, 2008 at 09:39 PM

Hi asm wizards!

I am adding 128 bit integer sup****t to my compiler system, and I need to 
convert an int128 into a long double (80 bits floating point)

I developed this macro for doing this. Do you see something wrong here?

I have tested it and seems to be working but I am not 100% sure.

	push	$64
	fildl	(%%rsp)
	leaq	some_address,%%rcx
;;
;; load higher part of the 128 bit number into the FPU
	fildt	8(%%rcx)
;; multiply by 2^64
	fscale
;;
;; load lower part of the 128 bit number
	fildt	(%%rcx)
	faddp
;; cleanup the FPU stack
	fstpl	%%st(1)
;; cleanup the stack
	addq	$8,%%rsp


Thanks in advance


-- 
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 




 7 Posts in Topic:
Converting a 128 integer into 80 bit floating point
jacob navia <spamtrap  2008-01-02 21:39:44 
Re: Converting a 128 integer into 80 bit floating point
Tim Roberts <spamtrap  2008-01-03 07:15:31 
Re: Converting a 128 integer into 80 bit floating point
Terje Mathisen <spamt  2008-01-03 08:18:20 
Re: Converting a 128 integer into 80 bit floating point
jacob navia <spamtrap  2008-01-03 22:06:54 
Re: Converting a 128 integer into 80 bit floating point
"robertwessel2@[EMAI  2008-01-02 23:07:24 
Re: Converting a 128 integer into 80 bit floating point
jacob navia <spamtrap  2008-01-03 22:08:39 
Re: Converting a 128 integer into 80 bit floating point
Terje Mathisen <spamt  2008-01-03 23:31:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 12:41:22 CDT 2008.