Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fpx.c « sysvnecv70 « sys « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 957a9b8d83049fac5c1b0081c128c785735be0f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <ieeefp.h>
#include <machine/registers.h>


fp_except fpsetmask (fp_except newmask)

{
  fp_except oldmask;
  v60_tkcw_type tkcw;
  
  sysv60(0, 8, &tkcw);
  oldmask = tkcw.fp_trap;
  tkcw.fp_trap = newmask;
  sysv60(0, 8, &tkcw);
  return oldmask;

}

fp_except fpgetmask (void)
{
  v60_tkcw_type tkcw;
  sysv60(0, 8, &tkcw);
  return tkcw.fp_trap;
}


fp_rnd fpgetround (void)
{
  v60_tkcw_type tkcw;
  sysv60(0, 8, &tkcw);
  return tkcw.fp_rounding;
}

fp_rnd fpsetround (fp_rnd rnd)
{
  fp_rnd oldrnd;
  v60_tkcw_type tkcw;
  
  sysv60(0, 8, &tkcw);
  oldrnd = tkcw.fp_rounding;
  tkcw.fp_rounding = rnd;
  sysv60(0, 8, &tkcw);
  return oldrnd;
}





fp_rdi fpgetroundtoi (void)
{
  v60_tkcw_type tkcw;
  sysv60(0, 8, &tkcw);
  return tkcw.integer_rounding;
}

fp_rdi fpsetroundtoi (fp_rdi rnd)
{
  fp_rdi oldrnd;
  v60_tkcw_type tkcw;
  
  sysv60(0, 8, &tkcw);
  oldrnd = tkcw.integer_rounding;
  tkcw.integer_rounding = rnd;
  sysv60(0, 8, &tkcw);
  return oldrnd;
}