Commit 5cf3c425 authored by Paul Khuong's avatar Paul Khuong
Browse files

1.0.24.34: IR2: additional representation for predicates, conditional moves

 * :CONDITIONAL VOPs can now specify how to interpret the test
   they compute without performing the branch directly. How the
   test is specified is completely platform-dependent and only
   affects new-style :CONDITIONAL VOPs and a new BRANCH-IF VOP
   (src/compiler/$ARCH/pred.lisp).

 * Candidates for conversion to conditional moves are found
   and may be converted, depending on CONVERT-CONDITIONAL-MOVE-P,
   a new VM support routine. C-C-M-P returns NIL to punt on the
   conversion, or 5 values:
    1. name of the VOP to use
    2. TN for the first argument (NIL if none)
    3. TN for the second argument (NIL if none)
    4. TN for the result
    5. A list of info data, which will be appended to the flags

   The correct values will be MOVEd in the argument TNs if needed
   before computing the condition, and the result MOVEd to the right
   TN after the conditional move VOP.
parent 06a3d298
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -631,6 +631,7 @@

 ("src/compiler/copyprop")
 ("src/compiler/represent")
 ("src/compiler/ir2opt")
 ("src/compiler/pack")
 ("src/compiler/codegen")
 ("src/compiler/debug")
+3 −1
Original line number Diff line number Diff line
@@ -380,7 +380,9 @@ of SBCL which maintained the CMU-CL-style split into two packages.)"
               "VM-SUPPORT-ROUTINES-LOCATION-NUMBER"

               "WITH-SOURCE-LOCATION"
               "*SOURCE-LOCATION-THUNKS*"))
               "*SOURCE-LOCATION-THUNKS*"

               "BRANCH-IF"))

   #s(sb-cold:package-data
      :name "SB!DEBUG"
+18 −0
Original line number Diff line number Diff line
@@ -20,6 +20,24 @@
  (:info dest)
  (:generator 5
    (inst br zero-tn dest)))


;;;; Generic conditional VOPs

;;; The generic conditional branch, emitted immediately after test
;;; VOPs that only set flags.

(define-vop (branch-if)
  (:info dest flags not-p)
  (:ignore dest flags not-p)
  (:generator 0
     (error "BRANCH-IF not yet implemented")))

(!def-vm-support-routine
    convert-conditional-move-p (node dst-tn x-tn y-tn)
  (declare (ignore node dst-tn x-tn y-tn))
  nil)


;;;; conditional VOPs

+3 −0
Original line number Diff line number Diff line
@@ -194,6 +194,9 @@
    make-dynamic-state-tns
    make-nlx-entry-arg-start-location

    ;; from pred.lisp
    convert-conditional-move-p

    ;; from support.lisp
    generate-call-sequence
    generate-return-sequence
+1 −1
Original line number Diff line number Diff line
@@ -642,7 +642,7 @@
                                   atypes)
                     (template-more-args-type info) "args")
      (check-tn-refs (vop-results vop) vop t
                     (if (eq rtypes :conditional) 0 (length rtypes))
                     (if (template-conditional-p info) 0 (length rtypes))
                     (template-more-results-type info) "results")
      (check-tn-refs (vop-temps vop) vop t 0 t "temps")
      (unless (= (length (vop-codegen-info vop))
Loading