Re: [Chicken-hackers] ⍄PATCH⍃ Unboxing optimization for flonums
On Wed, Nov 28, 2018 at 07:25:33PM +0100, Mario Domenech Goulart wrote: > It looks like this patch (79cf7427, master) has broken "make > bootstrap". Log attached (using CHICKEN 5.0.0 as CHICKEN). Right you are. The reason is that lfa2 is trying to unbox the arguments to {f32,f64}_vector_ref, which are not flonums but srfi-4 vector and integer arguments. The return value is a flonum. Attached is a patch to avoid unboxing the argument to accessor functions. Cheers, Peter From f7fa7d3655ce7b8587beaa63e6f671ae5b06c597 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 28 Nov 2018 21:50:18 +0100 Subject: [PATCH] Do not float-unbox arguments to srfi-4 vector accessors The arguments aren't flonums, only the return value is! --- lfa2.scm | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lfa2.scm b/lfa2.scm index dffaee6f..1fba207c 100644 --- a/lfa2.scm +++ b/lfa2.scm @@ -563,7 +563,10 @@ (set! count (add1 count)) (let ((n (make-node '##core#inline (list ub) - (map walk/unbox subs + (map (if (eq? type 'acc) + walk + walk/unbox) + subs (case type ((pred) n) (else (make-node '##core#box_float '() -- 2.11.0 signature.asc Description: PGP signature ___ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers
Re: [Chicken-hackers] ⍄PATCH⍃ Unboxing optimization for flonums
Hi, On Mon, 26 Nov 2018 12:32:19 +0100 felix.winkelm...@bevuta.com wrote: > Thanks, your suggestions seem to be correct, I applied the patch and removed > the last call to sub-boxed!. I also added a (very simple) test. > >> - Finally: there are still quite some remnants of the old boxing/unboxing >>code around to mark variables as 'boxed, and there's still ##core#box >>and ##core#unbox in the intermediate language. >> >>Is that still relevant, or can we delete that too? As far as I can >>tell, that code is still active and used; could you tell me more about >>how it works and how it relates (or not) to the lfa2 boxing and >>unboxing step, especially why the patch introduces a new box_float >>operation rather than re-using the old intermediate language box/unbox >>operations? > > ##core#box/##core#unbox are unrelated, they access boxed variables > in closures (1-element vectors). It looks like this patch (79cf7427, master) has broken "make bootstrap". Log attached (using CHICKEN 5.0.0 as CHICKEN). All the best. Mario -- http://parenteses.org/mario "make" PLATFORM=linux PREFIX=/nowhere CONFIG= \ CHICKEN=/home/mario/local/chicken-5.0.0/bin/chicken PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \ C_COMPILER_OPTIMIZATION_OPTIONS="-Os -fomit-frame-pointer" BUILDING_CHICKEN_BOOT=1 \ confclean chicken-boot-stage1 make[1]: Entering directory '/home/mario/src/chicken-core' rm -f \ chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc echo '#define STATICBUILD 1' >> chicken-defaults.h echo '#define C_CHICKEN_PROGRAM "chicken-boot-stage1"' >> chicken-defaults.h echo '#ifndef C_INSTALL_CC' >> chicken-defaults.h echo '# define C_INSTALL_CC "gcc"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_CXX' >> chicken-defaults.h echo '# define C_INSTALL_CXX "g++"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_POSTINSTALL_PROGRAM' >> chicken-defaults.h echo '# define C_INSTALL_POSTINSTALL_PROGRAM "true"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_RC_COMPILER' >> chicken-defaults.h echo '# define C_INSTALL_RC_COMPILER ""' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_CFLAGS' >> chicken-defaults.h echo '# define C_INSTALL_CFLAGS "-fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_LDFLAGS' >> chicken-defaults.h echo '# define C_INSTALL_LDFLAGS " "' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_PREFIX' >> chicken-defaults.h echo '# define C_INSTALL_PREFIX "/nowhere"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_SHARE_HOME' >> chicken-defaults.h echo '# define C_INSTALL_SHARE_HOME "/nowhere/share/chicken-boot-stage1"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_BIN_HOME' >> chicken-defaults.h echo '# define C_INSTALL_BIN_HOME "/nowhere/bin"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_EGG_HOME' >> chicken-defaults.h echo '# define C_INSTALL_EGG_HOME "/nowhere/lib/chicken-boot-stage1/9"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_LIB_HOME' >> chicken-defaults.h echo '# define C_INSTALL_LIB_HOME "/nowhere/lib"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_LIB_NAME' >> chicken-defaults.h echo '# define C_INSTALL_LIB_NAME "chicken-boot-stage1"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_STATIC_LIB_HOME' >> chicken-defaults.h echo '# define C_INSTALL_STATIC_LIB_HOME "/nowhere/lib"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_INCLUDE_HOME' >> chicken-defaults.h echo '# define C_INSTALL_INCLUDE_HOME "/nowhere/include/chicken-boot-stage1"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_MORE_LIBS' >> chicken-defaults.h echo '# define C_INSTALL_MORE_LIBS "-lm -ldl"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_INSTALL_MORE_STATIC_LIBS' >> chicken-defaults.h echo '# define C_INSTALL_MORE_STATIC_LIBS "-lm -ldl"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_STACK_GROWS_DOWNWARD' >> chicken-defaults.h echo '# define C_STACK_GROWS_DOWNWARD 1' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_TARGET_MORE_LIBS' >> chicken-defaults.h echo '# define C_TARGET_MORE_LIBS "-lm -ldl"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_TARGET_MORE_STATIC_LIBS' >> chicken-defaults.h echo '# define C_TARGET_MORE_STATIC_LIBS "-lm -ldl"' >> chicken-defaults.h echo '#endif' >> chicken-defaults.h echo '#ifndef C_TARGET_CC' >> chicken-defaults.h echo '# define C_TARGET_CC "gcc"' >>