AMD64 FFI fixes; httpd load fix; minor opengl optimization
parent
ff09d4c559
commit
fd59c87eae
|
@ -48,6 +48,9 @@ this is lexicographic order, and for words, this compares word names.</li>
|
||||||
<code>contrib/math/</code>.</li>
|
<code>contrib/math/</code>.</li>
|
||||||
<li>The <code>mod</code> word is now supported for ratios and floating point numbers.</li>
|
<li>The <code>mod</code> word is now supported for ratios and floating point numbers.</li>
|
||||||
<li>The <code>truncate</code>, <code>floor</code> and <code>ceiling</code> words are now supported for floating point numbers.</li>
|
<li>The <code>truncate</code>, <code>floor</code> and <code>ceiling</code> words are now supported for floating point numbers.</li>
|
||||||
|
<li>The NaN, positive infinity and negative infinity floating point numbers now parse and unparse as <code>0.0/0.0</code>, <code>1.0/0.0</code>, and <code>-1.0/0.0</code> respectively.</li>
|
||||||
|
<li>The NaN value is now equal to itself under <code>=</code>.</li>
|
||||||
|
<li>Negative and postive zero are no longer equal under <code>=</code>. However, the new <code>zero?</code> word tests if the top of the stack is a zero, and it tests for both positive and negative zero.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -2,7 +2,7 @@ IN: temporary
|
||||||
USING: html http io kernel namespaces styles test xml ;
|
USING: html http io kernel namespaces styles test xml ;
|
||||||
|
|
||||||
[
|
[
|
||||||
"/responder/foo/?z=%20"
|
"/responder/foo?z=%20"
|
||||||
] [
|
] [
|
||||||
"/responder/foo" H{ { "z" " " } } build-url
|
"/responder/foo" H{ { "z" " " } } build-url
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
! Copyright (C) 2004, 2005 Slava Pestov.
|
! Copyright (C) 2004, 2006 Slava Pestov.
|
||||||
! See http://factor.sf.net/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: alien
|
IN: alien
|
||||||
USING: assembler compiler compiler-backend compiler-frontend
|
USING: assembler compiler compiler-backend compiler-frontend
|
||||||
errors generic hashtables inference inspector io kernel
|
errors generic hashtables inference inspector io kernel
|
||||||
|
@ -116,12 +116,16 @@ C: alien-node make-node ;
|
||||||
c-type [ "boxer" get "reg-class" get ] bind %box ,
|
c-type [ "boxer" get "reg-class" get ] bind %box ,
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
: linearize-cleanup ( node -- )
|
||||||
|
node-param cdr library-abi "stdcall" =
|
||||||
|
[ dup parameters stack-space %cleanup , ] unless ;
|
||||||
|
|
||||||
M: alien-node linearize* ( node -- )
|
M: alien-node linearize* ( node -- )
|
||||||
dup parameters linearize-parameters
|
dup parameters linearize-parameters
|
||||||
dup node-param dup uncons %alien-invoke ,
|
dup node-param uncons %alien-invoke ,
|
||||||
cdr library-abi "stdcall" =
|
dup linearize-cleanup
|
||||||
[ dup parameters stack-space %cleanup , ] unless
|
dup linearize-return
|
||||||
dup linearize-return linearize-next ;
|
linearize-next ;
|
||||||
|
|
||||||
: parse-arglist ( lst -- types stack effect )
|
: parse-arglist ( lst -- types stack effect )
|
||||||
unpair [
|
unpair [
|
||||||
|
|
|
@ -24,7 +24,8 @@ M: float-regs store-insn
|
||||||
M: float-regs load-insn
|
M: float-regs load-insn
|
||||||
[ fastcall-regs nth swap stack@ ] keep MOVSS/LPD ;
|
[ fastcall-regs nth swap stack@ ] keep MOVSS/LPD ;
|
||||||
|
|
||||||
M: stack-params load-insn 3drop ;
|
M: stack-params load-insn
|
||||||
|
drop >r R11 swap stack@ MOV r> stack@ R11 MOV ;
|
||||||
|
|
||||||
M: %unbox generate-node ( vop -- )
|
M: %unbox generate-node ( vop -- )
|
||||||
drop
|
drop
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2005 Slava Pestov.
|
! Copyright (C) 2005, 2006 Slava Pestov.
|
||||||
! See http://factor.sf.net/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien arrays errors hashtables io kernel
|
USING: alien arrays errors hashtables io kernel
|
||||||
kernel-internals lists math namespaces opengl prettyprint
|
kernel-internals math namespaces opengl prettyprint
|
||||||
sequences styles ;
|
sequences styles ;
|
||||||
IN: freetype
|
IN: freetype
|
||||||
|
|
||||||
|
@ -54,19 +54,19 @@ M: font = eq? ;
|
||||||
init-freetype [ close-freetype ] cleanup ; inline
|
init-freetype [ close-freetype ] cleanup ; inline
|
||||||
|
|
||||||
: ttf-name ( font style -- name )
|
: ttf-name ( font style -- name )
|
||||||
cons H{
|
2array H{
|
||||||
{ [[ "monospace" plain ]] "VeraMono" }
|
{ { "monospace" plain } "VeraMono" }
|
||||||
{ [[ "monospace" bold ]] "VeraMoBd" }
|
{ { "monospace" bold } "VeraMoBd" }
|
||||||
{ [[ "monospace" bold-italic ]] "VeraMoBI" }
|
{ { "monospace" bold-italic } "VeraMoBI" }
|
||||||
{ [[ "monospace" italic ]] "VeraMoIt" }
|
{ { "monospace" italic } "VeraMoIt" }
|
||||||
{ [[ "sans-serif" plain ]] "Vera" }
|
{ { "sans-serif" plain } "Vera" }
|
||||||
{ [[ "sans-serif" bold ]] "VeraBd" }
|
{ { "sans-serif" bold } "VeraBd" }
|
||||||
{ [[ "sans-serif" bold-italic ]] "VeraBI" }
|
{ { "sans-serif" bold-italic } "VeraBI" }
|
||||||
{ [[ "sans-serif" italic ]] "VeraIt" }
|
{ { "sans-serif" italic } "VeraIt" }
|
||||||
{ [[ "serif" plain ]] "VeraSe" }
|
{ { "serif" plain } "VeraSe" }
|
||||||
{ [[ "serif" bold ]] "VeraSeBd" }
|
{ { "serif" bold } "VeraSeBd" }
|
||||||
{ [[ "serif" bold-italic ]] "VeraBI" }
|
{ { "serif" bold-italic } "VeraBI" }
|
||||||
{ [[ "serif" italic ]] "VeraIt" }
|
{ { "serif" italic } "VeraIt" }
|
||||||
} hash ;
|
} hash ;
|
||||||
|
|
||||||
: ttf-path ( name -- string )
|
: ttf-path ( name -- string )
|
||||||
|
@ -159,8 +159,8 @@ C: font ( handle -- font )
|
||||||
font-ascent swap glyph-hori-bearing-y - ft-floor 0 3array ;
|
font-ascent swap glyph-hori-bearing-y - ft-floor 0 3array ;
|
||||||
|
|
||||||
: glyph-texture-size ( glyph -- dim )
|
: glyph-texture-size ( glyph -- dim )
|
||||||
dup glyph-bitmap-width next-power-of-2
|
dup glyph-bitmap-width
|
||||||
swap glyph-bitmap-rows next-power-of-2 0 3array ;
|
swap glyph-bitmap-rows 0 3array ;
|
||||||
|
|
||||||
: <char-sprite> ( font char -- sprite )
|
: <char-sprite> ( font char -- sprite )
|
||||||
#! Create a new display list of a rendered glyph. This
|
#! Create a new display list of a rendered glyph. This
|
||||||
|
|
|
@ -19,8 +19,6 @@ GENERIC: ^ ( z w -- z^w ) foldable
|
||||||
: ^theta ( w abs arg -- theta )
|
: ^theta ( w abs arg -- theta )
|
||||||
>r >r >rect r> flog * swap r> * + ; inline
|
>r >r >rect r> flog * swap r> * + ; inline
|
||||||
|
|
||||||
: 0^0 "0^0 is not defined" throw ;
|
|
||||||
|
|
||||||
: 0^ ( z w -- )
|
: 0^ ( z w -- )
|
||||||
dup zero? [
|
dup zero? [
|
||||||
2drop 0.0/0.0
|
2drop 0.0/0.0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
! Copyright (C) 2005 Slava Pestov.
|
! Copyright (C) 2005, 2006 Slava Pestov.
|
||||||
! See http://factor.sf.net/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
IN: opengl
|
IN: opengl
|
||||||
USING: alien errors kernel math namespaces opengl sdl sequences ;
|
USING: alien errors kernel math namespaces opengl sdl sequences ;
|
||||||
|
|
||||||
|
@ -51,14 +51,14 @@ USING: alien errors kernel math namespaces opengl sdl sequences ;
|
||||||
swap [ glMatrixMode glPushMatrix call ] keep
|
swap [ glMatrixMode glPushMatrix call ] keep
|
||||||
glMatrixMode glPopMatrix ; inline
|
glMatrixMode glPopMatrix ; inline
|
||||||
|
|
||||||
|
: top-left drop 0 0 glTexCoord2d 0 0 0 glVertex3d ; inline
|
||||||
|
|
||||||
|
: top-right 1 0 glTexCoord2d first 0 0 glVertex3d ; inline
|
||||||
|
|
||||||
|
: bottom-left 0 1 glTexCoord2d second 0 swap 0 glVertex3d ; inline
|
||||||
|
|
||||||
: gl-vertex first3 glVertex3d ; inline
|
: gl-vertex first3 glVertex3d ; inline
|
||||||
|
|
||||||
: top-left drop 0 0 glTexCoord2d { 0 0 0 } gl-vertex ; inline
|
|
||||||
|
|
||||||
: top-right 1 0 glTexCoord2d { 1 0 0 } v* gl-vertex ; inline
|
|
||||||
|
|
||||||
: bottom-left 0 1 glTexCoord2d { 0 1 0 } v* gl-vertex ; inline
|
|
||||||
|
|
||||||
: bottom-right 1 1 glTexCoord2d gl-vertex ; inline
|
: bottom-right 1 1 glTexCoord2d gl-vertex ; inline
|
||||||
|
|
||||||
: four-sides ( dim -- )
|
: four-sides ( dim -- )
|
||||||
|
|
|
@ -27,3 +27,9 @@ FUNCTION: double ffi_test_7 double x double y ; compiled
|
||||||
FUNCTION: double ffi_test_8 double x float y double z float t int w ; compiled
|
FUNCTION: double ffi_test_8 double x float y double z float t int w ; compiled
|
||||||
[ 19.0 ] [ 3.0 2.0 1.0 6.0 7 ffi_test_8 ] unit-test
|
[ 19.0 ] [ 3.0 2.0 1.0 6.0 7 ffi_test_8 ] unit-test
|
||||||
|
|
||||||
|
FUNCTION: int ffi_test_9 int a int b int c int d int e int f int g ; compiled
|
||||||
|
[ 28 ] [ 1 2 3 4 5 6 7 ffi_test_9 ] unit-test
|
||||||
|
|
||||||
|
FUNCTION: int ffi_test_10 int a int b double c int d float e int f int g int h ; compiled
|
||||||
|
[ -34 ] [ 1 2 3 4 5 6 7 8 ffi_test_10 ] unit-test
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ USING: kernel math namespaces prettyprint test ;
|
||||||
[ 134217728 dup + dup + dup + dup + dup + dup + unparse ]
|
[ 134217728 dup + dup + dup + dup + dup + dup + unparse ]
|
||||||
unit-test
|
unit-test
|
||||||
|
|
||||||
[ 0 0 ^ ] unit-test-fails
|
[ 0.0/0.0 ] [ 0 0 ^ ] unit-test
|
||||||
[ 1 ] [ 10 0 ^ ] unit-test
|
[ 1 ] [ 10 0 ^ ] unit-test
|
||||||
[ 1/8 ] [ 1/2 3 ^ ] unit-test
|
[ 1/8 ] [ 1/2 3 ^ ] unit-test
|
||||||
[ 1/8 ] [ 2 -3 ^ ] unit-test
|
[ 1/8 ] [ 2 -3 ^ ] unit-test
|
||||||
|
|
|
@ -109,4 +109,5 @@ SYMBOL: failures
|
||||||
"compiler/generic" "compiler/bail-out"
|
"compiler/generic" "compiler/bail-out"
|
||||||
"compiler/linearizer" "compiler/intrinsics"
|
"compiler/linearizer" "compiler/intrinsics"
|
||||||
"compiler/identities" "compiler/optimizer"
|
"compiler/identities" "compiler/optimizer"
|
||||||
|
"compiler/alien"
|
||||||
} run-tests ;
|
} run-tests ;
|
||||||
|
|
|
@ -54,3 +54,15 @@ double ffi_test_8(double x, float y, double z, float t, int w)
|
||||||
printf("ffi_test_8(%f,%f,%f,%f,%d)\n",x,y,z,t,w);
|
printf("ffi_test_8(%f,%f,%f,%f,%d)\n",x,y,z,t,w);
|
||||||
return x * y + z * t + w;
|
return x * y + z * t + w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ffi_test_9(int a, int b, int c, int d, int e, int f, int g)
|
||||||
|
{
|
||||||
|
printf("ffi_test_9(%d,%d,%d,%d,%d,%d,%d)\n",a,b,c,d,e,f,g);
|
||||||
|
return a + b + c + d + e + f + g;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ffi_test_10(int a, int b, double c, int d, float e, int f, int g, int h)
|
||||||
|
{
|
||||||
|
printf("ffi_test_10(%d,%d,%f,%d,%f,%d,%d,%d)\n",a,b,c,d,e,f,g,h);
|
||||||
|
return a - b - c - d - e - f - g - h;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue