@@ -141,12 +141,30 @@ class RXbyakGenerator : public Xbyak::CodeGenerator {
141
141
movq (addr, reg);
142
142
}
143
143
144
+ void _addsd (const VALUE& xmm_dest, const VALUE& xmm_src) {
145
+ const Xbyak::Xmm& dest = id2xmmx (xmm_dest);
146
+ const Xbyak::Xmm& src = id2xmmx (xmm_src);
147
+ addsd (dest, src);
148
+ }
149
+
150
+ void _subsd (const VALUE& xmm_dest, const VALUE& xmm_src) {
151
+ const Xbyak::Xmm& dest = id2xmmx (xmm_dest);
152
+ const Xbyak::Xmm& src = id2xmmx (xmm_src);
153
+ subsd (dest, src);
154
+ }
155
+
144
156
void _mulsd (const VALUE& xmm_dest, const VALUE& xmm_src) {
145
157
const Xbyak::Xmm& dest = id2xmmx (xmm_dest);
146
158
const Xbyak::Xmm& src = id2xmmx (xmm_src);
147
159
mulsd (dest, src);
148
160
}
149
161
162
+ void _divsd (const VALUE& xmm_dest, const VALUE& xmm_src) {
163
+ const Xbyak::Xmm& dest = id2xmmx (xmm_dest);
164
+ const Xbyak::Xmm& src = id2xmmx (xmm_src);
165
+ divsd (dest, src);
166
+ }
167
+
150
168
void _ret (int imm = 0 ) { ret (imm); }
151
169
void _aaa () { aaa (); }
152
170
void _aad () { aad (); }
@@ -283,14 +301,32 @@ VALUE RXbyak_movq(VALUE self, const VALUE a1, const VALUE a2) {
283
301
return Qnil;
284
302
}
285
303
286
- extern " C"
287
- VALUE RXbyak_mulsd (VALUE self, VALUE a1, VALUE a2) {
288
- RXbyakGenerator* rx;
289
- Data_Get_Struct (self, RXbyakGenerator, rx);
304
+
305
+ extern " C" VALUE RXbyak_addsd (VALUE self, VALUE a1, VALUE a2) {
306
+ RXBYAK_GENERATOR (self, rx);
307
+ rx->_addsd (a1, a2);
308
+ return Qnil;
309
+ }
310
+
311
+ extern " C" VALUE RXbyak_subsd (VALUE self, VALUE a1, VALUE a2) {
312
+ RXBYAK_GENERATOR (self, rx);
313
+ rx->_subsd (a1, a2);
314
+ return Qnil;
315
+ }
316
+
317
+ extern " C" VALUE RXbyak_mulsd (VALUE self, VALUE a1, VALUE a2) {
318
+ RXBYAK_GENERATOR (self, rx);
290
319
rx->_mulsd (a1, a2);
291
320
return Qnil;
292
321
}
293
322
323
+ extern " C" VALUE RXbyak_divsd (VALUE self, VALUE a1, VALUE a2) {
324
+ RXBYAK_GENERATOR (self, rx);
325
+ rx->_divsd (a1, a2);
326
+ return Qnil;
327
+ }
328
+
329
+
294
330
extern " C" VALUE RXbyak_ret (VALUE self) {
295
331
RXBYAK_GENERATOR (self, rx);
296
332
rx->_ret ();
@@ -567,7 +603,10 @@ void Init_RXbyak(void) {
567
603
568
604
rb_define_method (rb_cRXbyak, " mov" , RB_FUNC (RXbyak_mov), 2 );
569
605
rb_define_method (rb_cRXbyak, " movq" , RB_FUNC (RXbyak_movq), 2 );
606
+ rb_define_method (rb_cRXbyak, " addsd" , RB_FUNC (RXbyak_addsd), 2 );
607
+ rb_define_method (rb_cRXbyak, " subsd" , RB_FUNC (RXbyak_subsd), 2 );
570
608
rb_define_method (rb_cRXbyak, " mulsd" , RB_FUNC (RXbyak_mulsd), 2 );
609
+ rb_define_method (rb_cRXbyak, " divsd" , RB_FUNC (RXbyak_divsd), 2 );
571
610
rb_define_method (rb_cRXbyak, " ret" , RB_FUNC (RXbyak_ret), 0 );
572
611
573
612
rb_define_method (rb_cRXbyak, " aaa" , RB_FUNC (RXbyak_aaa), 0 );
0 commit comments