mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 14:30:34 +02:00
Add assume-u64 and assume-s64 dataflow restrictions
* module/language/cps/effects-analysis.scm:: * module/language/cps/reify-primitives.scm (reify-primitives): * module/language/cps/slot-allocation.scm (compute-var-representations): * module/language/cps/types.scm (assume-u64, assume-s64): Add primitives that assume the range of a u64 or s64 value is within certain bounds. This is useful when extracting e.g. a length from a 64-bit word when you know the length is less than 2**48.
This commit is contained in:
parent
94fdc5cad9
commit
4829cb3ce9
4 changed files with 19 additions and 0 deletions
|
@ -754,6 +754,7 @@ are comparable with eqv?. A tmp slot may be used."
|
|||
(($ $primcall (or 'scm->u64 'scm->u64/truncate 'load-u64
|
||||
'char->integer 's64->u64
|
||||
'bv-length 'string-length
|
||||
'assume-u64
|
||||
'uadd 'usub 'umul
|
||||
'ulogand 'ulogior 'ulogxor 'ulogsub 'ursh 'ulsh
|
||||
'uadd/immediate 'usub/immediate 'umul/immediate
|
||||
|
@ -763,6 +764,7 @@ are comparable with eqv?. A tmp slot may be used."
|
|||
'word-ref 'word-ref/immediate))
|
||||
(intmap-add representations var 'u64))
|
||||
(($ $primcall (or 'untag-fixnum
|
||||
'assume-s64
|
||||
'scm->s64 'load-s64 'u64->s64
|
||||
'srsh 'srsh/immediate
|
||||
's8-ref 's16-ref 's32-ref 's64-ref
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue