image: use inline assembly for n:inc and n:dec

FossilOrigin-Name: 3e31ec7bcd7ae0c6c415a8dab10709d8525f9b1a369e7a6f7dd9157c18ca06d3
This commit is contained in:
crc 2021-06-04 12:20:10 +00:00
parent 41b3c18145
commit db64b92476
5 changed files with 603 additions and 596 deletions

View file

@ -31,6 +31,14 @@
- `s:split-on-string`
- `s:split`
## Hooks
- `d:create` is now a hook
## Performance
- use inline assembly for `n:inc` and `n:dec`
## I/O
- floating point

View file

@ -174,7 +174,7 @@ curry nq-q - - Bind a value to a function and return a new quote that calls the
d n- - - Inline a numeric value to the current assembly segment. class:word {n/a} {n/a} global all
d:add-header saa- - - Vectored. Create a header. Provide a string (s) for the name, a pointer to the class handler (a1) and a pointer to the word definition (a2) Generally this won't be used directly. class:word {n/a} {n/a} d all
d:class d-a - - Given a dictionary header, return the class field. class:word {n/a} {n/a} d all
d:create s- - - Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. class:word {n/a} {n/a} d all
d:create s- - - Hook. Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. class:word {n/a} {n/a} d all
d:for-each q- - - Execute the specified quote once for each header in the dictionary. Before running the quote, this also pushes a pointer to the header onto the stack. class:word {n/a} {n/a} d all
d:last -d - - Return the most recent dictionary header. class:word {n/a} {n/a} d all
d:last.class -a - - Return a pointer to the class field of the most recent dictionary header. class:word {n/a} {n/a} d all

1 $ -c - - Return ASCII:NUL (0). class:macro {n/a} {n/a} global all
174 d n- - - Inline a numeric value to the current assembly segment. class:word {n/a} {n/a} global all
175 d:add-header saa- - - Vectored. Create a header. Provide a string (s) for the name, a pointer to the class handler (a1) and a pointer to the word definition (a2) Generally this won't be used directly. class:word {n/a} {n/a} d all
176 d:class d-a - - Given a dictionary header, return the class field. class:word {n/a} {n/a} d all
177 d:create s- - - Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. Hook. Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. class:word {n/a} {n/a} d all
178 d:for-each q- - - Execute the specified quote once for each header in the dictionary. Before running the quote, this also pushes a pointer to the header onto the stack. class:word {n/a} {n/a} d all
179 d:last -d - - Return the most recent dictionary header. class:word {n/a} {n/a} d all
180 d:last.class -a - - Return a pointer to the class field of the most recent dictionary header. class:word {n/a} {n/a} d all

View file

@ -549,8 +549,8 @@ which I'll provide here.
~~~
:if; (qf-) over &if dip 0; pop drop-pair ;
:-if; (qf-) over &-if dip not 0; pop drop-pair ;
:if: (f-) #25 , #3 , ; immediate
:-if: (f-) #1644289 , #-1 , #3 , ; immediate
:if: (f-) (zr...... #25 , (dr...... #3 , ; immediate
:-if: (f-) (lixozr.. #1644289 , #-1 , (dr...... #3 , ; immediate
~~~
## More Stack Shufflers.
@ -591,8 +591,8 @@ so they can be inlined. Here's the high level forms:
:n:max (nn-n) dup-pair gt? [ drop ] [ nip ] choose ;
:n:abs (n-n) dup n:negative? &n:negate if ;
:n:limit (nlu-n) swap push n:min pop n:max ;
:n:inc (n-n) #1 + ;
:n:dec (n-n) #1 - ;
:n:inc (n-n) \liadre.. `1 ;
:n:dec (n-n) \lisure.. `1 ;
:n:between? (nul-) rot [ rot rot n:limit ] sip eq? ;
~~~

BIN
ngaImage

Binary file not shown.

File diff suppressed because it is too large Load diff