File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 11
22#include <stdint.h>
33#include <intrin.h>
4+ #include <malloc.h>
5+ #define _USE_MATH_DEFINES
6+ #include <math.h>
47
58// atexit is needed by libsupc++
69extern int __cdecl _crt_atexit (void (__cdecl* )(void ));
@@ -9,13 +12,11 @@ int __cdecl atexit(void (__cdecl* function)(void))
912 return _crt_atexit (function );
1013}
1114
12- void * __cdecl malloc (size_t );
1315void * __cdecl operator_new (size_t size )
1416{
1517 return malloc (size );
1618}
1719
18- void free (void * );
1920void _cdecl operator_delete (void * mem )
2021{
2122 free (mem );
@@ -48,26 +49,25 @@ int __cdecl __acrt_initialize_sse2(void)
4849
4950double fma (double x , double y , double z )
5051{
51- __debugbreak ();
52- return 0. ;
52+ // Simplistic implementation
53+ return ( x * y ) + z ;
5354}
5455
5556float fmaf (float x , float y , float z )
5657{
57- __debugbreak ();
58- return 0. ;
58+ // Simplistic implementation
59+ return ( x * y ) + z ;
5960}
6061
6162double log2 (double x )
6263{
63- __debugbreak ();
64- return 0. ;
64+ // Simplistic implementation: log2(x) = log(x) / log(2)
65+ return log ( x ) * M_LOG2E ;
6566}
6667
6768float log2f (float x )
6869{
69- __debugbreak ();
70- return 0. ;
70+ return (float )log2 ((double )x );
7171}
7272
7373long int lrint (double x )
You can’t perform that action at this time.
0 commit comments