Fix complex float support on NetBSD

db4
sheeple 2009-02-12 08:10:21 -06:00
parent facd455e92
commit 3c1ddde1f9
3 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,13 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.complex.functor sequences kernel ;
USING: alien.c-types alien.complex.functor accessors
sequences kernel ;
IN: alien.complex
<< { "float" "double" } [ dup "complex-" prepend define-complex-type ] each >>
<<
{ "float" "double" } [ dup "complex-" prepend define-complex-type ] each
! This overrides the fact that small structures are never returned
! in registers on NetBSD, Linux and Solaris running on 32-bit x86.
"complex-float" c-type t >>return-in-registers? drop
>>

View File

@ -14,7 +14,9 @@ fields
{ unboxer-quot callable }
{ getter callable }
{ setter callable }
return-in-registers ;
return-in-registers? ;
M: struct-type c-type ;
M: struct-type heap-size size>> ;

View File

@ -53,7 +53,7 @@ M: x86.32 return-struct-in-registers? ( c-type -- ? )
[ return-in-registers?>> ]
[ heap-size { 1 2 4 8 } member? ] bi
os { linux netbsd solaris } member? not
and and ;
and or ;
: struct-return@ ( n -- operand )
[ next-stack@ ] [ stack-frame get params>> stack@ ] if* ;