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

Henrik Johansen henrik.s.johansen at veloxit.no
Fri Jul 29 14:44:37 UTC 2016


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 <henrik.s.johansen at veloxit.no> 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 <noreply at github.com> 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 <nicolas.cellier at sirehna.com>
>> 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 <nicolas.cellier at sirehna.com>
>> 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 <nicolas.cellier at sirehna.com>
>> 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
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160729/772cb194/signature.pgp


More information about the Vm-dev mailing list