#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/perf_event.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include <asm/io.h>
#include "sfp-util.h"
#include <math-emu/soft-fp.h>
#include <math-emu/single.h>
#include <math-emu/double.h>
Go to the source code of this file.
|
#define | FPUL (fregs->fpul) |
|
#define | FPSCR (fregs->fpscr) |
|
#define | FPSCR_RM (FPSCR&3) |
|
#define | FPSCR_DN ((FPSCR>>18)&1) |
|
#define | FPSCR_PR ((FPSCR>>19)&1) |
|
#define | FPSCR_SZ ((FPSCR>>20)&1) |
|
#define | FPSCR_FR ((FPSCR>>21)&1) |
|
#define | FPSCR_MASK 0x003fffffUL |
|
#define | BANK(n) (n^(FPSCR_FR?16:0)) |
|
#define | FR ((unsigned long*)(fregs->fp_regs)) |
|
#define | FR0 (FR[BANK(0)]) |
|
#define | FRn (FR[BANK(n)]) |
|
#define | FRm (FR[BANK(m)]) |
|
#define | DR ((unsigned long long*)(fregs->fp_regs)) |
|
#define | DRn (DR[BANK(n)/2]) |
|
#define | DRm (DR[BANK(m)/2]) |
|
#define | XREG(n) (n^16) |
|
#define | XFn (FR[BANK(XREG(n))]) |
|
#define | XFm (FR[BANK(XREG(m))]) |
|
#define | XDn (DR[BANK(XREG(n))/2]) |
|
#define | XDm (DR[BANK(XREG(m))/2]) |
|
#define | R0 (regs->regs[0]) |
|
#define | Rn (regs->regs[n]) |
|
#define | Rm (regs->regs[m]) |
|
#define | WRITE(d, a) ({if(put_user(d, (typeof (d)*)a)) return -EFAULT;}) |
|
#define | READ(d, a) ({if(get_user(d, (typeof (d)*)a)) return -EFAULT;}) |
|
#define | PACK_S(r, f) FP_PACK_SP(&r,f) |
|
#define | UNPACK_S(f, r) FP_UNPACK_SP(f,&r) |
|
#define | PACK_D(r, f) {u32 t[2]; FP_PACK_DP(t,f); ((u32*)&r)[0]=t[1]; ((u32*)&r)[1]=t[0];} |
|
#define | UNPACK_D(f, r) {u32 t[2]; t[0]=((u32*)&r)[1]; t[1]=((u32*)&r)[0]; FP_UNPACK_DP(f,t);} |
|
#define | BOTH_PRmn(op, x) FP_DECL_EX; if(FPSCR_PR) op(D,x,DRm,DRn); else op(S,x,FRm,FRn); |
|
#define | CMP_X(SZ, R, M, N) |
|
#define | EQ_X(SZ, R, M, N) |
|
#define | CMP(OP) ({ int r; BOTH_PRmn(OP##_X,r); r; }) |
|
#define | ARITH_X(SZ, OP, M, N) |
|
#define | FMOV_EXT(x) if(x&1) x+=16-1 |
|
#define | NOTYETn(i) |
|
#define | EMU_FLOAT_X(SZ, N) |
|
#define | EMU_FTRC_X(SZ, N) |
|
#define ARITH_X |
( |
|
SZ, |
|
|
|
OP, |
|
|
|
M, |
|
|
|
N |
|
) |
| |
Value:do{ \
FP_DECL_##
SZ(Fm); FP_DECL_##
SZ(Fn); FP_DECL_##
SZ(Fr); \
UNPACK_##
SZ(Fm,
M); UNPACK_##
SZ(Fn,
N); \
FP_##
OP##
_##
SZ(Fr, Fn, Fm); \
PACK_##
SZ(
N, Fr); }
while(0)
Definition at line 99 of file math.c.
#define CMP_X |
( |
|
SZ, |
|
|
|
R, |
|
|
|
M, |
|
|
|
N |
|
) |
| |
Value:do{ \
FP_DECL_##
SZ(Fm); FP_DECL_##
SZ(Fn); \
UNPACK_##
SZ(Fm,
M); UNPACK_##
SZ(Fn,
N); \
FP_CMP_##
SZ(
R, Fn, Fm, 2); }
while(0)
Definition at line 68 of file math.c.
#define DR ((unsigned long long*)(fregs->fp_regs)) |
#define EMU_FLOAT_X |
( |
|
SZ, |
|
|
|
N |
|
) |
| |
Value:do { \
FP_FROM_INT_##
SZ(Fn,
FPUL, 32,
int); \
PACK_##
SZ(
N, Fn); }
while(0)
#define EMU_FTRC_X |
( |
|
SZ, |
|
|
|
N |
|
) |
| |
Value:do { \
FP_TO_INT_##
SZ(
FPUL, Fn, 32, 1); }
while(0)
Definition at line 301 of file math.c.
#define EQ_X |
( |
|
SZ, |
|
|
|
R, |
|
|
|
M, |
|
|
|
N |
|
) |
| |
Value:do{ \
FP_DECL_##
SZ(Fm); FP_DECL_##
SZ(Fn); \
UNPACK_##
SZ(Fm,
M); UNPACK_##
SZ(Fn,
N); \
FP_CMP_EQ_##
SZ(
R, Fn, Fm); }
while(0)
Definition at line 72 of file math.c.
#define FMOV_EXT |
( |
|
x | ) |
if(x&1) x+=16-1 |
#define FPSCR (fregs->fpscr) |
#define FPSCR_DN ((FPSCR>>18)&1) |
#define FPSCR_FR ((FPSCR>>21)&1) |
#define FPSCR_MASK 0x003fffffUL |
#define FPSCR_PR ((FPSCR>>19)&1) |
#define FPSCR_RM (FPSCR&3) |
#define FPSCR_SZ ((FPSCR>>20)&1) |
#define FPUL (fregs->fpul) |
#define FR ((unsigned long*)(fregs->fp_regs)) |
Value:
{
printk( #
i " not yet done.\n");
return 0; }
Definition at line 276 of file math.c.
do_fpu_inst - Handle reserved instructions for FPU emulation : instruction code. : registers on stack.
Definition at line 617 of file math.c.