<commit_before>(cl:in-package #:cleavir-ast-to-mir)

(defun compile-and-unbox-arguments
    (arguments temps unbox-instruction-class successor)
  (loop with succ = successor
	for arg in (reverse arguments)
	for temp in (reverse temps)
	for inter = (make-temp nil)
	do (setf succ
		 (make-instance unbox-instruction-class
		   :inputs (list inter)
		   :outputs (list temp)
		   :successors (list succ)))
	   (setf succ (compile-ast arg (context `(,inter) `(,succ))))
	finally (return succ)))

(defun check-context-for-boolean-ast (context)
  (assert (and (zerop (length (results context)))
	       (= (length (successors context)) 2))))

(defmethod compile-ast ((ast cleavir-ast:short-float-less-ast) context)
  (check-context-for-boolean-ast context)
  (let* ((arguments (cleavir-ast:children ast))
	 (temps (make-temps arguments)))
    (compile-and-unbox-arguments
     arguments
     temps
     'cleavir-mir:short-float-unbox-instruction
     (make-instance 'cleavir-mir:short-float-less-instruction
       :inputs temps
       :outputs '()
       :successors (successors context)))))
     
(defmethod compile-ast ((ast cleavir-ast:short-float-not-greater-ast) context)
  (check-context-for-boolean-ast context)
  (let* ((arguments (cleavir-ast:children ast))
	 (temps (make-temps arguments)))
    (compile-and-unbox-arguments
     arguments
     temps
     'cleavir-mir:short-float-unbox-instruction
     (make-instance 'cleavir-mir:short-float-not-greater-instruction
       :inputs temps
       :outputs '()
       :successors (successors context)))))<commit_msg>Method for compiling SHORT-FLOAT-GREATER-AST.<commit_after>(cl:in-package #:cleavir-ast-to-mir)

(defun compile-and-unbox-arguments
    (arguments temps unbox-instruction-class successor)
  (loop with succ = successor
	for arg in (reverse arguments)
	for temp in (reverse temps)
	for inter = (make-temp nil)
	do (setf succ
		 (make-instance unbox-instruction-class
		   :inputs (list inter)
		   :outputs (list temp)
		   :successors (list succ)))
	   (setf succ (compile-ast arg (context `(,inter) `(,succ))))
	finally (return succ)))

(defun check-context-for-boolean-ast (context)
  (assert (and (zerop (length (results context)))
	       (= (length (successors context)) 2))))

(defmethod compile-ast ((ast cleavir-ast:short-float-less-ast) context)
  (check-context-for-boolean-ast context)
  (let* ((arguments (cleavir-ast:children ast))
	 (temps (make-temps arguments)))
    (compile-and-unbox-arguments
     arguments
     temps
     'cleavir-mir:short-float-unbox-instruction
     (make-instance 'cleavir-mir:short-float-less-instruction
       :inputs temps
       :outputs '()
       :successors (successors context)))))
     
(defmethod compile-ast ((ast cleavir-ast:short-float-not-greater-ast) context)
  (check-context-for-boolean-ast context)
  (let* ((arguments (cleavir-ast:children ast))
	 (temps (make-temps arguments)))
    (compile-and-unbox-arguments
     arguments
     temps
     'cleavir-mir:short-float-unbox-instruction
     (make-instance 'cleavir-mir:short-float-not-greater-instruction
       :inputs temps
       :outputs '()
       :successors (successors context)))))

(defmethod compile-ast ((ast cleavir-ast:short-float-greater-ast) context)
  (check-context-for-boolean-ast context)
  (let* ((arguments (cleavir-ast:children ast))
	 (temps (make-temps arguments)))
    (compile-and-unbox-arguments
     arguments
     temps
     'cleavir-mir:short-float-unbox-instruction
     (make-instance 'cleavir-mir:short-float-less-instruction
       :inputs (reverse temps)
       :outputs '()
       :successors (successors context)))))
{'fraction_non_alphanumeric': 0.1375894331315355, 'fraction_numerical': 0.000550357732526142, 'mean_word_length': 3.6070975918884662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7371216', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1141, 'n_words': 259}