2014-11-18 14:09:12 +00:00
/ *
* This f i l e i s s u b j e c t t o t h e t e r m s a n d c o n d i t i o n s o f t h e G N U G e n e r a l P u b l i c
* License. S e e t h e f i l e " C O P Y I N G " i n t h e m a i n d i r e c t o r y o f t h i s a r c h i v e
* for m o r e d e t a i l s .
*
* FPU c o n t e x t h a n d l i n g c o d e f o r K V M .
*
* Copyright ( C ) 2 0 1 5 I m a g i n a t i o n T e c h n o l o g i e s L t d .
* /
# include < a s m / a s m . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / f p r e g d e f . h >
# include < a s m / m i p s r e g s . h >
# include < a s m / r e g d e f . h >
2016-07-04 19:35:09 +01:00
/* preprocessor replaces the fp in ".set fp=64" with $30 otherwise */
# undef f p
2014-11-18 14:09:12 +00:00
.set noreorder
.set noat
LEAF( _ _ k v m _ s a v e _ f p u )
.set push
SET_ H A R D F L O A T
2016-07-04 19:35:09 +01:00
.set fp=64
2014-11-18 14:09:12 +00:00
mfc0 t 0 , C P 0 _ S T A T U S
sll t 0 , t 0 , 5 # i s S t a t u s . F R s e t ?
bgez t 0 , 1 f # n o : s k i p o d d d o u b l e s
nop
sdc1 $ f1 , V C P U _ F P R 1 ( a0 )
sdc1 $ f3 , V C P U _ F P R 3 ( a0 )
sdc1 $ f5 , V C P U _ F P R 5 ( a0 )
sdc1 $ f7 , V C P U _ F P R 7 ( a0 )
sdc1 $ f9 , V C P U _ F P R 9 ( a0 )
sdc1 $ f11 , V C P U _ F P R 1 1 ( a0 )
sdc1 $ f13 , V C P U _ F P R 1 3 ( a0 )
sdc1 $ f15 , V C P U _ F P R 1 5 ( a0 )
sdc1 $ f17 , V C P U _ F P R 1 7 ( a0 )
sdc1 $ f19 , V C P U _ F P R 1 9 ( a0 )
sdc1 $ f21 , V C P U _ F P R 2 1 ( a0 )
sdc1 $ f23 , V C P U _ F P R 2 3 ( a0 )
sdc1 $ f25 , V C P U _ F P R 2 5 ( a0 )
sdc1 $ f27 , V C P U _ F P R 2 7 ( a0 )
sdc1 $ f29 , V C P U _ F P R 2 9 ( a0 )
sdc1 $ f31 , V C P U _ F P R 3 1 ( a0 )
1 : sdc1 $ f0 , V C P U _ F P R 0 ( a0 )
sdc1 $ f2 , V C P U _ F P R 2 ( a0 )
sdc1 $ f4 , V C P U _ F P R 4 ( a0 )
sdc1 $ f6 , V C P U _ F P R 6 ( a0 )
sdc1 $ f8 , V C P U _ F P R 8 ( a0 )
sdc1 $ f10 , V C P U _ F P R 1 0 ( a0 )
sdc1 $ f12 , V C P U _ F P R 1 2 ( a0 )
sdc1 $ f14 , V C P U _ F P R 1 4 ( a0 )
sdc1 $ f16 , V C P U _ F P R 1 6 ( a0 )
sdc1 $ f18 , V C P U _ F P R 1 8 ( a0 )
sdc1 $ f20 , V C P U _ F P R 2 0 ( a0 )
sdc1 $ f22 , V C P U _ F P R 2 2 ( a0 )
sdc1 $ f24 , V C P U _ F P R 2 4 ( a0 )
sdc1 $ f26 , V C P U _ F P R 2 6 ( a0 )
sdc1 $ f28 , V C P U _ F P R 2 8 ( a0 )
jr r a
sdc1 $ f30 , V C P U _ F P R 3 0 ( a0 )
.set pop
END( _ _ k v m _ s a v e _ f p u )
LEAF( _ _ k v m _ r e s t o r e _ f p u )
.set push
SET_ H A R D F L O A T
2016-07-04 19:35:09 +01:00
.set fp=64
2014-11-18 14:09:12 +00:00
mfc0 t 0 , C P 0 _ S T A T U S
sll t 0 , t 0 , 5 # i s S t a t u s . F R s e t ?
bgez t 0 , 1 f # n o : s k i p o d d d o u b l e s
nop
ldc1 $ f1 , V C P U _ F P R 1 ( a0 )
ldc1 $ f3 , V C P U _ F P R 3 ( a0 )
ldc1 $ f5 , V C P U _ F P R 5 ( a0 )
ldc1 $ f7 , V C P U _ F P R 7 ( a0 )
ldc1 $ f9 , V C P U _ F P R 9 ( a0 )
ldc1 $ f11 , V C P U _ F P R 1 1 ( a0 )
ldc1 $ f13 , V C P U _ F P R 1 3 ( a0 )
ldc1 $ f15 , V C P U _ F P R 1 5 ( a0 )
ldc1 $ f17 , V C P U _ F P R 1 7 ( a0 )
ldc1 $ f19 , V C P U _ F P R 1 9 ( a0 )
ldc1 $ f21 , V C P U _ F P R 2 1 ( a0 )
ldc1 $ f23 , V C P U _ F P R 2 3 ( a0 )
ldc1 $ f25 , V C P U _ F P R 2 5 ( a0 )
ldc1 $ f27 , V C P U _ F P R 2 7 ( a0 )
ldc1 $ f29 , V C P U _ F P R 2 9 ( a0 )
ldc1 $ f31 , V C P U _ F P R 3 1 ( a0 )
1 : ldc1 $ f0 , V C P U _ F P R 0 ( a0 )
ldc1 $ f2 , V C P U _ F P R 2 ( a0 )
ldc1 $ f4 , V C P U _ F P R 4 ( a0 )
ldc1 $ f6 , V C P U _ F P R 6 ( a0 )
ldc1 $ f8 , V C P U _ F P R 8 ( a0 )
ldc1 $ f10 , V C P U _ F P R 1 0 ( a0 )
ldc1 $ f12 , V C P U _ F P R 1 2 ( a0 )
ldc1 $ f14 , V C P U _ F P R 1 4 ( a0 )
ldc1 $ f16 , V C P U _ F P R 1 6 ( a0 )
ldc1 $ f18 , V C P U _ F P R 1 8 ( a0 )
ldc1 $ f20 , V C P U _ F P R 2 0 ( a0 )
ldc1 $ f22 , V C P U _ F P R 2 2 ( a0 )
ldc1 $ f24 , V C P U _ F P R 2 4 ( a0 )
ldc1 $ f26 , V C P U _ F P R 2 6 ( a0 )
ldc1 $ f28 , V C P U _ F P R 2 8 ( a0 )
jr r a
ldc1 $ f30 , V C P U _ F P R 3 0 ( a0 )
.set pop
END( _ _ k v m _ r e s t o r e _ f p u )
LEAF( _ _ k v m _ r e s t o r e _ f c s r )
.set push
SET_ H A R D F L O A T
lw t 0 , V C P U _ F C R 3 1 ( a0 )
/ *
* The c t c1 m u s t s t a y a t t h i s o f f s e t i n _ _ k v m _ r e s t o r e _ f c s r .
* See k v m _ m i p s _ c s r _ d i e _ n o t i f y ( ) w h i c h h a n d l e s t 0 c o n t a i n i n g a v a l u e
* which t r i g g e r s a n F P E x c e p t i o n , w h i c h m u s t b e s t e p p e d o v e r a n d
* ignored s i n c e t h e s e t c a u s e b i t s m u s t r e m a i n t h e r e f o r t h e g u e s t .
* /
ctc1 t 0 , f c r31
jr r a
nop
.set pop
END( _ _ k v m _ r e s t o r e _ f c s r )