Raymond Toy pushed to branch issue-156-take-2-nan-comparison at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/compiler/srctran.lisp
    ... ... @@ -3537,6 +3537,29 @@
    3537 3537
     (deftransform > ((x y) (real real) * :when :both)
    
    3538 3538
       (ir1-transform-< y x x y '<))
    
    3539 3539
     
    
    3540
    +
    
    3541
    +#+x86
    
    3542
    +(progn
    
    3543
    +  ;; When x and y are integers, we want to transform <= to > and >= to
    
    3544
    +  ;; <.  But we don't want to do this for floats because it messes up
    
    3545
    +  ;; comparisons with NaN.
    
    3546
    +  ;;
    
    3547
    +  ;; I'm not sure about this.  The transformation is right, but
    
    3548
    +  ;; perhaps what we really need is an ir-transform-<= to determine x
    
    3549
    +  ;; <= y is definitely true or false, like for ir1-transform-<.
    
    3550
    +  ;;
    
    3551
    +  ;; For now this allows the testsuite to pass.  Perhaps there's a bug
    
    3552
    +  ;; in generic->=?
    
    3553
    +  (deftransform <= ((x y) (integer integer) * :when :both)
    
    3554
    +    ;; (<= x y) is the same as (not (> x y))
    
    3555
    +    `(not (> x y)))
    
    3556
    +
    
    3557
    +  
    
    3558
    +  (deftransform >= ((x y) (integer integer) * :when :both)
    
    3559
    +    ;; (>= x y) is the same as (not (< x y))
    
    3560
    +    `(not (< x y))))
    
    3561
    +
    
    3562
    +
    
    3540 3563
     ;; Like IR1-TRANSFORM-< but for CHAR<.  This is needed so that the
    
    3541 3564
     ;; vops for base-char comparison with a constant gets used when the
    
    3542 3565
     ;; first arg is the constant.