diff options
author | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2010-10-18 01:47:09 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s144.Millennium.Berkeley.EDU> | 2010-10-18 01:47:09 -0700 |
commit | 77c382ff239f61ee9846a7abb6d96a6434b52b56 (patch) | |
tree | 44be4c6cf17b74bd0d87c2498c5a781f9be11156 /pk/pcr.h | |
parent | 68879a67d0f49323e1e2f8358d19bc1d94bb9f30 (diff) | |
download | pk-77c382ff239f61ee9846a7abb6d96a6434b52b56.zip pk-77c382ff239f61ee9846a7abb6d96a6434b52b56.tar.gz pk-77c382ff239f61ee9846a7abb6d96a6434b52b56.tar.bz2 |
[pk] improved performance of fp emulation
Diffstat (limited to 'pk/pcr.h')
-rw-r--r-- | pk/pcr.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -23,6 +23,9 @@ #define PCR_K0 24 #define PCR_K1 25 +#define CR_FSR 0 +#define CR_TID 29 + #define TIMER_PERIOD 0x1000000 #define ASM_CR(r) _ASM_CR(r) @@ -37,6 +40,13 @@ asm volatile ("mfpcr %0,$cr%1" : "=r"(__tmp) : "i"(reg)); \ __tmp; }) +#define mtcr(val,reg) ({ long __tmp = (long)(val); \ + asm volatile ("mtcr %0,$cr%1"::"r"(__tmp),"i"(reg)); }) + +#define mfcr(reg) ({ long __tmp; \ + asm volatile ("mfcr %0,$cr%1" : "=r"(__tmp) : "i"(reg)); \ + __tmp; }) + #endif #endif |