From 421b61f0e8cd87a3ca96dd9989f54cf7c86cd7fe Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 17 Oct 2009 11:21:08 -0500 Subject: [PATCH 1/6] fix type propagation information put on non-SIMD specializations of vany?, vall?, vnone? --- basis/math/vectors/simd/functor/functor.factor | 2 ++ .../math/vectors/specialization/specialization.factor | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/basis/math/vectors/simd/functor/functor.factor b/basis/math/vectors/simd/functor/functor.factor index 514c2f62aa..fdb742a721 100644 --- a/basis/math/vectors/simd/functor/functor.factor +++ b/basis/math/vectors/simd/functor/functor.factor @@ -283,8 +283,10 @@ simd new { { +vector+ +scalar+ -> +vector+ } A-vn->v-op } { { +vector+ +literal+ -> +vector+ } A-vn->v-op } { { +vector+ +vector+ -> +scalar+ } A-vv->n-op } + { { +vector+ +vector+ -> +boolean+ } A-vv->n-op } { { +vector+ -> +vector+ } A-v->v-op } { { +vector+ -> +scalar+ } A-v->n-op } + { { +vector+ -> +boolean+ } A-v->n-op } { { +vector+ -> +nonnegative+ } A-v->n-op } } >>schema-wrappers (define-simd-128) diff --git a/basis/math/vectors/specialization/specialization.factor b/basis/math/vectors/specialization/specialization.factor index e51d8c4553..62ebecff36 100644 --- a/basis/math/vectors/specialization/specialization.factor +++ b/basis/math/vectors/specialization/specialization.factor @@ -7,13 +7,14 @@ namespaces assocs fry splitting classes.algebra generalizations locals compiler.tree.propagation.info ; IN: math.vectors.specialization -SYMBOLS: -> +vector+ +scalar+ +nonnegative+ +literal+ ; +SYMBOLS: -> +vector+ +scalar+ +boolean+ +nonnegative+ +literal+ ; : signature-for-schema ( array-type elt-type schema -- signature ) [ { { +vector+ [ drop ] } { +scalar+ [ nip ] } + { +boolean+ [ 2drop boolean ] } { +nonnegative+ [ nip ] } { +literal+ [ 2drop f ] } } case @@ -32,6 +33,7 @@ SYMBOLS: -> +vector+ +scalar+ +nonnegative+ +literal+ ; { { +vector+ [ drop ] } { +scalar+ [ nip ] } + { +boolean+ [ 2drop boolean ] } { +nonnegative+ [ @@ -115,9 +117,9 @@ H{ { v> { +vector+ +vector+ -> +vector+ } } { v>= { +vector+ +vector+ -> +vector+ } } { vunordered? { +vector+ +vector+ -> +vector+ } } - { vany? { +vector+ -> +scalar+ } } - { vall? { +vector+ -> +scalar+ } } - { vnone? { +vector+ -> +scalar+ } } + { vany? { +vector+ -> +boolean+ } } + { vall? { +vector+ -> +boolean+ } } + { vnone? { +vector+ -> +boolean+ } } } PREDICATE: vector-word < word vector-words key? ; From 11e89b016d600aa33fe8685a04011e448197bbac Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 17 Oct 2009 11:21:43 -0500 Subject: [PATCH 2/6] moved "typed" to basis --- {extra => basis}/typed/authors.txt | 0 {extra => basis}/typed/debugger/debugger.factor | 0 {extra => basis}/typed/prettyprint/prettyprint.factor | 0 {extra => basis}/typed/summary.txt | 0 {extra => basis}/typed/typed-docs.factor | 0 {extra => basis}/typed/typed-tests.factor | 0 {extra => basis}/typed/typed.factor | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename {extra => basis}/typed/authors.txt (100%) rename {extra => basis}/typed/debugger/debugger.factor (100%) rename {extra => basis}/typed/prettyprint/prettyprint.factor (100%) rename {extra => basis}/typed/summary.txt (100%) rename {extra => basis}/typed/typed-docs.factor (100%) rename {extra => basis}/typed/typed-tests.factor (100%) rename {extra => basis}/typed/typed.factor (100%) diff --git a/extra/typed/authors.txt b/basis/typed/authors.txt similarity index 100% rename from extra/typed/authors.txt rename to basis/typed/authors.txt diff --git a/extra/typed/debugger/debugger.factor b/basis/typed/debugger/debugger.factor similarity index 100% rename from extra/typed/debugger/debugger.factor rename to basis/typed/debugger/debugger.factor diff --git a/extra/typed/prettyprint/prettyprint.factor b/basis/typed/prettyprint/prettyprint.factor similarity index 100% rename from extra/typed/prettyprint/prettyprint.factor rename to basis/typed/prettyprint/prettyprint.factor diff --git a/extra/typed/summary.txt b/basis/typed/summary.txt similarity index 100% rename from extra/typed/summary.txt rename to basis/typed/summary.txt diff --git a/extra/typed/typed-docs.factor b/basis/typed/typed-docs.factor similarity index 100% rename from extra/typed/typed-docs.factor rename to basis/typed/typed-docs.factor diff --git a/extra/typed/typed-tests.factor b/basis/typed/typed-tests.factor similarity index 100% rename from extra/typed/typed-tests.factor rename to basis/typed/typed-tests.factor diff --git a/extra/typed/typed.factor b/basis/typed/typed.factor similarity index 100% rename from extra/typed/typed.factor rename to basis/typed/typed.factor From ff3de7c5503022cb76f9ba991c6ab15cc712d0ef Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 17 Oct 2009 16:43:47 -0500 Subject: [PATCH 3/6] terrain: fix deploy config --- extra/terrain/deploy.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/terrain/deploy.factor b/extra/terrain/deploy.factor index c27e7b3c84..42e2fd68ab 100644 --- a/extra/terrain/deploy.factor +++ b/extra/terrain/deploy.factor @@ -5,7 +5,7 @@ H{ { deploy-c-types? f } { deploy-unicode? f } { deploy-io 2 } - { deploy-reflection 2 } + { deploy-reflection 1 } { "stop-after-last-window?" t } { deploy-word-props? f } { deploy-math? t } From b9d2c068a447e9d95096936599cc1e81712b165d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 17 Oct 2009 16:54:51 -0500 Subject: [PATCH 4/6] fix sporadic "fall-through in cond" failure in float math.vectors.simd tests --- basis/math/vectors/simd/simd-tests.factor | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 71ad09e002..8d0b88c393 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -193,22 +193,18 @@ CONSTANT: simd-classes '[ first2 inputs _ _ check-vector-op ] ] dip check-optimizer ; inline -: approx= ( x y -- ? ) +: (approx=) ( x y -- ? ) { { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] } - { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] } + { [ 2dup [ fp-nan? ] either? ] [ 2drop f ] } { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] } - { [ 2dup [ sequence? ] both? ] [ - [ - { - { [ 2dup [ fp-nan? ] both? ] [ 2drop t ] } - { [ 2dup [ fp-infinity? ] either? ] [ fp-bitwise= ] } - { [ 2dup [ fp-nan? ] either? not ] [ -1.e8 ~ ] } - } cond - ] 2all? - ] } + { [ 2dup [ float? ] both? ] [ -1.e8 ~ ] } } cond ; +: approx= ( x y -- ? ) + 2dup [ sequence? ] both? + [ [ (approx=) ] 2all? ] [ (approx=) ] if ; + : exact= ( x y -- ? ) { { [ 2dup [ float? ] both? ] [ fp-bitwise= ] } From 0653bae7ecc9f1439349eb618eeb24c5e4fd6ef6 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 17 Oct 2009 18:47:31 -0500 Subject: [PATCH 5/6] scuttle bogus math.vectors.simd test --- basis/math/vectors/simd/simd-tests.factor | 5 ----- 1 file changed, 5 deletions(-) diff --git a/basis/math/vectors/simd/simd-tests.factor b/basis/math/vectors/simd/simd-tests.factor index 8d0b88c393..7803c00954 100644 --- a/basis/math/vectors/simd/simd-tests.factor +++ b/basis/math/vectors/simd/simd-tests.factor @@ -48,11 +48,6 @@ cpu x86? [ float-4{ 0 1 0 2 } [ { float-4 } declare dup v+ underlying>> double-2 boa dup v+ ] compile-call ] unit-test - - [ 33.0 ] [ - double-2{ 1 2 } double-2{ 10 20 } - [ { double-2 double-2 } declare v+ underlying>> 3.0 float* ] compile-call - ] unit-test ] when ! Fuzz testing From 86c16eeb6ac896396905977d463aa39356b1aeb7 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 17 Oct 2009 21:20:08 -0500 Subject: [PATCH 6/6] cpu.x86.32: fix callbacks on platforms where stack is not aligned --- basis/cpu/x86/32/32.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index d016712149..3ce1374491 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -250,10 +250,10 @@ M:: x86.32 %unbox-large-struct ( n c-type -- ) ] with-aligned-stack ; M: x86.32 %nest-stacks ( -- ) + ! Save current frame. See comment in vm/contexts.hpp + EAX stack-reg stack-frame get total-size>> 3 cells - [+] LEA 8 [ push-vm-ptr - ! Save current frame. See comment in vm/contexts.hpp - EAX stack-reg stack-frame get total-size>> [+] LEA EAX PUSH "nest_stacks" f %alien-invoke ] with-aligned-stack ;