Commit 0a522bd0 authored by Raymond Toy's avatar Raymond Toy

Use new log2 function in C

 * code/exports.lisp:
   * Export %LOG2.
 * code/irrat.lisp:
   * Define %log2
   * Use %log2 instead of log2. (This needs work)
 * compiler/float-tran.lisp:
   * Use %log2 instead of log2 in the deftransforms.
parent cc8c049f
......@@ -2095,7 +2095,7 @@
"%LOG" "%LOGB" "%LOG10" "%LOG1P" "%LONG-FLOAT"
"%LOG" "%LOGB" "%LOG10" "%LOG1P" "%LOG2" "%LONG-FLOAT"
......@@ -82,6 +82,7 @@
(def-math-rtn ("__ieee754_exp" %exp) 1)
(def-math-rtn ("__ieee754_log" %log) 1)
(def-math-rtn ("__ieee754_log10" %log10) 1)
(def-math-rtn ("cmucl_log2" %log2) 1)
(def-math-rtn ("__ieee754_pow" %pow) 2)
#-(or x86 sparc-v7 sparc-v8 sparc-v9)
......@@ -665,13 +666,13 @@
(number-dispatch ((number real) (base real))
(foreach integer ratio single-float double-float))
(log2 number))
(%log2 number))
(((foreach integer ratio single-float)
(foreach integer ratio single-float))
(float (log2 (float number 1d0)) 1f0))
(float (%log2 (float number 1d0)) 1f0))
(((foreach integer ratio single-float)
(log2 (float number 1d0)))
(%log2 (float number 1d0)))
(((foreach integer ratio single-float double-float)
......@@ -865,7 +865,7 @@
(cond ((= y-val 10)
`(coerce (kernel:%log10 (float x 1d0)) 'single-float))
((= y-val 2)
`(coerce (kernel::log2 (float x 1d0)) 'single-float)))))
`(coerce (kernel:%log2 (float x 1d0)) 'single-float)))))
(deftransform log ((x y) ((or (member 0d0) (double-float 0d0))
(constant-argument number))
......@@ -879,7 +879,7 @@
(cond ((= y-val 10)
`(kernel:%log10 (float x 1d0)))
((= y-val 2)
`(kernel::log2 (float x 1d0))))))
`(kernel:%log2 (float x 1d0))))))
;;; Handle some simple transformations
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment