AMD64 FFI fixes; httpd load fix; minor opengl optimization

cvs
Slava Pestov 2006-01-30 07:03:34 +00:00
parent ff09d4c559
commit fd59c87eae
11 changed files with 62 additions and 37 deletions

View File

@ -48,6 +48,9 @@ this is lexicographic order, and for words, this compares word names.</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>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>
</li>

View File

@ -2,7 +2,7 @@ IN: temporary
USING: html http io kernel namespaces styles test xml ;
[
"/responder/foo/?z=%20"
"/responder/foo?z=%20"
] [
"/responder/foo" H{ { "z" " " } } build-url
] unit-test

View File

@ -1,5 +1,5 @@
! Copyright (C) 2004, 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
! Copyright (C) 2004, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: alien
USING: assembler compiler compiler-backend compiler-frontend
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 ,
] if ;
: linearize-cleanup ( node -- )
node-param cdr library-abi "stdcall" =
[ dup parameters stack-space %cleanup , ] unless ;
M: alien-node linearize* ( node -- )
dup parameters linearize-parameters
dup node-param dup uncons %alien-invoke ,
cdr library-abi "stdcall" =
[ dup parameters stack-space %cleanup , ] unless
dup linearize-return linearize-next ;
dup node-param uncons %alien-invoke ,
dup linearize-cleanup
dup linearize-return
linearize-next ;
: parse-arglist ( lst -- types stack effect )
unpair [

View File

@ -24,7 +24,8 @@ M: float-regs store-insn
M: float-regs load-insn
[ 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 -- )
drop

View File

@ -1,7 +1,7 @@
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
! Copyright (C) 2005, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien arrays errors hashtables io kernel
kernel-internals lists math namespaces opengl prettyprint
kernel-internals math namespaces opengl prettyprint
sequences styles ;
IN: freetype
@ -54,19 +54,19 @@ M: font = eq? ;
init-freetype [ close-freetype ] cleanup ; inline
: ttf-name ( font style -- name )
cons H{
{ [[ "monospace" plain ]] "VeraMono" }
{ [[ "monospace" bold ]] "VeraMoBd" }
{ [[ "monospace" bold-italic ]] "VeraMoBI" }
{ [[ "monospace" italic ]] "VeraMoIt" }
{ [[ "sans-serif" plain ]] "Vera" }
{ [[ "sans-serif" bold ]] "VeraBd" }
{ [[ "sans-serif" bold-italic ]] "VeraBI" }
{ [[ "sans-serif" italic ]] "VeraIt" }
{ [[ "serif" plain ]] "VeraSe" }
{ [[ "serif" bold ]] "VeraSeBd" }
{ [[ "serif" bold-italic ]] "VeraBI" }
{ [[ "serif" italic ]] "VeraIt" }
2array H{
{ { "monospace" plain } "VeraMono" }
{ { "monospace" bold } "VeraMoBd" }
{ { "monospace" bold-italic } "VeraMoBI" }
{ { "monospace" italic } "VeraMoIt" }
{ { "sans-serif" plain } "Vera" }
{ { "sans-serif" bold } "VeraBd" }
{ { "sans-serif" bold-italic } "VeraBI" }
{ { "sans-serif" italic } "VeraIt" }
{ { "serif" plain } "VeraSe" }
{ { "serif" bold } "VeraSeBd" }
{ { "serif" bold-italic } "VeraBI" }
{ { "serif" italic } "VeraIt" }
} hash ;
: ttf-path ( name -- string )
@ -159,8 +159,8 @@ C: font ( handle -- font )
font-ascent swap glyph-hori-bearing-y - ft-floor 0 3array ;
: glyph-texture-size ( glyph -- dim )
dup glyph-bitmap-width next-power-of-2
swap glyph-bitmap-rows next-power-of-2 0 3array ;
dup glyph-bitmap-width
swap glyph-bitmap-rows 0 3array ;
: <char-sprite> ( font char -- sprite )
#! Create a new display list of a rendered glyph. This

View File

@ -19,8 +19,6 @@ GENERIC: ^ ( z w -- z^w ) foldable
: ^theta ( w abs arg -- theta )
>r >r >rect r> flog * swap r> * + ; inline
: 0^0 "0^0 is not defined" throw ;
: 0^ ( z w -- )
dup zero? [
2drop 0.0/0.0

View File

@ -1,5 +1,5 @@
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
! Copyright (C) 2005, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: opengl
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
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
: 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
: four-sides ( dim -- )

View File

@ -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
[ 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

View File

@ -67,7 +67,7 @@ USING: kernel math namespaces prettyprint test ;
[ 134217728 dup + dup + dup + dup + dup + dup + unparse ]
unit-test
[ 0 0 ^ ] unit-test-fails
[ 0.0/0.0 ] [ 0 0 ^ ] unit-test
[ 1 ] [ 10 0 ^ ] unit-test
[ 1/8 ] [ 1/2 3 ^ ] unit-test
[ 1/8 ] [ 2 -3 ^ ] unit-test

View File

@ -109,4 +109,5 @@ SYMBOL: failures
"compiler/generic" "compiler/bail-out"
"compiler/linearizer" "compiler/intrinsics"
"compiler/identities" "compiler/optimizer"
"compiler/alien"
} run-tests ;

View File

@ -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);
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;
}