[OpenSmalltalk/opensmalltalk-vm] eab1bf: Use Nicolas' modernisation of fdlibm to provide cr...

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

[OpenSmalltalk/opensmalltalk-vm] eab1bf: Use Nicolas' modernisation of fdlibm to provide cr...

Eliot Miranda-3
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: eab1bf9a150bdeed596e731ecec54dfd0d6eee61
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/eab1bf9a150bdeed596e731ecec54dfd0d6eee61
  Author: Eliot Miranda <[hidden email]>
  Date:   2020-04-22 (Wed, 22 Apr 2020)

  Changed paths:
    M build.macos64x64/common/Makefile.flags
    M build.macos64x64/common/Makefile.vm
    M build.win64x64/common/Makefile
    M build.win64x64/common/Makefile.msvc
    M build.win64x64/common/Makefile.msvc.tools
    M build.win64x64/common/Makefile.tools
    A platforms/Cross/third-party/fdlibm/Makefile
    A platforms/Cross/third-party/fdlibm/Makefile.in
    A platforms/Cross/third-party/fdlibm/Makefile.remote
    A platforms/Cross/third-party/fdlibm/README
    A platforms/Cross/third-party/fdlibm/README.md
    A platforms/Cross/third-party/fdlibm/configure
    A platforms/Cross/third-party/fdlibm/configure.in
    A platforms/Cross/third-party/fdlibm/e_acos.c
    A platforms/Cross/third-party/fdlibm/e_acosh.c
    A platforms/Cross/third-party/fdlibm/e_asin.c
    A platforms/Cross/third-party/fdlibm/e_atan2.c
    A platforms/Cross/third-party/fdlibm/e_atanh.c
    A platforms/Cross/third-party/fdlibm/e_cosh.c
    A platforms/Cross/third-party/fdlibm/e_exp.c
    A platforms/Cross/third-party/fdlibm/e_fmod.c
    A platforms/Cross/third-party/fdlibm/e_gamma.c
    A platforms/Cross/third-party/fdlibm/e_gamma_r.c
    A platforms/Cross/third-party/fdlibm/e_hypot.c
    A platforms/Cross/third-party/fdlibm/e_j0.c
    A platforms/Cross/third-party/fdlibm/e_j1.c
    A platforms/Cross/third-party/fdlibm/e_jn.c
    A platforms/Cross/third-party/fdlibm/e_lgamma.c
    A platforms/Cross/third-party/fdlibm/e_lgamma_r.c
    A platforms/Cross/third-party/fdlibm/e_log.c
    A platforms/Cross/third-party/fdlibm/e_log10.c
    A platforms/Cross/third-party/fdlibm/e_pow.c
    A platforms/Cross/third-party/fdlibm/e_rem_pio2.c
    A platforms/Cross/third-party/fdlibm/e_remainder.c
    A platforms/Cross/third-party/fdlibm/e_scalb.c
    A platforms/Cross/third-party/fdlibm/e_sinh.c
    A platforms/Cross/third-party/fdlibm/e_sqrt.c
    A platforms/Cross/third-party/fdlibm/fdlibm.h
    A platforms/Cross/third-party/fdlibm/generate_defines
    A platforms/Cross/third-party/fdlibm/k_cos.c
    A platforms/Cross/third-party/fdlibm/k_rem_pio2.c
    A platforms/Cross/third-party/fdlibm/k_sin.c
    A platforms/Cross/third-party/fdlibm/k_standard.c
    A platforms/Cross/third-party/fdlibm/k_tan.c
    A platforms/Cross/third-party/fdlibm/s_asinh.c
    A platforms/Cross/third-party/fdlibm/s_atan.c
    A platforms/Cross/third-party/fdlibm/s_cbrt.c
    A platforms/Cross/third-party/fdlibm/s_ceil.c
    A platforms/Cross/third-party/fdlibm/s_copysign.c
    A platforms/Cross/third-party/fdlibm/s_cos.c
    A platforms/Cross/third-party/fdlibm/s_erf.c
    A platforms/Cross/third-party/fdlibm/s_expm1.c
    A platforms/Cross/third-party/fdlibm/s_fabs.c
    A platforms/Cross/third-party/fdlibm/s_finite.c
    A platforms/Cross/third-party/fdlibm/s_floor.c
    A platforms/Cross/third-party/fdlibm/s_frexp.c
    A platforms/Cross/third-party/fdlibm/s_ilogb.c
    A platforms/Cross/third-party/fdlibm/s_isnan.c
    A platforms/Cross/third-party/fdlibm/s_ldexp.c
    A platforms/Cross/third-party/fdlibm/s_lib_version.c
    A platforms/Cross/third-party/fdlibm/s_log1p.c
    A platforms/Cross/third-party/fdlibm/s_logb.c
    A platforms/Cross/third-party/fdlibm/s_matherr.c
    A platforms/Cross/third-party/fdlibm/s_modf.c
    A platforms/Cross/third-party/fdlibm/s_nextafter.c
    A platforms/Cross/third-party/fdlibm/s_rint.c
    A platforms/Cross/third-party/fdlibm/s_scalbn.c
    A platforms/Cross/third-party/fdlibm/s_signgam.c
    A platforms/Cross/third-party/fdlibm/s_significand.c
    A platforms/Cross/third-party/fdlibm/s_sin.c
    A platforms/Cross/third-party/fdlibm/s_tan.c
    A platforms/Cross/third-party/fdlibm/s_tanh.c
    A platforms/Cross/third-party/fdlibm/w_acos.c
    A platforms/Cross/third-party/fdlibm/w_acosh.c
    A platforms/Cross/third-party/fdlibm/w_asin.c
    A platforms/Cross/third-party/fdlibm/w_atan2.c
    A platforms/Cross/third-party/fdlibm/w_atanh.c
    A platforms/Cross/third-party/fdlibm/w_cosh.c
    A platforms/Cross/third-party/fdlibm/w_exp.c
    A platforms/Cross/third-party/fdlibm/w_fmod.c
    A platforms/Cross/third-party/fdlibm/w_gamma.c
    A platforms/Cross/third-party/fdlibm/w_gamma_r.c
    A platforms/Cross/third-party/fdlibm/w_hypot.c
    A platforms/Cross/third-party/fdlibm/w_j0.c
    A platforms/Cross/third-party/fdlibm/w_j1.c
    A platforms/Cross/third-party/fdlibm/w_jn.c
    A platforms/Cross/third-party/fdlibm/w_lgamma.c
    A platforms/Cross/third-party/fdlibm/w_lgamma_r.c
    A platforms/Cross/third-party/fdlibm/w_log.c
    A platforms/Cross/third-party/fdlibm/w_log10.c
    A platforms/Cross/third-party/fdlibm/w_pow.c
    A platforms/Cross/third-party/fdlibm/w_remainder.c
    A platforms/Cross/third-party/fdlibm/w_scalb.c
    A platforms/Cross/third-party/fdlibm/w_sinh.c
    A platforms/Cross/third-party/fdlibm/w_sqrt.c
    M platforms/Cross/vm/sq.h
    A platforms/Cross/vm/sqMathShim.h
    M platforms/Cross/vm/sqVirtualMachine.h

  Log Message:
  -----------
  Use Nicolas' modernisation of fdlibm to provide cross-platform bit-identical
floating-point (CPBIFP) in the standard VM, no longer being dependent on
FloatMathPlugin, and hence not having to change image-level primitive
definitions to access CPBIFP.  This is work in progress, but does not disturb
normal builds.  To access this code you must define BIT_IDENTICAL_FLOATING_POINT
in a Makefile.  e.g. here is a Mac makefile:
--------8<--------

BIT_IDENTICAL_FLOATING_POINT=BIT_IDENTICAL_FLOATING_POINT
VMSRCDIR:= ../../spur64src/vm
SOURCEFILE:=SqueakV50.sources

include ../common/Makefile.app.squeak
--------8<--------
and here is a Windows makefile:
--------8<--------

VM:=CROQUET
BIT_IDENTICAL_FLOATING_POINT:=BIT_IDENTICAL_FLOATING_POINT
VMSRCDIR:=../../spur64src/vm

VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
--------8<--------
Nothing has been done for linux yet, but it will soon; I have investment in the
Pi 4.

The strategy is as follows:
Nicolas' updated fdlibm code is included in platforms/Cross/third-party/fdlibm.
This code is built into a libm.a by each build alongside its internal plugin
.libs, and linked into the main VM, iff the Makefile defines
BIT_IDENTICAL_FLOATING_POINT.  [Nothing has yet been done for external plugins.
We either need to construct a shared library/dll for libm for these, or link
it statically as per the main VM.]  Since sq.h includes <math.h> it now also
includes sqMathShim.h.  If BIT_IDENTICAL_FLOATING_POINT is defined as non-zero
on the compiler command line, sqMathShim.h pulls in fdlibm.h and redefines all
relevant math functions to __ieee754 duals, e.g.  # define acos __ieee754_acos.
If BIT_IDENTICAL_FLOATING_POINT is not so defined sqMathShim.h does nothing.
Hence, unless BIT_IDENTICAL_FLOATING_POINT is not defined in the Makefile the
VM builds as before.