[OpenSmalltalk/opensmalltalk-vm] 88e24a: Gather missing MSVC functions in sqPlatformSpecifi...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] 88e24a: Gather missing MSVC functions in sqPlatformSpecifi...

Eliot Miranda-3
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 88e24a3e92004f9590099482f53eaac3eccc3f20
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/88e24a3e92004f9590099482f53eaac3eccc3f20
  Author: Nicolas Cellier <[hidden email]>
  Date:   2016-07-29 (Fri, 29 Jul 2016)

  Changed paths:
    M platforms/win32/vm/sqPlatformSpecific.h
    M platforms/win32/vm/sqWin32.h

  Log Message:
  -----------
  Gather missing MSVC functions in sqPlatformSpecific.h

Reason: I added them to sqWin32.h but there were already some in sqPlatformSpecific.h
Note: fabsf is in MSVC at least from 2003 edition, and in gcc for even longer, so avoid redefining if we know it's useless


  Commit: 3dadd587627048d3854c61c60ff231dc6f30627c
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3dadd587627048d3854c61c60ff231dc6f30627c
  Author: Nicolas Cellier <[hidden email]>
  Date:   2016-07-29 (Fri, 29 Jul 2016)

  Changed paths:
    M platforms/win32/vm/sqPlatformSpecific.h
    M platforms/win32/vm/sqWin32Utils.c

  Log Message:
  -----------
  Provide round implementation for older MSVC

round is available since MSVC 2013 (_MSC_VER >= 1800)


  Commit: 9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
  Author: Nicolas Cellier <[hidden email]>
  Date:   2016-07-29 (Fri, 29 Jul 2016)

  Changed paths:
    M build.win32x86/common/Makefile
    M build.win32x86/common/Makefile.plugin
    M build.win64x64/common/Makefile
    M build.win64x64/common/Makefile.plugin

  Log Message:
  -----------
  Don't use the provided 3rd party DirectX include files

These files are provided by mingw.
Since we link with mingw library, it's better to use mingw include.

There were Teleplace specific hacks justifying to put a local copy.
But these hacks are no longer necessary for building uptodate Squeak & al vm.
Note that provided 3rd party libraries (.lib) are for MSVC and are provided for 32bits only.


Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/77b30368c1e8...9c44322e2469
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] 88e24a: Gather missing MSVC functions in sqPlatformSpecifi...

Henrik Sperre Johansen
 
It may be *in* 2003 onwards, but the generated code is positively abysmal, at least in 2015.

*cough*
float fabsf(float x) { return (float) fabs( (double)x ); }
*cough*

Couldn't even be inlined on full optimization settings in latest 2015 version I checked...
(same goes for fminf, fmaxf, etc)

Cheers,
Henry

> On 29 Jul 2016, at 2:40 , GitHub <[hidden email]> wrote:
>
>  Branch: refs/heads/Cog
>  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
>  Commit: 88e24a3e92004f9590099482f53eaac3eccc3f20
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/88e24a3e92004f9590099482f53eaac3eccc3f20
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M platforms/win32/vm/sqPlatformSpecific.h
>    M platforms/win32/vm/sqWin32.h
>
>  Log Message:
>  -----------
>  Gather missing MSVC functions in sqPlatformSpecific.h
>
> Reason: I added them to sqWin32.h but there were already some in sqPlatformSpecific.h
> Note: fabsf is in MSVC at least from 2003 edition, and in gcc for even longer, so avoid redefining if we know it's useless
>
>
>  Commit: 3dadd587627048d3854c61c60ff231dc6f30627c
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3dadd587627048d3854c61c60ff231dc6f30627c
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M platforms/win32/vm/sqPlatformSpecific.h
>    M platforms/win32/vm/sqWin32Utils.c
>
>  Log Message:
>  -----------
>  Provide round implementation for older MSVC
>
> round is available since MSVC 2013 (_MSC_VER >= 1800)
>
>
>  Commit: 9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M build.win32x86/common/Makefile
>    M build.win32x86/common/Makefile.plugin
>    M build.win64x64/common/Makefile
>    M build.win64x64/common/Makefile.plugin
>
>  Log Message:
>  -----------
>  Don't use the provided 3rd party DirectX include files
>
> These files are provided by mingw.
> Since we link with mingw library, it's better to use mingw include.
>
> There were Teleplace specific hacks justifying to put a local copy.
> But these hacks are no longer necessary for building uptodate Squeak & al vm.
> Note that provided 3rd party libraries (.lib) are for MSVC and are provided for 32bits only.
>
>
> Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/77b30368c1e8...9c44322e2469


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] 88e24a: Gather missing MSVC functions in sqPlatformSpecifi...

Henrik Sperre Johansen
 
Since that was basically also the old definintion in Squeak sources, to be a bit more constructive,

float sane_fabs(float x) { return x >= 0.0f ? x : -x; }
#define fabs(_X) sane_fabs(_X)

will be picked up by the pattern matcher in lastest compiler, and
- generate single sse2-instruction when sse2 is active.
- be inlined
- vectorize properly if called from loop on adjacent floats (...well, when using for loops and [] access at least))

Cheers,
Henry

> On 29 Jul 2016, at 3:33 , Henrik Johansen <[hidden email]> wrote:
>
> It may be *in* 2003 onwards, but the generated code is positively abysmal, at least in 2015.
>
> *cough*
> float fabsf(float x) { return (float) fabs( (double)x ); }
> *cough*
>
> Couldn't even be inlined on full optimization settings in latest 2015 version I checked...
> (same goes for fminf, fmaxf, etc)
>
> Cheers,
> Henry
>
>> On 29 Jul 2016, at 2:40 , GitHub <[hidden email]> wrote:
>>
>> Branch: refs/heads/Cog
>> Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
>> Commit: 88e24a3e92004f9590099482f53eaac3eccc3f20
>>     https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/88e24a3e92004f9590099482f53eaac3eccc3f20
>> Author: Nicolas Cellier <[hidden email]>
>> Date:   2016-07-29 (Fri, 29 Jul 2016)
>>
>> Changed paths:
>>   M platforms/win32/vm/sqPlatformSpecific.h
>>   M platforms/win32/vm/sqWin32.h
>>
>> Log Message:
>> -----------
>> Gather missing MSVC functions in sqPlatformSpecific.h
>>
>> Reason: I added them to sqWin32.h but there were already some in sqPlatformSpecific.h
>> Note: fabsf is in MSVC at least from 2003 edition, and in gcc for even longer, so avoid redefining if we know it's useless
>>
>>
>> Commit: 3dadd587627048d3854c61c60ff231dc6f30627c
>>     https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3dadd587627048d3854c61c60ff231dc6f30627c
>> Author: Nicolas Cellier <[hidden email]>
>> Date:   2016-07-29 (Fri, 29 Jul 2016)
>>
>> Changed paths:
>>   M platforms/win32/vm/sqPlatformSpecific.h
>>   M platforms/win32/vm/sqWin32Utils.c
>>
>> Log Message:
>> -----------
>> Provide round implementation for older MSVC
>>
>> round is available since MSVC 2013 (_MSC_VER >= 1800)
>>
>>
>> Commit: 9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>>     https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>> Author: Nicolas Cellier <[hidden email]>
>> Date:   2016-07-29 (Fri, 29 Jul 2016)
>>
>> Changed paths:
>>   M build.win32x86/common/Makefile
>>   M build.win32x86/common/Makefile.plugin
>>   M build.win64x64/common/Makefile
>>   M build.win64x64/common/Makefile.plugin
>>
>> Log Message:
>> -----------
>> Don't use the provided 3rd party DirectX include files
>>
>> These files are provided by mingw.
>> Since we link with mingw library, it's better to use mingw include.
>>
>> There were Teleplace specific hacks justifying to put a local copy.
>> But these hacks are no longer necessary for building uptodate Squeak & al vm.
>> Note that provided 3rd party libraries (.lib) are for MSVC and are provided for 32bits only.
>>
>>
>> Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/77b30368c1e8...9c44322e2469
>


signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] 88e24a: Gather missing MSVC functions in sqPlatformSpecifi...

Nicolas Cellier
In reply to this post by Henrik Sperre Johansen
 
Hi Henry,
it does not really matter because I virtually eliminated this definition
(I kept it just in case for very old compiler support)

Every C compiler comes with a definition of fabsf nowadays and we'll just use the native one.

Nicolas

2016-07-29 16:33 GMT+02:00 Henrik Johansen <[hidden email]>:
 
It may be *in* 2003 onwards, but the generated code is positively abysmal, at least in 2015.

*cough*
float fabsf(float x) { return (float) fabs( (double)x ); }
*cough*

Couldn't even be inlined on full optimization settings in latest 2015 version I checked...
(same goes for fminf, fmaxf, etc)

Cheers,
Henry
 
> On 29 Jul 2016, at 2:40 , GitHub <[hidden email]> wrote:
>
>  Branch: refs/heads/Cog
>  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
>  Commit: 88e24a3e92004f9590099482f53eaac3eccc3f20
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/88e24a3e92004f9590099482f53eaac3eccc3f20
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M platforms/win32/vm/sqPlatformSpecific.h
>    M platforms/win32/vm/sqWin32.h
>
>  Log Message:
>  -----------
>  Gather missing MSVC functions in sqPlatformSpecific.h
>
> Reason: I added them to sqWin32.h but there were already some in sqPlatformSpecific.h
> Note: fabsf is in MSVC at least from 2003 edition, and in gcc for even longer, so avoid redefining if we know it's useless
>
>
>  Commit: 3dadd587627048d3854c61c60ff231dc6f30627c
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/3dadd587627048d3854c61c60ff231dc6f30627c
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M platforms/win32/vm/sqPlatformSpecific.h
>    M platforms/win32/vm/sqWin32Utils.c
>
>  Log Message:
>  -----------
>  Provide round implementation for older MSVC
>
> round is available since MSVC 2013 (_MSC_VER >= 1800)
>
>
>  Commit: 9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/9c44322e2469eef8d7c1bb57c7acd5a6795dfb1b
>  Author: Nicolas Cellier <[hidden email]>
>  Date:   2016-07-29 (Fri, 29 Jul 2016)
>
>  Changed paths:
>    M build.win32x86/common/Makefile
>    M build.win32x86/common/Makefile.plugin
>    M build.win64x64/common/Makefile
>    M build.win64x64/common/Makefile.plugin
>
>  Log Message:
>  -----------
>  Don't use the provided 3rd party DirectX include files
>
> These files are provided by mingw.
> Since we link with mingw library, it's better to use mingw include.
>
> There were Teleplace specific hacks justifying to put a local copy.
> But these hacks are no longer necessary for building uptodate Squeak & al vm.
> Note that provided 3rd party libraries (.lib) are for MSVC and are provided for 32bits only.
>
>
> Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/77b30368c1e8...9c44322e2469