Stop inc-not-f and dec-not-f, etc

master
kusumotonorio 2020-01-19 14:30:38 +09:00
parent bb7777e0cf
commit 2ee51f50e2
2 changed files with 6 additions and 11 deletions

View File

@ -12,25 +12,19 @@ SYMBOL: struct-return-area
SYMBOLS: int-reg-reps float-reg-reps ;
<PRIVATE
: inc-not-f ( variable -- ) dup get [ inc ] [ drop ] if ; inline
: dec-not-f ( variable -- ) dup get [ dec ] [ drop ] if ; inline
PRIVATE>
: record-reg-reps ( reps -- reps )
dup [
dup second not [ ! on-stack?: f
first int-rep? int-reg-reps float-reg-reps ? inc-not-f
first int-rep? int-reg-reps float-reg-reps ?
dup get [ inc ] [ drop ] if
] [ drop ] if
] each ;
: unrecord-reg-reps ( reps -- reps )
dup [
dup second not [ ! on-stack?: f
first int-rep? int-reg-reps float-reg-reps ? dec-not-f
first int-rep? int-reg-reps float-reg-reps ?
dup get [ dec ] [ drop ] if
] [ drop ] if
] each ;

View File

@ -27,7 +27,8 @@ M: x86.64 reserved-stack-space 0 ;
:: flatten-small-struct ( c-type -- seq )
c-type struct-types&offset split-struct [
[ lookup-c-type c-type-rep reg-class-of ] map
int-regs swap member? int-rep double-rep ? f f 3array
int-regs swap member? int-rep double-rep ?
f f 3array
] map :> reps
int-reg-reps get float-reg-reps get and [
0 :> int-mems!