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 @@
"%CALLER-FRAME-AND-PC" "%CHECK-BOUND" "%CLOSURE-FUNCTION"
"%CLOSURE-INDEX-REF" "%COS" "%COSH" "%DEPOSIT-FIELD"
"%DOUBLE-FLOAT" "%DPB" "%EXP" "%EXPM1" "%HYPOT" "%LDB"
"%LOG" "%LOGB" "%LOG10" "%LOG1P" "%LONG-FLOAT"
"%LOG" "%LOGB" "%LOG10" "%LOG1P" "%LOG2" "%LONG-FLOAT"
"%MAKE-COMPLEX" "%MAKE-FUNCALLABLE-INSTANCE" "%MAKE-RATIO"
"%MASK-FIELD" "%NEGATE" "%POW"
"%RAW-BITS" "%RAW-REF-COMPLEX-DOUBLE" "%RAW-REF-COMPLEX-LONG"
......
......@@ -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))
((double-float
(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)
double-float)
(log2 (float number 1d0)))
(%log2 (float number 1d0)))
#+double-double
(((foreach integer ratio single-float double-float)
double-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