xref: /plan9/sys/src/cmd/5i/float.c (revision 59cc4ca53493a3c6d2349fe2b7f7c40f7dce7294)
1 #include <u.h>
2 #include <libc.h>
3 #include <bio.h>
4 #include <mach.h>
5 #include "arm.h"
6 
7 void	unimp(ulong);
8 void	Ifcmp(ulong);
9 void	Ifdiv(ulong);
10 void	Ifmul(ulong);
11 void	Ifadd(ulong);
12 void	Ifsub(ulong);
13 void	Ifmov(ulong);
14 void	Icvtd(ulong);
15 void	Icvtw(ulong);
16 void	Icvts(ulong);
17 void	Ifabs(ulong);
18 void	Ifneg(ulong);
19 
20 Inst cop1[] = {
21 	{ Ifadd,	"add.f", Ifloat },
22 	{ Ifsub,	"sub.f", Ifloat },
23 	{ Ifmul,	"mul.f", Ifloat },
24 	{ Ifdiv,	"div.f", Ifloat },
25 	{ unimp,	"", },
26 	{ Ifabs,	"abs.f", Ifloat },
27 	{ Ifmov,	"mov.f", Ifloat },
28 	{ Ifneg,	"neg.f", Ifloat },
29 	{ unimp,	"", },
30 	{ unimp,	"", },
31 	{ unimp,	"", },
32 	{ unimp,	"", },
33 	{ unimp,	"", },
34 	{ unimp,	"", },
35 	{ unimp,	"", },
36 	{ unimp,	"", },
37 	{ unimp,	"", },
38 	{ unimp,	"", },
39 	{ unimp,	"", },
40 	{ unimp,	"", },
41 	{ unimp,	"", },
42 	{ unimp,	"", },
43 	{ unimp,	"", },
44 	{ unimp,	"", },
45 	{ unimp,	"", },
46 	{ unimp,	"", },
47 	{ unimp,	"", },
48 	{ unimp,	"", },
49 	{ unimp,	"", },
50 	{ unimp,	"", },
51 	{ unimp,	"", },
52 	{ unimp,	"", },
53 	{ Icvts,	"cvt.s", Ifloat },
54 	{ Icvtd,	"cvt.d", Ifloat },
55 	{ unimp,	"", },
56 	{ unimp,	"", },
57 	{ Icvtw,	"cvt.w", Ifloat },
58 	{ unimp,	"", },
59 	{ unimp,	"", },
60 	{ unimp,	"", },
61 	{ unimp,	"", },
62 	{ unimp,	"", },
63 	{ unimp,	"", },
64 	{ unimp,	"", },
65 	{ unimp,	"", },
66 	{ unimp,	"", },
67 	{ unimp,	"", },
68 	{ unimp,	"", },
69 	{ Ifcmp,	"c.f",	 Ifloat },
70 	{ Ifcmp,	"c.un",  Ifloat },
71 	{ Ifcmp,	"c.eq",  Ifloat },
72 	{ Ifcmp,	"c.ueq", Ifloat },
73 	{ Ifcmp,	"c.olt", Ifloat },
74 	{ Ifcmp,	"c.ult", Ifloat },
75 	{ Ifcmp,	"c.ole", Ifloat },
76 	{ Ifcmp,	"c.ule", Ifloat },
77 	{ Ifcmp,	"c,sf",  Ifloat },
78 	{ Ifcmp,	"c.ngle",Ifloat },
79 	{ Ifcmp,	"c.seq", Ifloat },
80 	{ Ifcmp,	"c.ngl", Ifloat },
81 	{ Ifcmp,	"c.lt",  Ifloat },
82 	{ Ifcmp,	"c.nge", Ifloat },
83 	{ Ifcmp,	"c.le",  Ifloat },
84 	{ Ifcmp,	"c.ngt", Ifloat },
85 	{ 0 }
86 };
87 
88 void
unimp(ulong inst)89 unimp(ulong inst)
90 {
91 	print("op %d\n", inst&0x3f);
92 	Bprint(bioout, "Unimplemented floating point Trap IR %.8lux\n", inst);
93 	longjmp(errjmp, 0);
94 }
95 
96 void
inval(ulong inst)97 inval(ulong inst)
98 {
99 	Bprint(bioout, "Invalid Operation Exception IR %.8lux\n", inst);
100 	longjmp(errjmp, 0);
101 }
102 
103 void
ifmt(int r)104 ifmt(int r)
105 {
106 	Bprint(bioout, "Invalid Floating Data Format f%d pc 0x%lux\n", r, reg.r[15]);
107 	longjmp(errjmp, 0);
108 }
109 
110 void
floatop(int dst,int s1,int s2)111 floatop(int dst, int s1, int s2)
112 {
113 }
114 
115 void
doubop(int dst,int s1,int s2)116 doubop(int dst, int s1, int s2)
117 {
118 }
119 
120 void
Iswc1(ulong inst)121 Iswc1(ulong inst)
122 {
123 }
124 
125 void
Ifsub(ulong ir)126 Ifsub(ulong ir)
127 {
128 }
129 
130 void
Ifmov(ulong ir)131 Ifmov(ulong ir)
132 {
133 }
134 
135 void
Ifabs(ulong ir)136 Ifabs(ulong ir)
137 {
138 }
139 
140 void
Ifneg(ulong ir)141 Ifneg(ulong ir)
142 {
143 }
144 
145 void
Icvtd(ulong ir)146 Icvtd(ulong ir)
147 {
148 }
149 
150 void
Icvts(ulong ir)151 Icvts(ulong ir)
152 {
153 }
154 
155 void
Icvtw(ulong ir)156 Icvtw(ulong ir)
157 {
158 }
159 
160 void
Ifadd(ulong ir)161 Ifadd(ulong ir)
162 {
163 }
164 
165 void
Ifmul(ulong ir)166 Ifmul(ulong ir)
167 {
168 }
169 
170 void
Ifdiv(ulong ir)171 Ifdiv(ulong ir)
172 {
173 }
174 
175 void
Ilwc1(ulong inst)176 Ilwc1(ulong inst)
177 {
178 }
179 
180 void
Ibcfbct(ulong inst)181 Ibcfbct(ulong inst)
182 {
183 }
184 
185 void
Imtct(ulong ir)186 Imtct(ulong ir)
187 {
188 }
189 
190 void
Imfcf(ulong ir)191 Imfcf(ulong ir)
192 {
193 }
194 
195 void
Icop1(ulong ir)196 Icop1(ulong ir)
197 {
198 }
199 
200 void
Ifcmp(ulong ir)201 Ifcmp(ulong ir)
202 {
203 }
204