Opened 9 years ago

Closed 9 years ago

#805 closed enhancement (fixed)

(logand #xffffffff ...) and (ldb (byte 32 0) ...)

Reported by: rme Owned by: gb
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:


Test case from Zach Beane.

Ideally, both the (logand #xf... ...) and (ldb (byte 32 0) ...) would open-code nicely in this case (on a 64-bit lisp, anyway).

(defun ldb-logand-diff (a b)
  (declare (type (unsigned-byte 32) a b))
  (let (x y)
    (setf x (logand #xFFFFFFFF (+ a b)))
    (setf y (ldb (byte 32 0) (+ b a)))
    (values x y)))

I could imagine hairing up the compiler macro on LDB, but maybe there's a better idea.

Change History (3)

comment:1 Changed 9 years ago by xach

This enhancement would greatly improve Ironclad's performance on CCL, since it uses the ldb style exclusively.

comment:2 Changed 9 years ago by gb

  • Owner set to gb
  • Status changed from new to assigned

comment:3 Changed 9 years ago by gb

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [14559]) In LDB compiler macro, just do a LOGAND if the bytespec's position is 0.

Fixes ticket:805.

Note: See TracTickets for help on using tickets.