diff options
author | Paul A. Patience <paul@apatience.com> | 2021-09-12 00:43:22 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-09-14 00:19:02 -0700 |
commit | 7c174401f4926683d26e5b638b95d8956cfdb211 (patch) | |
tree | dba83899339f3621eb26d9e6bddf7c42855127b3 /stdlib/optimize.tl | |
parent | 44f4ef01ce095d334769b071460f19c5d74217c3 (diff) | |
download | txr-7c174401f4926683d26e5b638b95d8956cfdb211.tar.gz txr-7c174401f4926683d26e5b638b95d8956cfdb211.tar.bz2 txr-7c174401f4926683d26e5b638b95d8956cfdb211.zip |
defset: add set-mask and clear-mask.
* stdlib/defset.tl (set-mask, clear-mask): New update macros.
* stdlib/optimize.tl (calc-liveness): Use the new macros.
* stdlib/socket.tl (sys:str-inaddr-net-impl, str-in6addr-net):
Same.
* stdlib/termios.tl (set-iflags, set-oflags, set-cflags,
set-lflags, clear-iflags, clear-oflags, clear-cflags,
clear-lflags): Same.
* lisplib.c (defset_set_entries): Add set-mask and clear-mask
to autoload symbols for defset.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/optimize.tl')
-rw-r--r-- | stdlib/optimize.tl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl index 8a7bce71..8d2c1f5c 100644 --- a/stdlib/optimize.tl +++ b/stdlib/optimize.tl @@ -24,6 +24,7 @@ ;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;; POSSIBILITY OF SUCH DAMAGE. + (compile-only (defstruct live-info nil (defined 0) @@ -252,8 +253,8 @@ ((fi . re) (let* ((live (upd-used bl re live)) (lif [bb.li-hash fi])) - (set live (logand live (lognot lif.defined))) - (set lif.used (logior live lif.used)) + (clear-mask live lif.defined) + (set-mask lif.used live) live)) (else live))) (visit (bl) @@ -265,12 +266,12 @@ (old-live (or bl.live 0))) (each ((nx bl.links)) (visit nx) - (set used (logior used nx.used))) + (set-mask used nx.used)) (when (neql (set bl.live (logior used old-live)) old-live) (let ((live-in (logand (upd-used bl bl.insns bl.live) (lognot bl.defined)))) - (set bl.used (logior live-in bl.used))) + (set-mask bl.used live-in)) (set changed t)))))) (set changed nil) (visit bb.root)))))) |