diff options
author | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-01-15 05:21:31 -0500 |
---|---|---|
committer | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-03-16 21:19:11 -0400 |
commit | d9bc15794d122cb7bdc9a069d22f3d3166dd31d4 (patch) | |
tree | 67f80672dd1770c7c12179766517e29b35fc02d4 /arch/unicore32/include | |
parent | 64909882862e9bb88aa6177e3f92056f5601b3e3 (diff) |
unicore32 additional architecture files: float point handling
This patch implements support for float point unit, which using UniCore-F64 FPU hardware
in UniCore32 ISA.
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32/include')
-rw-r--r-- | arch/unicore32/include/asm/fpstate.h | 26 | ||||
-rw-r--r-- | arch/unicore32/include/asm/fpu-ucf64.h | 53 |
2 files changed, 79 insertions, 0 deletions
diff --git a/arch/unicore32/include/asm/fpstate.h b/arch/unicore32/include/asm/fpstate.h new file mode 100644 index 000000000000..ba97fac6220d --- /dev/null +++ b/arch/unicore32/include/asm/fpstate.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * linux/arch/unicore32/include/asm/fpstate.h | ||
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | ||
6 | * Copyright (C) 2001-2010 GUAN Xue-tao | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __UNICORE_FPSTATE_H__ | ||
14 | #define __UNICORE_FPSTATE_H__ | ||
15 | |||
16 | #ifndef __ASSEMBLY__ | ||
17 | |||
18 | #define FP_REGS_NUMBER 33 | ||
19 | |||
20 | struct fp_state { | ||
21 | unsigned int regs[FP_REGS_NUMBER]; | ||
22 | } __attribute__((aligned(8))); | ||
23 | |||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/unicore32/include/asm/fpu-ucf64.h b/arch/unicore32/include/asm/fpu-ucf64.h new file mode 100644 index 000000000000..16c1457882ee --- /dev/null +++ b/arch/unicore32/include/asm/fpu-ucf64.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * linux/arch/unicore32/include/asm/fpu-ucf64.h | ||
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | ||
6 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> | ||
7 | * Copyright (C) 2001-2010 Guan Xuetao | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | #define FPSCR s31 | ||
14 | |||
15 | /* FPSCR bits */ | ||
16 | #define FPSCR_DEFAULT_NAN (1<<25) | ||
17 | |||
18 | #define FPSCR_CMPINSTR_BIT (1<<31) | ||
19 | |||
20 | #define FPSCR_CON (1<<29) | ||
21 | #define FPSCR_TRAP (1<<27) | ||
22 | |||
23 | /* RND mode */ | ||
24 | #define FPSCR_ROUND_NEAREST (0<<0) | ||
25 | #define FPSCR_ROUND_PLUSINF (2<<0) | ||
26 | #define FPSCR_ROUND_MINUSINF (3<<0) | ||
27 | #define FPSCR_ROUND_TOZERO (1<<0) | ||
28 | #define FPSCR_RMODE_BIT (0) | ||
29 | #define FPSCR_RMODE_MASK (7 << FPSCR_RMODE_BIT) | ||
30 | |||
31 | /* trap enable */ | ||
32 | #define FPSCR_IOE (1<<16) | ||
33 | #define FPSCR_OFE (1<<14) | ||
34 | #define FPSCR_UFE (1<<13) | ||
35 | #define FPSCR_IXE (1<<12) | ||
36 | #define FPSCR_HIE (1<<11) | ||
37 | #define FPSCR_NDE (1<<10) /* non denomal */ | ||
38 | |||
39 | /* flags */ | ||
40 | #define FPSCR_IDC (1<<24) | ||
41 | #define FPSCR_HIC (1<<23) | ||
42 | #define FPSCR_IXC (1<<22) | ||
43 | #define FPSCR_OFC (1<<21) | ||
44 | #define FPSCR_UFC (1<<20) | ||
45 | #define FPSCR_IOC (1<<19) | ||
46 | |||
47 | /* stick bits */ | ||
48 | #define FPSCR_IOS (1<<9) | ||
49 | #define FPSCR_OFS (1<<7) | ||
50 | #define FPSCR_UFS (1<<6) | ||
51 | #define FPSCR_IXS (1<<5) | ||
52 | #define FPSCR_HIS (1<<4) | ||
53 | #define FPSCR_NDS (1<<3) /*non denomal */ | ||