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

Fix makeflt create float value with short precision on :aarch64 #356

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fi
# run test in jskeus/irteus
for test_l in irteus/test/*.l; do

[[ ("`uname -m`" == "arm"* || "`uname -m`" == "aarch"*) && $test_l =~ geo.l|mathtest.l|interpolator.l|test-irt-motion.l|test-pointcloud.l|irteus-demo.l ]] && continue;
[[ ("`uname -m`" == "arm"* || "`uname -m`" == "aarch"*) && $test_l =~ geo.l|mathtest.l|interpolator.l|test-irt-motion.l|irteus-demo.l ]] && continue;

travis_time_start irteus.${test_l##*/}.test

Expand Down
8 changes: 4 additions & 4 deletions lisp/comp/trans.l
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@
f))))
(:load-t () (send self :push "T"))
(:load-nil () (send self :push "NIL"))
#-:x86_64
#-(or :x86_64 :aarch64)
(:load-int (x) (send self :push (format nil "makeint(~d)" x)))
#+:x86_64
#+(or :x86_64 :aarch64)
(:load-int (x) (send self :push (format nil "makeint((eusinteger_t)~dL)" x)))
#-:x86_64
#-(or :x86_64 :aarch64)
(:load-float (x) (send self :push (format nil "makeflt(~8,8e)" x)))
#+:x86_64
#+(or :x86_64 :aarch64)
(:load-float (x) (send self :push (format nil "makeflt(~22,22e)" x)))
)

Expand Down
7 changes: 7 additions & 0 deletions test/mathtest.l
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@
(format *error-output* "~A ~A~%" (+ (expt 2 32) 1234) (abs (+ (expt 2 32) 1234)))
))

(deftest compile-float-vector
;; if (float-vector 792.732209445) translated to local[1]= makeflt(7.92732209e+02), it reduces precision
(warning-message 2 "#f(792.732209445) ~A~%" #f(792.732209445))
(warning-message 2 "(float-vector 792.732209445) ~A~%" (float-vector 792.732209445))
(assert (< (norm (v- #f(792.732209445) (float-vector 792.732209445))) 1.0e-7)
(format nil "(norm (v- #f(792.732209445) (float-vector 792.732209445))) should be zero, but ~A~%" (norm (v- #f(792.732209445) (float-vector 792.732209445))))))

(eval-when (load eval)
(run-all-tests)
(exit))