Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1=" is not registered as a string beginning #7

Open
phoe opened this issue Jan 12, 2021 · 0 comments
Open

#1=" is not registered as a string beginning #7

phoe opened this issue Jan 12, 2021 · 0 comments

Comments

@phoe
Copy link

phoe commented Jan 12, 2021

sbcl/sbcl@7bc54a8#diff-bea8b6d600beaee6db9afb9adbb685522a502e040f40101a6bf64daf3e3076daR346-R369

(progn
  (deftransform real-float-contagion-arg1 ((x y) * * :defun-only t :node node)
    (if (or (not (types-equal-or-intersect (lvar-type y) (specifier-type 'single-float)))
            (safe-ctype-for-single-coercion-p (lvar-type x)))
        `(,(lvar-fun-name (basic-combination-fun node)) (float x y) y)
        (give-up-ir1-transform #1="the first argument cannot safely be converted to SINGLE-FLOAT")))
  (deftransform complex-float-contagion-arg1 ((x y) * * :defun-only t :node node)
    (if (or (not (types-equal-or-intersect
                  (lvar-type y) (specifier-type '(complex single-float))))
            (safe-ctype-for-single-coercion-p (lvar-type x)))
        `(,(lvar-fun-name (basic-combination-fun node))
          (float x (realpart y)) y)
        (give-up-ir1-transform #1#)))
  (deftransform real-float-contagion-arg2 ((x y) * * :defun-only t :node node)
    (if (or (not (types-equal-or-intersect (lvar-type x) (specifier-type 'single-float)))
            (safe-ctype-for-single-coercion-p (lvar-type y)))
        `(,(lvar-fun-name (basic-combination-fun node)) x (float y x))
        (give-up-ir1-transform #2="the second argument cannot safely be converted to SINGLE-FLOAT")))
  (deftransform complex-float-contagion-arg2 ((x y) * * :defun-only t :node node)
    (if (or (not (types-equal-or-intersect (lvar-type x) (specifier-type '(complex single-float))))
            (safe-ctype-for-single-coercion-p (lvar-type y)))
        `(,(lvar-fun-name (basic-combination-fun node))
          x (float y (realpart x)))
        (give-up-ir1-transform #2#))))

Zrzut ekranu z 2021-01-12 19-08-39

phoe referenced this issue in sbcl/sbcl Jan 12, 2021
This change extends the float contagion transform to handle two new
classes of forms:

1. ({+ * / -} COMPLEX-DOUBLE-FLOAT SINGLE-FLOAT)

2. ({+ * / - =} COMPLEX-FLOAT RATIONAL)

This change also adds descriptions as well as abort reasons to the
existing and new transforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant