From: Brian Gerst <bgerst@quark.didntduck.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Dead code in i386 math-emu
Date: Sat, 02 Nov 2002 22:40:46 -0500 [thread overview]
Message-ID: <3DC49ABE.2020801@quark.didntduck.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 80 bytes --]
This removes unused non-reentrant code in the fpu emulator.
--
Brian Gerst
[-- Attachment #2: mathemu-dead-1 --]
[-- Type: text/plain, Size: 5177 bytes --]
diff -urN linux-2.5.45-bk1/arch/i386/math-emu/div_Xsig.S linux/arch/i386/math-emu/div_Xsig.S
--- linux-2.5.45-bk1/arch/i386/math-emu/div_Xsig.S Sun Sep 15 22:18:24 2002
+++ linux/arch/i386/math-emu/div_Xsig.S Sat Nov 2 22:17:52 2002
@@ -36,7 +36,6 @@
#define XsigH(x) 8(x)
-#ifndef NON_REENTRANT_FPU
/*
Local storage on the stack:
Accumulator: FPU_accum_3:FPU_accum_2:FPU_accum_1:FPU_accum_0
@@ -49,37 +48,12 @@
#define FPU_result_2 -24(%ebp)
#define FPU_result_1 -28(%ebp)
-#else
-.data
-/*
- Local storage in a static area:
- Accumulator: FPU_accum_3:FPU_accum_2:FPU_accum_1:FPU_accum_0
- */
- .align 4,0
-FPU_accum_3:
- .long 0
-FPU_accum_2:
- .long 0
-FPU_accum_1:
- .long 0
-FPU_accum_0:
- .long 0
-FPU_result_3:
- .long 0
-FPU_result_2:
- .long 0
-FPU_result_1:
- .long 0
-#endif /* NON_REENTRANT_FPU */
-
.text
ENTRY(div_Xsig)
pushl %ebp
movl %esp,%ebp
-#ifndef NON_REENTRANT_FPU
subl $28,%esp
-#endif /* NON_REENTRANT_FPU */
pushl %esi
pushl %edi
diff -urN linux-2.5.45-bk1/arch/i386/math-emu/reg_round.S linux/arch/i386/math-emu/reg_round.S
--- linux-2.5.45-bk1/arch/i386/math-emu/reg_round.S Sun Sep 15 22:18:48 2002
+++ linux/arch/i386/math-emu/reg_round.S Sat Nov 2 22:17:52 2002
@@ -85,23 +85,11 @@
#define UNMASKED_UNDERFLOW $2
-#ifndef NON_REENTRANT_FPU
/* Make the code re-entrant by putting
local storage on the stack: */
#define FPU_bits_lost (%esp)
#define FPU_denormal 1(%esp)
-#else
-/* Not re-entrant, so we can gain speed by putting
- local storage in a static area: */
-.data
- .align 4,0
-FPU_bits_lost:
- .byte 0
-FPU_denormal:
- .byte 0
-#endif /* NON_REENTRANT_FPU */
-
.text
.globl fpu_reg_round
@@ -124,9 +112,7 @@
fpu_reg_round: /* Normal entry point */
movl PARAM4,%ecx
-#ifndef NON_REENTRANT_FPU
pushl %ebx /* adjust the stack pointer */
-#endif /* NON_REENTRANT_FPU */
#ifdef PARANOID
/* Cannot use this here yet */
@@ -428,9 +414,7 @@
fpu_reg_round_special_exit:
-#ifndef NON_REENTRANT_FPU
popl %ebx /* adjust the stack pointer */
-#endif /* NON_REENTRANT_FPU */
fpu_Arith_exit:
popl %ebx
diff -urN linux-2.5.45-bk1/arch/i386/math-emu/reg_u_div.S linux/arch/i386/math-emu/reg_u_div.S
--- linux-2.5.45-bk1/arch/i386/math-emu/reg_u_div.S Sun Sep 15 22:18:23 2002
+++ linux/arch/i386/math-emu/reg_u_div.S Sat Nov 2 22:18:11 2002
@@ -31,7 +31,6 @@
/* #define dSIGH(x) 4(x) */
-#ifndef NON_REENTRANT_FPU
/*
Local storage on the stack:
Result: FPU_accum_3:FPU_accum_2:FPU_accum_1:FPU_accum_0
@@ -45,30 +44,6 @@
#define FPU_result_2 -24(%ebp)
#define FPU_ovfl_flag -28(%ebp)
-#else
-.data
-/*
- Local storage in a static area:
- Result: FPU_accum_3:FPU_accum_2:FPU_accum_1:FPU_accum_0
- Overflow flag: ovfl_flag
- */
- .align 4,0
-FPU_accum_3:
- .long 0
-FPU_accum_2:
- .long 0
-FPU_accum_1:
- .long 0
-FPU_accum_0:
- .long 0
-FPU_result_1:
- .long 0
-FPU_result_2:
- .long 0
-FPU_ovfl_flag:
- .byte 0
-#endif /* NON_REENTRANT_FPU */
-
#define REGA PARAM1
#define REGB PARAM2
#define DEST PARAM3
@@ -77,9 +52,7 @@
ENTRY(FPU_u_div)
pushl %ebp
movl %esp,%ebp
-#ifndef NON_REENTRANT_FPU
subl $28,%esp
-#endif /* NON_REENTRANT_FPU */
pushl %esi
pushl %edi
diff -urN linux-2.5.45-bk1/arch/i386/math-emu/reg_u_mul.S linux/arch/i386/math-emu/reg_u_mul.S
--- linux-2.5.45-bk1/arch/i386/math-emu/reg_u_mul.S Sun Sep 15 22:18:22 2002
+++ linux/arch/i386/math-emu/reg_u_mul.S Sat Nov 2 22:18:30 2002
@@ -27,29 +27,15 @@
-#ifndef NON_REENTRANT_FPU
/* Local storage on the stack: */
#define FPU_accum_0 -4(%ebp) /* ms word */
#define FPU_accum_1 -8(%ebp)
-#else
-/* Local storage in a static area: */
-.data
- .align 4,0
-FPU_accum_0:
- .long 0
-FPU_accum_1:
- .long 0
-#endif /* NON_REENTRANT_FPU */
-
-
.text
ENTRY(FPU_u_mul)
pushl %ebp
movl %esp,%ebp
-#ifndef NON_REENTRANT_FPU
subl $8,%esp
-#endif /* NON_REENTRANT_FPU */
pushl %esi
pushl %edi
diff -urN linux-2.5.45-bk1/arch/i386/math-emu/wm_sqrt.S linux/arch/i386/math-emu/wm_sqrt.S
--- linux-2.5.45-bk1/arch/i386/math-emu/wm_sqrt.S Sun Sep 15 22:18:21 2002
+++ linux/arch/i386/math-emu/wm_sqrt.S Sat Nov 2 22:18:51 2002
@@ -29,7 +29,6 @@
#include "fpu_emu.h"
-#ifndef NON_REENTRANT_FPU
/* Local storage on the stack: */
#define FPU_accum_3 -4(%ebp) /* ms word */
#define FPU_accum_2 -8(%ebp)
@@ -46,40 +45,12 @@
#define FPU_fsqrt_arg_1 -24(%ebp)
#define FPU_fsqrt_arg_0 -28(%ebp) /* ls word, at most the ms bit is set */
-#else
-/* Local storage in a static area: */
-.data
- .align 4,0
-FPU_accum_3:
- .long 0 /* ms word */
-FPU_accum_2:
- .long 0
-FPU_accum_1:
- .long 0
-FPU_accum_0:
- .long 0
-
-/* The de-normalised argument:
- sq_2 sq_1 sq_0
- b b b b b b b ... b b b b b b .... b b b b 0 0 0 ... 0
- ^ binary point here
- */
-FPU_fsqrt_arg_2:
- .long 0 /* ms word */
-FPU_fsqrt_arg_1:
- .long 0
-FPU_fsqrt_arg_0:
- .long 0 /* ls word, at most the ms bit is set */
-#endif /* NON_REENTRANT_FPU */
-
.text
ENTRY(wm_sqrt)
pushl %ebp
movl %esp,%ebp
-#ifndef NON_REENTRANT_FPU
subl $28,%esp
-#endif /* NON_REENTRANT_FPU */
pushl %esi
pushl %edi
pushl %ebx
next reply other threads:[~2002-11-03 3:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-03 3:40 Brian Gerst [this message]
2002-11-03 12:37 ` Alan Cox
2002-11-03 14:18 ` Brian Gerst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DC49ABE.2020801@quark.didntduck.org \
--to=bgerst@quark.didntduck.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®