aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-04-15 18:47:59 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-05-21 05:12:47 -0400
commitcae55066cb1ce3f8572ddddbd3ec3c54b973a89c (patch)
tree91b106168432448ebb07766cc4e88bf778739036 /arch/mips/math-emu
parentf80cc08d78556bdc66bf0b75ec412688d8ec6907 (diff)
MIPS: math-emu: Mark exception handling functions as __cold.
Optimizes the code flow and shaves of half a percent of the math-emu code size. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu')
-rw-r--r--arch/mips/math-emu/ieee754.c5
-rw-r--r--arch/mips/math-emu/ieee754.h3
-rw-r--r--arch/mips/math-emu/ieee754dp.c5
-rw-r--r--arch/mips/math-emu/ieee754dp.h9
-rw-r--r--arch/mips/math-emu/ieee754sp.c5
-rw-r--r--arch/mips/math-emu/ieee754sp.h9
-rw-r--r--arch/mips/math-emu/ieee754xcpt.c3
7 files changed, 23 insertions, 16 deletions
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index 0015cf1989da..e7c314c9f46a 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -28,6 +28,7 @@
28 * ######################################################################## 28 * ########################################################################
29 */ 29 */
30 30
31#include <linux/compiler.h>
31 32
32#include "ieee754int.h" 33#include "ieee754int.h"
33#include "ieee754sp.h" 34#include "ieee754sp.h"
@@ -96,7 +97,7 @@ const struct ieee754sp_konst __ieee754sp_spcvals[] = {
96}; 97};
97 98
98 99
99int ieee754si_xcpt(int r, const char *op, ...) 100int __cold ieee754si_xcpt(int r, const char *op, ...)
100{ 101{
101 struct ieee754xctx ax; 102 struct ieee754xctx ax;
102 103
@@ -111,7 +112,7 @@ int ieee754si_xcpt(int r, const char *op, ...)
111 return ax.rv.si; 112 return ax.rv.si;
112} 113}
113 114
114s64 ieee754di_xcpt(s64 r, const char *op, ...) 115s64 __cold ieee754di_xcpt(s64 r, const char *op, ...)
115{ 116{
116 struct ieee754xctx ax; 117 struct ieee754xctx ax;
117 118
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
index fe61d16cf644..967831e3206f 100644
--- a/arch/mips/math-emu/ieee754.h
+++ b/arch/mips/math-emu/ieee754.h
@@ -24,6 +24,7 @@
24#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H 24#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H
25#define __ARCH_MIPS_MATH_EMU_IEEE754_H 25#define __ARCH_MIPS_MATH_EMU_IEEE754_H
26 26
27#include <linux/compiler.h>
27#include <asm/byteorder.h> 28#include <asm/byteorder.h>
28#include <linux/types.h> 29#include <linux/types.h>
29#include <linux/sched.h> 30#include <linux/sched.h>
@@ -421,7 +422,7 @@ struct ieee754xctx {
421#define IEEE754_RT_SI 3 422#define IEEE754_RT_SI 3
422#define IEEE754_RT_DI 4 423#define IEEE754_RT_DI 4
423 424
424extern void ieee754_xcpt(struct ieee754xctx *xcp); 425extern void __cold ieee754_xcpt(struct ieee754xctx *xcp);
425 426
426/* compat */ 427/* compat */
427#define ieee754dp_fix(x) ieee754dp_tint(x) 428#define ieee754dp_fix(x) ieee754dp_tint(x)
diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c
index 068e56be8de9..df59d16bd4fd 100644
--- a/arch/mips/math-emu/ieee754dp.c
+++ b/arch/mips/math-emu/ieee754dp.c
@@ -23,6 +23,7 @@
23 * ######################################################################## 23 * ########################################################################
24 */ 24 */
25 25
26#include <linux/compiler.h>
26 27
27#include "ieee754dp.h" 28#include "ieee754dp.h"
28 29
@@ -45,7 +46,7 @@ int ieee754dp_issnan(ieee754dp x)
45} 46}
46 47
47 48
48ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...) 49ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...)
49{ 50{
50 struct ieee754xctx ax; 51 struct ieee754xctx ax;
51 if (!TSTX()) 52 if (!TSTX())
@@ -60,7 +61,7 @@ ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...)
60 return ax.rv.dp; 61 return ax.rv.dp;
61} 62}
62 63
63ieee754dp ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) 64ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
64{ 65{
65 struct ieee754xctx ax; 66 struct ieee754xctx ax;
66 67
diff --git a/arch/mips/math-emu/ieee754dp.h b/arch/mips/math-emu/ieee754dp.h
index f139c724c59a..ce2af5b04b48 100644
--- a/arch/mips/math-emu/ieee754dp.h
+++ b/arch/mips/math-emu/ieee754dp.h
@@ -24,6 +24,7 @@
24 * ######################################################################## 24 * ########################################################################
25 */ 25 */
26 26
27#include <linux/compiler.h>
27 28
28#include "ieee754int.h" 29#include "ieee754int.h"
29 30
@@ -62,10 +63,10 @@ static inline ieee754dp builddp(int s, int bx, u64 m)
62 63
63extern int ieee754dp_isnan(ieee754dp); 64extern int ieee754dp_isnan(ieee754dp);
64extern int ieee754dp_issnan(ieee754dp); 65extern int ieee754dp_issnan(ieee754dp);
65extern int ieee754si_xcpt(int, const char *, ...); 66extern int __cold ieee754si_xcpt(int, const char *, ...);
66extern s64 ieee754di_xcpt(s64, const char *, ...); 67extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
67extern ieee754dp ieee754dp_xcpt(ieee754dp, const char *, ...); 68extern ieee754dp __cold ieee754dp_xcpt(ieee754dp, const char *, ...);
68extern ieee754dp ieee754dp_nanxcpt(ieee754dp, const char *, ...); 69extern ieee754dp __cold ieee754dp_nanxcpt(ieee754dp, const char *, ...);
69extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp); 70extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp);
70extern ieee754dp ieee754dp_format(int, int, u64); 71extern ieee754dp ieee754dp_format(int, int, u64);
71 72
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
index 15d1e36cfe64..dd3ecd62e469 100644
--- a/arch/mips/math-emu/ieee754sp.c
+++ b/arch/mips/math-emu/ieee754sp.c
@@ -23,6 +23,7 @@
23 * ######################################################################## 23 * ########################################################################
24 */ 24 */
25 25
26#include <linux/compiler.h>
26 27
27#include "ieee754sp.h" 28#include "ieee754sp.h"
28 29
@@ -45,7 +46,7 @@ int ieee754sp_issnan(ieee754sp x)
45} 46}
46 47
47 48
48ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...) 49ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...)
49{ 50{
50 struct ieee754xctx ax; 51 struct ieee754xctx ax;
51 52
@@ -61,7 +62,7 @@ ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...)
61 return ax.rv.sp; 62 return ax.rv.sp;
62} 63}
63 64
64ieee754sp ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) 65ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...)
65{ 66{
66 struct ieee754xctx ax; 67 struct ieee754xctx ax;
67 68
diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
index 754fd54649b5..e3933bed0be4 100644
--- a/arch/mips/math-emu/ieee754sp.h
+++ b/arch/mips/math-emu/ieee754sp.h
@@ -24,6 +24,7 @@
24 * ######################################################################## 24 * ########################################################################
25 */ 25 */
26 26
27#include <linux/compiler.h>
27 28
28#include "ieee754int.h" 29#include "ieee754int.h"
29 30
@@ -68,10 +69,10 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m)
68 69
69extern int ieee754sp_isnan(ieee754sp); 70extern int ieee754sp_isnan(ieee754sp);
70extern int ieee754sp_issnan(ieee754sp); 71extern int ieee754sp_issnan(ieee754sp);
71extern int ieee754si_xcpt(int, const char *, ...); 72extern int __cold ieee754si_xcpt(int, const char *, ...);
72extern s64 ieee754di_xcpt(s64, const char *, ...); 73extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
73extern ieee754sp ieee754sp_xcpt(ieee754sp, const char *, ...); 74extern ieee754sp __cold ieee754sp_xcpt(ieee754sp, const char *, ...);
74extern ieee754sp ieee754sp_nanxcpt(ieee754sp, const char *, ...); 75extern ieee754sp __cold ieee754sp_nanxcpt(ieee754sp, const char *, ...);
75extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp); 76extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp);
76extern ieee754sp ieee754sp_format(int, int, unsigned); 77extern ieee754sp ieee754sp_format(int, int, unsigned);
77 78
diff --git a/arch/mips/math-emu/ieee754xcpt.c b/arch/mips/math-emu/ieee754xcpt.c
index 967167116ae8..005bbb184781 100644
--- a/arch/mips/math-emu/ieee754xcpt.c
+++ b/arch/mips/math-emu/ieee754xcpt.c
@@ -28,6 +28,7 @@
28 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 28 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
29 *************************************************************************/ 29 *************************************************************************/
30 30
31#include <linux/compiler.h>
31#include <linux/kernel.h> 32#include <linux/kernel.h>
32#include "ieee754.h" 33#include "ieee754.h"
33 34
@@ -40,7 +41,7 @@ static const char *const rtnames[] = {
40 "sp", "dp", "xp", "si", "di" 41 "sp", "dp", "xp", "si", "di"
41}; 42};
42 43
43void ieee754_xcpt(struct ieee754xctx *xcp) 44void __cold ieee754_xcpt(struct ieee754xctx *xcp)
44{ 45{
45 printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n", 46 printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n",
46 xcp->op, rtnames[xcp->rt]); 47 xcp->op, rtnames[xcp->rt]);