... |
... |
@@ -3537,8 +3537,59 @@ |
3537
|
3537
|
(deftransform > ((x y) (real real) * :when :both)
|
3538
|
3538
|
(ir1-transform-< y x x y '<))
|
3539
|
3539
|
|
|
3540
|
+#+(and x86)
|
|
3541
|
+(defun ir1-transform->=-helper (x y)
|
|
3542
|
+ (flet ((maybe-convert (type)
|
|
3543
|
+ (numeric-type->interval
|
|
3544
|
+ (cond ((numeric-type-p type) type)
|
|
3545
|
+ ((member-type-p type) (convert-member-type type))
|
|
3546
|
+ (t (give-up))))))
|
|
3547
|
+ (let ((xi (mapcar #'maybe-convert
|
|
3548
|
+ (prepare-arg-for-derive-type (continuation-type x))))
|
|
3549
|
+ (yi (mapcar #'maybe-convert
|
|
3550
|
+ (prepare-arg-for-derive-type (continuation-type y))))
|
|
3551
|
+ (definitely-true t)
|
|
3552
|
+ (definitely-false t))
|
|
3553
|
+ (dolist (x-arg xi)
|
|
3554
|
+ (dolist (y-arg yi)
|
|
3555
|
+ (setf definitely-true (and definitely-true
|
|
3556
|
+ (interval->= x-arg y-arg)))
|
|
3557
|
+ (setf definitely-false (and definitely-false
|
|
3558
|
+ (interval-< x-arg y-arg)))))
|
|
3559
|
+ (values definitely-true definitely-false))))
|
3540
|
3560
|
|
3541
|
|
-#+x86
|
|
3561
|
+#+(and x86)
|
|
3562
|
+(defun ir1-transform->= (x y first second inverse)
|
|
3563
|
+ (if (same-leaf-ref-p x y)
|
|
3564
|
+ 't
|
|
3565
|
+ (multiple-value-bind (definitely-true definitely-false)
|
|
3566
|
+ (ir1-transform->=-helper x y)
|
|
3567
|
+ (cond (definitely-true
|
|
3568
|
+ t)
|
|
3569
|
+ (definitely-false
|
|
3570
|
+ nil)
|
|
3571
|
+ ((and (constant-continuation-p first)
|
|
3572
|
+ (not (constant-continuation-p second)))
|
|
3573
|
+ #+nil
|
|
3574
|
+ (format t "swapping ~A~%" inverse)
|
|
3575
|
+ `(,inverse y x))
|
|
3576
|
+ (t
|
|
3577
|
+ (give-up))))))
|
|
3578
|
+
|
|
3579
|
+#+(and x86)
|
|
3580
|
+(deftransform <= ((x y) (real real) * :when :both)
|
|
3581
|
+ #+nli
|
|
3582
|
+ (format t "transform <=~%")
|
|
3583
|
+ (ir1-transform->= y x x y '>=))
|
|
3584
|
+
|
|
3585
|
+#+(and x86)
|
|
3586
|
+(deftransform >= ((x y) (real real) * :when :both)
|
|
3587
|
+ #+nil
|
|
3588
|
+ (format t "transform >=~%")
|
|
3589
|
+ (ir1-transform->= x y x y '<=))
|
|
3590
|
+
|
|
3591
|
+
|
|
3592
|
+#+(and nil x86)
|
3542
|
3593
|
(progn
|
3543
|
3594
|
;; When x and y are integers, we want to transform <= to > and >= to
|
3544
|
3595
|
;; <. But we don't want to do this for floats because it messes up
|