picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit bd4b0e0aa5d742992e7fc94d67b1ddc3c67f067e
parent 9bceb9de223beecfd086c5b817aef394f4a7c871
Author: Commit-Bot <unknown>
Date:   Wed,  2 Jun 2010 14:28:37 +0000

Automatic commit from picoLisp.tgz, From: Wed, 02 Jun 2010 14:28:37 GMT
Diffstat:
Mdoc64/asm | 7++++---
Mdoc64/structures | 3++-
Msrc64/arch/x86-64.l | 47++++++++++++++++++++++++++++-------------------
Msrc64/err.l | 4++--
Msrc64/flow.l | 6+++---
Msrc64/lib/asm.l | 5+++--
Msrc64/main.l | 4++--
7 files changed, 44 insertions(+), 32 deletions(-)

diff --git a/doc64/asm b/doc64/asm @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger @@ -91,9 +91,11 @@ st2 dst # Store two bytes from 'A' into 'dst' st4 dst # Store four bytes from 'A' into 'dst' xchg dst dst # Exchange 'dst's - movm dst src end # Move (aligned) memory 'src'..'end' to 'dst' movn dst src cnt # Move 'cnt' bytes from 'src' to 'dst' mset dst cnt # Set 'cnt' bytes of memory to B + movm dst src end # Move memory 'src'..'end' to 'dst' (aligned) + save src end dst # Save 'src'..'end' to 'dst' (non-overlapping) + load dst end src # Load 'dst'..'end' from 'src' (non-overlapping) Arithmetics: add dst src # Add 'src' to 'dst' @@ -132,7 +134,6 @@ Comparisons: cmp dst src # Compare 'dst' with 'src' [z.c] cmp4 src # Compare four bytes in 'A' with 'src' - cmpm dst src end # Compare (aligned) memory 'dst' with 'src'..'end' cmpn dst src cnt # Compare 'cnt' bytes 'dst' with 'src' slen dst src # Set 'dst' to the string length of 'src' memb src cnt # Find B in 'cnt' bytes of memory diff --git a/doc64/structures b/doc64/structures @@ -1,4 +1,4 @@ -# 06mar10abu +# 02jun10abu # (c) Software Lab. Alexander Burger @@ -289,6 +289,7 @@ +-------------+-+---- 0 BLK + dbFile: # Size VIII (64 bytes) --> fd # File descriptor <I> db # File number diff --git a/src64/arch/x86-64.l b/src64/arch/x86-64.l @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger # Byte order @@ -266,15 +266,6 @@ (asm xchg (Dst D Dst2 D2) (dstDst "xchg" (dst Dst D) (src Dst2 D2)) ) -(asm movm (Dst D Src S End E) - (lea Dst D "%rdi") - (lea Src S "%rsi") - (lea End E "%rcx") - (prinst "sub" "%rsi" "%rcx") - (prinst "shr" "$3" "%rcx") - (prinst "cld") - (prinst "rep movsq") ) - (asm movn (Dst D Src S Cnt C) (lea Dst D "%rdi") (lea Src S "%rsi") @@ -289,6 +280,33 @@ (prinst "cld") (prinst "rep stosb") ) +(asm movm (Dst D Src S End E) + (lea Dst D "%rdi") + (lea Src S "%rsi") + (lea End E "%rcx") + (prinst "sub" "%rsi" "%rcx") + (prinst "shr" "$3" "%rcx") + (prinst "cld") + (prinst "rep movsq") ) + +(asm save (Src S End E Dst D) + (lea Src S "%rsi") + (lea End E "%rcx") + (lea Dst D "%rdi") + (prinst "sub" "%rsi" "%rcx") + (prinst "shr" "$3" "%rcx") + (prinst "cld") + (prinst "rep movsq") ) + +(asm load (Dst D End E Src S) + (lea Dst D "%rdi") + (lea End E "%rcx") + (lea Src S "%rsi") + (prinst "sub" "%rdi" "%rcx") + (prinst "shr" "$3" "%rcx") + (prinst "cld") + (prinst "rep movsq") ) + # Arithmetics (asm add (Dst D Src S) @@ -407,15 +425,6 @@ (asm cmp4 (Src S) (prinst "cmp" (src Src S) "%eax") ) -(asm cmpm (Dst D Src S End E) - (lea Dst D "%rdi") - (lea Src S "%rdi") - (lea End E "%rcx") - (prinst "sub" "%rsi" "%rcx") - (prinst "shr" "$3" "%rcx") - (prinst "cld") - (prinst "repnz cmpsq") ) - (asm cmpn (Dst D Src S Cnt C) (setq Dst (dst Dst D)) (prinst (if (pre? "%" Dst) "mov" "lea") Dst "%rsi") diff --git a/src64/err.l b/src64/err.l @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger # Debug print routine @@ -247,7 +247,7 @@ while nz # Yes call popCtlFiles # Clean up loop - movm (Env) (X III) (X (pack III "+EnvEnd-Env")) # Restore environment + load (Env) (EnvEnd) (X III) # Restore environment ld E (X II) # 'fin' eval # Evaluate 'finally' expression cmp X (S) # Reached target catch frame? diff --git a/src64/flow.l b/src64/flow.l @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger (code 'redefMsgEC) @@ -2485,7 +2485,7 @@ ld X (X CDR) # X on body eval # Evaluate tag sub S "(EnvEnd-Env)" # Build catch frame - movm (S) (Env) (EnvEnd) # Save environment + save (Env) (EnvEnd) (S) # Save environment push ZERO # 'fin' push E # 'tag' push (Catch) # Link @@ -2536,7 +2536,7 @@ (code 'doFinally 2) push X sub S "(EnvEnd-Env)" # Build catch frame - movm (S) (Env) (EnvEnd) # Save environment + save (Env) (EnvEnd) (S) # Save environment ld X (E CDR) push (X) # 'exe' -> 'fin' ld X (X CDR) diff --git a/src64/lib/asm.l b/src64/lib/asm.l @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger # *LittleEndian *Registers optimize @@ -390,7 +390,6 @@ (clrz) (cmp (destination) "*Mode" (source) "*Mode") (cmp4 (source) "*Mode") - (cmpm (destination) "*Mode" (source) "*Mode" (source) "*Mode") (cmpn (destination) "*Mode" (source) "*Mode" (source) "*Mode") (cnt (source) "*Mode") (dbg) @@ -433,6 +432,7 @@ (ldz (destination) "*Mode" (source) "*Mode") (lea (destination) "*Mode" (source) "*Mode") (link) + (load (destination) "*Mode" (destination) "*Mode" (source) "*Mode") (memb (source) "*Mode" (source) "*Mode") (movm (destination) "*Mode" (source) "*Mode" (source) "*Mode") (movn (destination) "*Mode" (source) "*Mode" (source) "*Mode") @@ -456,6 +456,7 @@ (return (operand (read))) (rol (destination) "*Mode" (source) "*Mode") (ror (destination) "*Mode" (source) "*Mode") + (save (source) "*Mode" (source) "*Mode" (destination) "*Mode") (set (destination) "*Mode" (source) "*Mode") (setc) (setz) diff --git a/src64/main.l b/src64/main.l @@ -1,4 +1,4 @@ -# 01jun10abu +# 02jun10abu # (c) Software Lab. Alexander Burger ### Global return labels ### @@ -1425,7 +1425,7 @@ ld X S # Start of args ld C L # Top of args sub C X # Bytes - sub S C # Duplicate + sub S C # Duplicate args movm (S) (X) (L) ld Y (Z) # Get function pointer cc (Y) X # Call C-function