OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [sysvnecv70/] [fpx.c] - Blame information for rev 309

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <ieeefp.h>
2
#include <machine/registers.h>
3
 
4
 
5
fp_except _DEFUN(fpsetmask,(newmask),
6
                fp_except newmask)
7
 
8
{
9
  fp_except oldmask;
10
  v60_tkcw_type tkcw;
11
 
12
  sysv60(0, 8, &tkcw);
13
  oldmask = tkcw.fp_trap;
14
  tkcw.fp_trap = newmask;
15
  sysv60(0, 8, &tkcw);
16
  return oldmask;
17
 
18
}
19
 
20
fp_except _DEFUN_VOID(fpgetmask)
21
{
22
  v60_tkcw_type tkcw;
23
  sysv60(0, 8, &tkcw);
24
  return tkcw.fp_trap;
25
}
26
 
27
 
28
fp_rnd _DEFUN_VOID(fpgetround)
29
{
30
  v60_tkcw_type tkcw;
31
  sysv60(0, 8, &tkcw);
32
  return tkcw.fp_rounding;
33
}
34
 
35
fp_rnd _DEFUN(fpsetround,(rnd),
36
             fp_rnd rnd)
37
{
38
  fp_rnd oldrnd;
39
  v60_tkcw_type tkcw;
40
 
41
  sysv60(0, 8, &tkcw);
42
  oldrnd = tkcw.fp_rounding;
43
  tkcw.fp_rounding = rnd;
44
  sysv60(0, 8, &tkcw);
45
  return oldrnd;
46
}
47
 
48
 
49
 
50
 
51
 
52
fp_rdi _DEFUN_VOID(fpgetroundtoi)
53
{
54
  v60_tkcw_type tkcw;
55
  sysv60(0, 8, &tkcw);
56
  return tkcw.integer_rounding;
57
}
58
 
59
fp_rdi _DEFUN(fpsetroundtoi,(rnd),
60
             fp_rdi rnd)
61
{
62
  fp_rdi oldrnd;
63
  v60_tkcw_type tkcw;
64
 
65
  sysv60(0, 8, &tkcw);
66
  oldrnd = tkcw.integer_rounding;
67
  tkcw.integer_rounding = rnd;
68
  sysv60(0, 8, &tkcw);
69
  return oldrnd;
70
}
71
 
72
 
73
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.