Raymond Toy pushed to branch rtoy-issue-78-unneded-code-code-in-complex-acos at cmucl / cmucl
Commits:
6ed52aa0 by Raymond Toy at 2020-05-31T21:01:13-07:00
Revert changes to atanh
Still need the special case for real args to get the right branch
cuts. Haven't yet figured out why the current code doesn't work when
the arg is a pure real. Soemthing to do with computing y, but not
sure how to get that to work out without doing just explicitly
checking for real args. In that case, it's just much easier to change
the arg to have the correct imaginary component to make it continuous
with the desired quadrant.
- - - - -
1 changed file:
- src/code/irrat.lisp
Changes:
=====================================
src/code/irrat.lisp
=====================================
@@ -1510,7 +1510,7 @@ Z may be any number, but the result is always a complex."
;; NOTE: this differs from what the CLHS says for the continuity.
;; Instead of the text in the CLHS, we choose to use the definition
;; to derive the correct values.
- (if (and nil (realp z))
+ (if (realp z)
(complex-atanh (complex (float z) (- (* 0 (float z)))))
(let* ( ;; Constants
(theta (/ (sqrt most-positive-double-float) 4.0d0))
@@ -1518,9 +1518,10 @@ Z may be any number, but the result is always a complex."
(half-pi (/ pi 2.0d0))
(rp (float (realpart z) 1.0d0))
(beta (float-sign rp 1.0d0))
- (z* (conjugate z))
- (x (* beta (realpart z*)))
- (y (* beta (imagpart z*)))
+ ;; x+iy = beta*conjugate(z), but being careful to produce
+ ;; a signed-zero if z is rational.
+ (x (* beta (realpart z)))
+ (y (* beta (- (float (imagpart z) 1d0))))
(eta 0.0d0)
(nu 0.0d0))
;; Shouldn't need this declare.
@@ -1562,8 +1563,7 @@ Z may be any number, but the result is always a complex."
(atan (* 2.0d0 y)
(- (* (- 1.0d0 x)
(+ 1.0d0 x))
- (square t1)))))
- (format t "eta = ~A nu ~A~%" eta nu))))
+ (square t1))))))))
(coerce-to-complex-type (* beta eta)
(- (* beta nu))
z)))))
@@ -1715,16 +1715,13 @@ Z may be any number, but the result is always a complex."
#+double-double
(when (typep z '(or double-double-float (complex double-double-float)))
(return-from complex-acos (dd-complex-acos z)))
- (if (and nil (realp z) (> z 1))
- ;; acos is continuous in quadrant IV in this case.
- (complex-acos (complex z -0f0))
- (let ((sqrt-1+z (complex-sqrt (1+z z)))
- (sqrt-1-z (complex-sqrt (1-z z))))
- (with-float-traps-masked (:divide-by-zero)
- (complex (* 2 (atan (/ (realpart sqrt-1-z)
- (realpart sqrt-1+z))))
- (asinh (imagpart (* (conjugate sqrt-1+z)
- sqrt-1-z))))))))
+ (let ((sqrt-1+z (complex-sqrt (1+z z)))
+ (sqrt-1-z (complex-sqrt (1-z z))))
+ (with-float-traps-masked (:divide-by-zero)
+ (complex (* 2 (atan (/ (realpart sqrt-1-z)
+ (realpart sqrt-1+z))))
+ (asinh (imagpart (* (conjugate sqrt-1+z)
+ sqrt-1-z)))))))
;; acosh(z) = 2*log(sqrt((x+1)/2) + sqrt((x-1)/2))
;;
@@ -1823,16 +1820,13 @@ Z may be any number, but the result is always a complex."
#+double-double
(when (typep z '(or double-double-float (complex double-double-float)))
(return-from complex-asin (dd-complex-asin z)))
- (if (and nil (realp z) (> z 1))
- ;; asin is continuous in quadrant IV in this case.
- (complex-asin (complex z -0f0))
- (let ((sqrt-1-z (complex-sqrt (1-z z)))
- (sqrt-1+z (complex-sqrt (1+z z))))
- (with-float-traps-masked (:divide-by-zero)
- (complex (atan (/ (realpart z)
- (realpart (* sqrt-1-z sqrt-1+z))))
- (asinh (imagpart (* (conjugate sqrt-1-z)
- sqrt-1+z))))))))
+ (let ((sqrt-1-z (complex-sqrt (1-z z)))
+ (sqrt-1+z (complex-sqrt (1+z z))))
+ (with-float-traps-masked (:divide-by-zero)
+ (complex (atan (/ (realpart z)
+ (realpart (* sqrt-1-z sqrt-1+z))))
+ (asinh (imagpart (* (conjugate sqrt-1-z)
+ sqrt-1+z)))))))
(defun complex-asinh (z)
"Compute asinh z = log(z + sqrt(1 + z*z))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6ed52aa06cd1b22f33b9417…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6ed52aa06cd1b22f33b9417…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch rtoy-issue-78-unneded-code-code-in-complex-acos at cmucl / cmucl
Commits:
00d0cb6f by Raymond Toy at 2020-05-24T10:17:44-07:00
Derive the values on the branch cuts for acosh
Conclusion: on the branch cuts, acosh is continuous with quadrant I
for 9 <= x < 1 and with quadrant II for x < -1. This, of course, is
consistent with Kahan's coutner-clowkwise continuity principla.
- - - - -
1 changed file:
- src/code/irrat.lisp
Changes:
=====================================
src/code/irrat.lisp
=====================================
@@ -1726,6 +1726,46 @@ Z may be any number, but the result is always a complex."
(asinh (imagpart (* (conjugate sqrt-1+z)
sqrt-1-z))))))))
+;; acosh(z) = 2*log(sqrt((x+1)/2) + sqrt((x-1)/2))
+;;
+;; For z = x, 0 <= x < 1
+;; acosh(z) = 2*log(sqrt((x+1)/2) + sqrt((x-1)/2))
+;; = 2*log(sqrt((x+1)/2) + i*sqrt((1-x)/2))
+;; = 2*(log(1) + i*arg(sqrt((x+1)/2) + i*sqrt((1-x)/2)))
+;; = 2*i*atan(sqrt((1-x)/2), sqrt((x+1)/2))
+;; = 2*i*atan(sqrt((1-x)/(1+x)))
+;;
+;; For z = -x, x > 1
+;; acosh(z) = 2*log(sqrt((1-x)/2) + sqrt((-x-1)/2))
+;; = 2*log((i*sqrt((x-1)/2) + 0 + i*sqrt((1+x)/2)) + 0)
+;; = 2*log(i*(sqrt((x-1)/2) + sqrt((1+x)/2)) + 0)
+;; = 2*(log(sqrt((x-1)/2) + sqrt((1+x)/2)) + i*arg(sqrt((x-1)/2) + sqrt((1+x)/2)) + 0)
+;; = 2*(log(sqrt((x-1)/2) + sqrt((1+x)/2)) + i*pi/2)
+;; = 2*log(x+sqrt(x+1)*sqrt(x-1)) + i*pi
+;;
+;; For z = x + i0, 0 <= x < 1
+;; acosh(z) = 2*log(sqrt((1+x)/2+i0) + sqrt((x-1)/2+i0))
+;; = 2*log(sqrt((1+x)/2)+i0 + i*sqrt((1-x)/2) + 0)
+;; = 2*log(sqrt((1+x)/2) + i*sqrt((1-x)/2))
+;; = 2*(log(1) + i*arg(sqrt((1+x)/2) + i*sqrt((1-x)/2))
+;; = 0 + 2*i*atan(sqrt((1-x)/2)/sqrt((1+x)/2)) +
+;; = 0 + 2*i*atan(sqrt((1-x)/(1+x))
+;;
+;; This is the same value we got for acosh(x), 0 <= x < 1. Hence,
+;; acosh is continuous with quadrant I on the branch cut for 0 <= x <
+;; 1.
+;;
+;; Finally, for z = -x + i0, x > 1
+;; acosh(z) = 2*log(sqrt((1-x)/2+i0) + sqrt((-x-1)/2+i0))
+;; = 2*log(i*sqrt((x-1)/2) + 0 + i*sqrt((1+x)/2 + i0))
+;; = 2*log(i*(sqrt((x-1)/2) + sqrt((1+x)/2)) + 0)
+;; = 2*(log(sqrt((x-1)/2) + sqrt((1+x)/2)) + i*arg(0, (sqrt((x-1)/2) + sqrt((1+x)/2)))
+;; = 2*(log(sqrt((x-1)/2) + sqrt((1+x)/2)) + i*pi/2)
+;; = 2*log(sqrt((x-1)/2) + sqrt((1+x)/2)) + i*pi
+;;
+;; We see that this is the same expression for acosh(z), z < -1.
+;; Hence, acosh(z) is continuous with quadrant II on the branch cut x
+;; < -1.
(defun complex-acosh (z)
"Compute acosh z = 2 * log(sqrt((z+1)/2) + sqrt((z-1)/2))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/00d0cb6f5f931b01000bef1…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/00d0cb6f5f931b01000bef1…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch rtoy-issue-78-unneded-code-code-in-complex-acos at cmucl / cmucl
Commits:
fe15b0a3 by Raymond Toy at 2020-05-24T08:10:39-07:00
Derive the values on the branch cuts for atanh
Conclusion: atanh is continuous with quadrant Iv for x > 1 and
quadrant II for x < -1. This, of course, is consistent with Kahan's
coutner-clowkwise continuity principla.
- - - - -
1 changed file:
- src/code/irrat.lisp
Changes:
=====================================
src/code/irrat.lisp
=====================================
@@ -1449,7 +1449,44 @@ Z may be any number, but the result is always a complex."
;; +infinity, but the following code returns approx 176 + i*pi/4. The
;; reason for the imaginary part is caused by the fact that arg i*y is
;; never 0 since we have positive and negative zeroes.
-
+;;
+;; The branch cut for atanh is on the real axis for x < -1 and x > 1.
+;; Let's derive the values on the branch cut.
+;;
+;; atanh(z) = 1/2*(log(1+z)-log(1-z))
+;;
+;; For z = x, x > 1:
+;; atanh(x) = 1/2*(log(1+x) - log(1-x))
+;; = 1/2*(log(1+x) - [log(x-1) + i*arg(1-x))
+;; = 1/2*(log(1+x) - (log(x-1) + i*pi))
+;; = 1/2*(log(1+x) - log(x-1) _ i*pi)
+;; = 1/2*log((1+x)/(x-1)) - i*pi/2
+;;
+;; For z = -x, x > 1
+;; atanh(x) = 1/2*(log(1-x) - log(1+x))
+;; = 1/2*((log(x-1) + i*arg(1-x)) - log(1+x))
+;; = 1/2*((log(x-1) + i*pi) - log(1+x))
+;; = 1/2*(log((x-1)/(x+1)) + i*pi)
+;; = 1/2*log((x-1)/(x+1)) + i*pi/2
+;;
+;; For z = x - i0, x > 1
+;; atanh(z) = 1/2*(log(1+x - i0) - log(1-x+i0))
+;; = 1/2*(log(1+x) + i*arg(1+x,-0) - (log(x-1) + i*arg(1-x, +0)))
+;; = 1/2*(log(1+x) - i*0 - (log(x-1) + i*pi))
+;; = 1/2*(log(1+x) - log(x-1) - i*pi)
+;; = 1/2*log((1+x)/(x-1)) - i*pi/2
+;;
+;; This is the same answer we get for atanh(x), x > 1. Hence, atanh
+;; is continuous with quadrant IV along the branch cut x > 1.
+;;
+;; Similary, for z = -x + i0, x > 1:
+;; atanh(z) = 1/2*(log(1-x + i0) - log(1+x-i0))
+;; = 1/2*((log(x-1) + i*arg(1-x, +0)) - (log(1+x)+i*arg(1+x, -0)))
+;; = 1/2*(log(x-1) + i*pi - (log(1+x) - i0))
+;; = 1/2*(log(x-1) - log(1+x) + i*pi)
+;; = 1/2*log((x-1)/(x+1)) + i*pi/2
+;; This is same answer as atanh(x), x < -1. Thus, atanh is continuous
+;; with quadrant II on the branch cut for x < -1
(defun complex-atanh (z)
"Compute atanh z = (log(1+z) - log(1-z))/2"
(declare (number z))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/fe15b0a31119288135a67ab…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/fe15b0a31119288135a67ab…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch rtoy-issue-78-unneded-code-code-in-complex-acos at cmucl / cmucl
Commits:
53cf274f by Raymond Toy at 2020-05-23T13:46:52-07:00
Add derivation for the values on the branch cut for acos
We derive formulas for the values of acos(x) for x > 1 and x < -1 and
show that for x > 1, acos is continuous with quadrant IV and for x <
-1, acos is continuous with quadrant II.
This matches Kahan's counter-clockwise countinuity for values on the
branch cuts.
- - - - -
1 changed file:
- src/code/irrat.lisp
Changes:
=====================================
src/code/irrat.lisp
=====================================
@@ -1334,6 +1334,27 @@ and Y are coerced to single-float."
(t
(values rho 0)))))))
+;; sqrt(z) = z^(1/2)
+;; = exp(1/2*log(z))
+;;
+;; Some special values, with x > 0
+;; sqrt(x + i*0) = exp(1/2*log(x+i*0))
+;; = exp(1/2*(log(x)+i*0))
+;; = exp(1/2*log(x)+i*0)
+;; = exp(1/2*log(x))*exp(i*0)
+;; = sqrt(x)*(cos 0 + i*sin(0))
+;; = sqrt(x) + i*0
+;; sqrt(x - i*0) = exp(1/2*log(x-i*0))
+;; = exp(1/2*(log(x) - i*0))
+;; = exp(1/2*log(x) - i*0)
+;; = exp(1/2*log(x))*exp(-i*0)
+;; = sqrt(x)*(cos(-0) + i*sin(-0))
+;; = sqrt(x) - i*0
+;; Kahan also gives the following for b > 0
+;; sqrt(-b+/-i*0) = +0 +/- i*sqrt(b)
+;; sqrt(x +/- i*inf) = +inf +/- i*inf for all finite x.
+;; sqrt(inf +/- i*b) = +inf +/- i*0
+;; sqrt(-inf +/- i*b) = +0 +/- i*inf
(defun complex-sqrt (z)
"Principle square root of Z
@@ -1604,6 +1625,51 @@ Z may be any number, but the result is always a complex."
(+ z 1)
(complex (+ (realpart z) 1) (imagpart z))))
+;; acos(z) = 2*log(sqrt((1+z)/2) + i*sqrt((1-z)/2))/i
+;; = pi/2 - asin(z)
+;;
+;; In particular for z = x > 1:
+;; acos(x) = 2/i*log(sqrt((x+1)/2) + i*sqrt((1-x)/2))
+;; = 2/i*log(sqrt((x+1)/2) + i*i*sqrt((x-1)/2))
+;; = 2/i*log(sqrt((x+1)/2) - sqrt((x-1)/2))
+;; = -2*i*log(sqrt((x+1)/2) - sqrt((x-1)/2))
+;; = -i*log(x-sqrt(x-1)*sqrt(x+1))
+;; Thus, acos(2) = -i*log(2-sqrt(3) = -i*1.31695...
+;;
+;; Similarly for z = -x, x > 1:
+;; acos(-x) = 2/i*log(sqrt((1-x)/2) + i*sart((1+x)/2))
+;; = 2/i*log(i*sqrt((x-1)/2) + i*sqrt((1+x)/2))
+;; = 2/i*log(i*(sqrt((x+1)/2)+sqrt((x-1)/2)))
+;; = 2/i*(log(sqrt((x+1)/2)+sqrt((x-1)/2)) + i*pi/2)
+;; = -i*2*log(sqrt((x+1)/2)+sqrt((x-1)/2)) - pi
+;; = -pi - i*log(x+sqrt(x+1)*(sqrt(x-1)))
+;;
+;; Thus acos(-2) = -pi - i*log(2+sqrt(3)) = -pi -i*1.31695...
+;;
+;; Now see what aacos(x-i0) for x > 1 is:
+;; acos(x-i*0) = 2/i*log(sqrt((x+1)/2-i*0) + i*sqrt((1-x)/2+i*0))
+;; = 2/i*log(sqrt((x+1)/2) -i*0+ i*(0+i*sqrt((x-1)/2)))
+;; = 2/i*log(sqrt((x+1)/2) - sqrt((x-1)/2) - i*0)
+;; = 2/i*[log(sqrt((x+1)/2) - sqrt((x-1)/2)) - i*0]
+;; = -i*[2*log(sqrt((x+1)/2) - sqrt((x-1)/2)) - i*0]
+;; = -i*log(x-sqrt(x-1)*sqrt(x+1)) + 0
+;;
+;; Thus acos(2 - i*0) is the same as acos(2). That is, acos is
+;; continuous with quadrant IV for x > 1.
+;;
+;; For acos(-x+i0), x > 1:
+;; acos(-x+i0) = 2/i*log(sqrt((1-x+i0)/2) + i*sqrt((1+x-i0)/2))
+;; = 2/i*log(sqrt((1-x)/2+i0) + i*sqrt((1+x)/2-i0))
+;; = 2/i*log((i*sqrt((x-1)/2) + 0) + i*(sqrt((1+x)/2)-i0))
+;; = 2/i*log(i*sqrt((x-1)/2) + i*sqrt((1+x)/2) + 0)
+;; = 2/i*log(i*(sqrt((x-1)/2 + sqrt(1+x)/2)) + 0)
+;; = 2/i*(log(sqrt(x+sqrt(x-1)*sqrt(x+1))) + i*pi/2)
+;; = -i*log(x+sqrt(x-1)*sqrt(x+1)) + pi
+;; = pi - i*log(x+sqrt(x-1)*sqrt(x+1))
+;;
+;; Thus acos(-2+i0) = pi - i*log(sqrt(3)+2) = pi -i*1.31695, and this
+;; equal acos(-2). This means acos is continuous with quadrant II.
+;;
(defun complex-acos (z)
"Compute acos z = pi/2 - asin z
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/53cf274f24589c7870593af…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/53cf274f24589c7870593af…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch rtoy-issue-76-add-ansi-tests-to-ci at cmucl / cmucl
Commits:
56438ab3 by Raymond Toy at 2020-02-16T09:55:59-08:00
Update to ASDF 3.3.4
- - - - -
00a914c9 by Raymond Toy at 2020-02-17T09:40:10-08:00
Update to use the 2019-06 snapshot
- - - - -
b18f00f2 by Raymond Toy at 2020-02-18T06:24:00+00:00
Fix #79: Autoload ASDF in REQUIRE
When `REQUIRE` is called, autoload ASDF if it hasn't already been
loaded. User's no longer have to load asdf explicitly anymore.
Update release notes.
- - - - -
b219722a by Raymond Toy at 2020-02-18T06:24:00+00:00
Merge branch 'rtoy-issue-79-autoload-asdf' into 'master'
Fix #79: Autoload ASDF in REQUIRE
Closes #79
See merge request cmucl/cmucl!46
- - - - -
338d8606 by Raymond Toy at 2020-02-18T06:25:47+00:00
Fix #80: Convert contribs to use ASDF to load
As it says, convert contribs to use ASDF to load them if possible. Many
contribs already had an asd file so we basically just had to rename
foo.asd to contrib-foo.asd to keep backward compatibility with the old
contrib names. (And update the defsystem name to match.)
Added an asd file for packed-sse2. Unix doesn't work, so it's left alone for now.
- - - - -
99f6534f by Raymond Toy at 2020-02-18T06:25:47+00:00
Merge branch 'rtoy-issue-80-asdfify-contribs' into 'master'
Fix #80: Convert contribs to use ASDF to load
Closes #80
See merge request cmucl/cmucl!47
- - - - -
23d9f60e by Raymond Toy at 2020-02-17T22:33:36-08:00
Update from release logs.
Issue #80 is fixed.
- - - - -
84fd9509 by Raymond Toy at 2020-03-08T17:32:37+00:00
Add utilities by Eric Marsden to contribs
Eric Marsden wrote some useful utilities long ago. Let's add them to
the contrib directory so that we have our own copy of them instead of
depending on emarsden.chez.com/downloads.
We're adding:
* cpc - CPU Performance Counters for Solaris
* ssl-cmucl - interface to SSL streams
* tcp-forwarder - TCP forwarder to redirect TCP connections to another
port on another machine
* xml-rpc - Port of Chris Double's xml-rpc client to Cmucl
- - - - -
d5853cfb by Raymond Toy at 2020-03-08T17:32:37+00:00
Merge branch 'rtoy-add-emarsden-contribs' into 'master'
Fix #81: Add contribs written by Eric Marsden
Closes #81, #80, and #79
See merge request cmucl/cmucl!48
- - - - -
c5ae0bbd by Raymond Toy at 2020-03-17T03:15:24+00:00
Fix #77: Add tests for sqrt of exceptional values
Add tests for the test cases listed in the bug. Cmucl currently
passes with no additional changes.
- - - - -
dcaa51db by Raymond Toy at 2020-03-17T03:15:24+00:00
Merge branch 'rtoy-issue-77-tests-sqrt-exceptional' into 'master'
Fix #77: Add tests for sqrt of exceptional values
Closes #77
See merge request cmucl/cmucl!49
- - - - -
12b02161 by Raymond Toy at 2020-03-22T09:53:25-07:00
Update release notes via closed issues
- - - - -
9d6febd3 by Raymond Toy at 2020-03-25T01:12:38+00:00
Fix #82: Replace bc with expr
`expr` is more commonly installed than `bc` so reduce the number of
required dependencies and just use `expr`.
- - - - -
911f6abe by Raymond Toy at 2020-03-25T01:12:38+00:00
Merge branch 'rtoy-issue-82-replace-bc' into 'master'
Fix #82: Replace bc with expr
Closes #82
See merge request cmucl/cmucl!50
- - - - -
974366fb by Raymond Toy at 2020-03-27T19:47:55-07:00
Use snapshot-2020-04
The snapshot has been release so use the latest snapshot to run the
CI.
- - - - -
9514ed06 by Raymond Toy at 2020-05-02T16:07:11-07:00
Merge branch 'master' into rtoy-issue-76-add-ansi-tests-to-ci
- - - - -
30 changed files:
- .gitlab-ci.yml
- src/code/module.lisp
- src/contrib/asdf/asdf.lisp
- src/contrib/asdf/doc/asdf.html
- src/contrib/asdf/doc/asdf.info
- src/contrib/asdf/doc/asdf.pdf
- src/contrib/contrib.lisp
- + src/contrib/cpc/contrib-cpc.asd
- + src/contrib/cpc/cpc.lisp
- src/contrib/demos/demos.asd → src/contrib/demos/contrib-demos.asd
- src/contrib/embedded-c/embedded-c.asd → src/contrib/embedded-c/contrib-embedded-c.asd
- src/contrib/follow-mouse/follow-mouse.asd → src/contrib/follow-mouse/contrib-follow-mouse.asd
- src/contrib/games/feebs/brains.lisp
- src/contrib/games/feebs/feebs.asd → src/contrib/games/feebs/contrib-games-feebs.asd
- src/contrib/hist/hist.asd → src/contrib/hist/contrib-hist.asd
- src/contrib/hist/hist.lisp
- src/contrib/ops/ops.asd → src/contrib/ops/contrib-ops.asd
- src/contrib/ops/ops-util.lisp
- + src/contrib/packed-sse2/contrib-packed-sse2.asd
- src/contrib/psgraph/psgraph.asd → src/contrib/psgraph/contrib-psgraph.asd
- src/contrib/sprof/sprof.asd → src/contrib/sprof/contrib-sprof.asd
- + src/contrib/ssl-cmucl/contrib-ssl.asd
- + src/contrib/ssl-cmucl/ssl-cmucl.lisp
- + src/contrib/tcp-forwarder/contrib-tcp-forwarder.asd
- + src/contrib/tcp-forwarder/tcp-forwarder.lisp
- + src/contrib/unix/unix.asd
- + src/contrib/xml-rpc/xmlrpc.lisp
- src/general-info/release-21e.md
- src/lisp/GNUmakefile
- tests/irrat.lisp
The diff was not included because it is too large.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6f87c065753548029580aa…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6f87c065753548029580aa…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch rtoy-use-ssse3-insts at cmucl / cmucl
Commits:
285d1d96 by Raymond Toy at 2020-04-19T10:33:27-07:00
Refine features to include sse4 for popcnt
popcnt is part of sse4, not sse3/ssse3, so add feature detection for
sse4 to enable use of this instruciton.
sse4 and ppcnt was first available in the Nehalem architecture, Nov
2008 in the first gen of Core i7 and i5 processors. The oldest
machines I have access to date from 2011.
Also remove :ssse3 because we don't currently define or use any ssse3
instructions.
Add a bit of documentation about popcnt.
Setup CI to build with a bootstrap file to get these instructions.
- - - - -
5 changed files:
- .gitlab-ci.yml
- src/bootfiles/21d/boot-2020-04.lisp
- src/code/x86-vm.lisp
- src/compiler/x86/arith.lisp
- src/compiler/x86/insts.lisp
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -1,7 +1,7 @@
variables:
download_url: "https://common-lisp.net/project/cmucl/downloads/snapshots/2020/04"
version: "2020-04-x86"
- bootstrap: ""
+ bootstrap: "-B boot-2020-04"
linux-runner:
tags:
=====================================
src/bootfiles/21d/boot-2020-04.lisp
=====================================
@@ -2,4 +2,6 @@
#+x86
(pushnew :sse3 *features*)
#+x86
-(pushnew :ssse3 *features*)
\ No newline at end of file
+(pushnew :ssse3 *features*)
+#+x86
+(pushnew :sse4 *features*)
=====================================
src/code/x86-vm.lisp
=====================================
@@ -42,12 +42,21 @@
(setf *features* (delete :x87 *features*))
(sys:register-lisp-feature :sse2))
+#+sse3
+(progn
+ (setf *features* (delete :x87 *features*))
+ (sys:register-lisp-feature :sse3))
+
#+ssse3
(progn
(setf *features* (delete :x87 *features*))
- (sys:register-lisp-feature :sse3)
(sys:register-lisp-feature :ssse3))
+#+sse4
+(progn
+ (setf *features* (delete :x87 *features*))
+ (sys:register-lisp-feature :sse4))
+
#+(or darwin linux)
(sys:register-lisp-runtime-feature :relocatable-stacks)
=====================================
src/compiler/x86/arith.lisp
=====================================
@@ -964,7 +964,7 @@
(:arg-types unsigned-num)
(:results (result :scs (unsigned-reg)))
(:result-types positive-fixnum)
- (:guard (backend-featurep :sse3))
+ (:guard (backend-featurep :sse4))
(:generator 2
(inst popcnt result arg)))
=====================================
src/compiler/x86/insts.lisp
=====================================
@@ -3201,6 +3201,7 @@
(define-regular-sse-inst paddq #x66 #xd4)
)
+;; SSE4 instruction
(define-instruction popcnt (segment dst src)
(:printer ext-reg-reg/mem
((prefix #xf3) (op #xb8)))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/285d1d9603e8b02d43d7841…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/285d1d9603e8b02d43d7841…
You're receiving this email because of your account on gitlab.common-lisp.net.