From b935147761d1770bb115f09f8c28ddb4d36e1236 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 18 Mar 2012 17:09:34 -0400 Subject: assembly optimizations for fmod/remainder functions --- src/math/x86_64/fmodl.s | 11 +++++++++++ src/math/x86_64/remainderl.s | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/math/x86_64/fmodl.s create mode 100644 src/math/x86_64/remainderl.s (limited to 'src/math/x86_64') diff --git a/src/math/x86_64/fmodl.s b/src/math/x86_64/fmodl.s new file mode 100644 index 00000000..ca81e60c --- /dev/null +++ b/src/math/x86_64/fmodl.s @@ -0,0 +1,11 @@ +.global fmodl +.type fmodl,@function +fmodl: + fldt 24(%rsp) + fldt 8(%rsp) +1: fprem + fstsw %ax + sahf + jp 1b + fstp %st(1) + ret diff --git a/src/math/x86_64/remainderl.s b/src/math/x86_64/remainderl.s new file mode 100644 index 00000000..75c12374 --- /dev/null +++ b/src/math/x86_64/remainderl.s @@ -0,0 +1,11 @@ +.global remainderl +.type remainderl,@function +remainderl: + fldt 24(%rsp) + fldt 8(%rsp) +1: fprem1 + fstsw %ax + sahf + jp 1b + fstp %st(1) + ret -- cgit v1.2.1