English Amiga Board


Go Back   English Amiga Board > Requests > request.Other

 
 
Thread Tools
Old 18 April 2018, 17:08   #1
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,381
Request: Long double (80bit) functions in x86/x64 assembly for WinUAE

Another weird request, eab probably is wrong forum but...

Because MSVC does not support long doubles (they are alias to double. No, don't discuss any reasons here!) and I'd like to have host FPU emulated long double support (not everyone wants or needs slower bit perfect softfloat floating point emulation). So I'd like to do following ugly solution:

I need x86/x64 assembly file that has functions for each basic floating point function that takes two parameters, input (pointer to long double) and output (also pointer to long double)

For example following C code in x86/x64 assemly:

Code:
void fadd(void *srclongdouble, void *dstlongdouble)
{
    long double *src = (long double*)srclongdouble;
    long double *dst = (long double*)dstlongdouble;
    *dst = (*src) + (*dst);
}
Very simple but it needs to be in assembly. Use of mingw or cygwin gcc won't work because floating point calls most likely require extra link libraries and/or compiler's C-library, they may change FPU mode or do some other extra stuff that shouldn't be done. Linking it with MSVC would also get too messy.

Same for all other basic floating point functions. (sub, neg, mul, div etc..) but I am sure I can do them if I have one simple example (fadd) that handles weird x86 FPU stack stuff I don't want to know...

And functions to convert long double to int/double and back.
Toni Wilen is offline  
AdSense AdSense  
Old 20 April 2018, 05:56   #2
dalek
Registered User

 
Join Date: Nov 2014
Location: NSW/Australia
Posts: 192
Apologies as it's not exactly what you are after but have you considered the Berkeley Soft Float library? http://www.jhauser.us/arithmetic/SoftFloat.html It supports 80-bit double precision.

At worst it might be useful to compile it and see what the resulting assembly looks like for the functions you are after if noone can help.
dalek is offline  
Old 20 April 2018, 08:50   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 21,381
Softfloat is already used in softfloat mode but it is much slower than native FPU because it needs lots of integer calculations, some of them need to be 128 bit wide.

I want to use host FPU directly.

EDIT: I think I finally got it. (also: x86 syntax is ugly)

Last edited by Toni Wilen; 23 April 2018 at 21:46.
Toni Wilen is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Request Fectures] For x86 bridge boards. Zilog support.WinUAE 3 06 December 2017 09:47
Instructions for building QEMU plugins (x86 and x64) from source? headkase support.WinUAE 31 10 July 2016 16:01
WinUAE x64 Crahses BlackByte support.WinUAE 9 23 December 2015 12:51
REQUEST: Build latest vasm for win7 x64 jimmy2x2x Coders. General 6 21 November 2014 18:06
Lost F key Functions on WINuae startup breadbaker support.WinUAE 8 06 December 2005 20:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.05888 seconds with 15 queries