Commit cae55066 authored by Ralf Baechle's avatar Ralf Baechle

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: default avatarRalf Baechle <ralf@linux-mips.org>
parent f80cc08d
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* ######################################################################## * ########################################################################
*/ */
#include <linux/compiler.h>
#include "ieee754int.h" #include "ieee754int.h"
#include "ieee754sp.h" #include "ieee754sp.h"
...@@ -96,7 +97,7 @@ const struct ieee754sp_konst __ieee754sp_spcvals[] = { ...@@ -96,7 +97,7 @@ const struct ieee754sp_konst __ieee754sp_spcvals[] = {
}; };
int ieee754si_xcpt(int r, const char *op, ...) int __cold ieee754si_xcpt(int r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
...@@ -111,7 +112,7 @@ int ieee754si_xcpt(int r, const char *op, ...) ...@@ -111,7 +112,7 @@ int ieee754si_xcpt(int r, const char *op, ...)
return ax.rv.si; return ax.rv.si;
} }
s64 ieee754di_xcpt(s64 r, const char *op, ...) s64 __cold ieee754di_xcpt(s64 r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H #ifndef __ARCH_MIPS_MATH_EMU_IEEE754_H
#define __ARCH_MIPS_MATH_EMU_IEEE754_H #define __ARCH_MIPS_MATH_EMU_IEEE754_H
#include <linux/compiler.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -421,7 +422,7 @@ struct ieee754xctx { ...@@ -421,7 +422,7 @@ struct ieee754xctx {
#define IEEE754_RT_SI 3 #define IEEE754_RT_SI 3
#define IEEE754_RT_DI 4 #define IEEE754_RT_DI 4
extern void ieee754_xcpt(struct ieee754xctx *xcp); extern void __cold ieee754_xcpt(struct ieee754xctx *xcp);
/* compat */ /* compat */
#define ieee754dp_fix(x) ieee754dp_tint(x) #define ieee754dp_fix(x) ieee754dp_tint(x)
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* ######################################################################## * ########################################################################
*/ */
#include <linux/compiler.h>
#include "ieee754dp.h" #include "ieee754dp.h"
...@@ -45,7 +46,7 @@ int ieee754dp_issnan(ieee754dp x) ...@@ -45,7 +46,7 @@ int ieee754dp_issnan(ieee754dp x)
} }
ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...) ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
if (!TSTX()) if (!TSTX())
...@@ -60,7 +61,7 @@ ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...) ...@@ -60,7 +61,7 @@ ieee754dp ieee754dp_xcpt(ieee754dp r, const char *op, ...)
return ax.rv.dp; return ax.rv.dp;
} }
ieee754dp ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* ######################################################################## * ########################################################################
*/ */
#include <linux/compiler.h>
#include "ieee754int.h" #include "ieee754int.h"
...@@ -62,10 +63,10 @@ static inline ieee754dp builddp(int s, int bx, u64 m) ...@@ -62,10 +63,10 @@ static inline ieee754dp builddp(int s, int bx, u64 m)
extern int ieee754dp_isnan(ieee754dp); extern int ieee754dp_isnan(ieee754dp);
extern int ieee754dp_issnan(ieee754dp); extern int ieee754dp_issnan(ieee754dp);
extern int ieee754si_xcpt(int, const char *, ...); extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 ieee754di_xcpt(s64, const char *, ...); extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern ieee754dp ieee754dp_xcpt(ieee754dp, const char *, ...); extern ieee754dp __cold ieee754dp_xcpt(ieee754dp, const char *, ...);
extern ieee754dp ieee754dp_nanxcpt(ieee754dp, const char *, ...); extern ieee754dp __cold ieee754dp_nanxcpt(ieee754dp, const char *, ...);
extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp); extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp);
extern ieee754dp ieee754dp_format(int, int, u64); extern ieee754dp ieee754dp_format(int, int, u64);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* ######################################################################## * ########################################################################
*/ */
#include <linux/compiler.h>
#include "ieee754sp.h" #include "ieee754sp.h"
...@@ -45,7 +46,7 @@ int ieee754sp_issnan(ieee754sp x) ...@@ -45,7 +46,7 @@ int ieee754sp_issnan(ieee754sp x)
} }
ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...) ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
...@@ -61,7 +62,7 @@ ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...) ...@@ -61,7 +62,7 @@ ieee754sp ieee754sp_xcpt(ieee754sp r, const char *op, ...)
return ax.rv.sp; return ax.rv.sp;
} }
ieee754sp ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...)
{ {
struct ieee754xctx ax; struct ieee754xctx ax;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* ######################################################################## * ########################################################################
*/ */
#include <linux/compiler.h>
#include "ieee754int.h" #include "ieee754int.h"
...@@ -68,10 +69,10 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m) ...@@ -68,10 +69,10 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m)
extern int ieee754sp_isnan(ieee754sp); extern int ieee754sp_isnan(ieee754sp);
extern int ieee754sp_issnan(ieee754sp); extern int ieee754sp_issnan(ieee754sp);
extern int ieee754si_xcpt(int, const char *, ...); extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 ieee754di_xcpt(s64, const char *, ...); extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern ieee754sp ieee754sp_xcpt(ieee754sp, const char *, ...); extern ieee754sp __cold ieee754sp_xcpt(ieee754sp, const char *, ...);
extern ieee754sp ieee754sp_nanxcpt(ieee754sp, const char *, ...); extern ieee754sp __cold ieee754sp_nanxcpt(ieee754sp, const char *, ...);
extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp); extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp);
extern ieee754sp ieee754sp_format(int, int, unsigned); extern ieee754sp ieee754sp_format(int, int, unsigned);
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
*************************************************************************/ *************************************************************************/
#include <linux/compiler.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include "ieee754.h" #include "ieee754.h"
...@@ -40,7 +41,7 @@ static const char *const rtnames[] = { ...@@ -40,7 +41,7 @@ static const char *const rtnames[] = {
"sp", "dp", "xp", "si", "di" "sp", "dp", "xp", "si", "di"
}; };
void ieee754_xcpt(struct ieee754xctx *xcp) void __cold ieee754_xcpt(struct ieee754xctx *xcp)
{ {
printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n", printk(KERN_DEBUG "floating point exception in \"%s\", type=%s\n",
xcp->op, rtnames[xcp->rt]); xcp->op, rtnames[xcp->rt]);
......
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