9 #include "gen_ia32_emitter.h" 11 #include "beemithlp.h" 12 #include "gen_ia32_new_nodes.h" 13 #include "ia32_emitter.h" 15 static void emit_ia32_Adc(
ir_node const *
const node)
17 ia32_emitf(node,
"adc%M %B");
20 static void enc_ia32_Adc(
ir_node const *
const node)
23 ia32_enc_binop(node, 2);
26 static void emit_ia32_Add(
ir_node const *
const node)
28 ia32_emitf(node,
"add%M %B");
31 static void enc_ia32_Add(
ir_node const *
const node)
34 ia32_enc_binop(node, 0);
37 static void emit_ia32_AddMem(
ir_node const *
const node)
39 ia32_emitf(node,
"add%M %S3, %AM");
42 static void enc_ia32_AddMem(
ir_node const *
const node)
45 ia32_enc_binop_mem(node, 0);
48 static void emit_ia32_AddSP(
ir_node const *
const node)
50 ia32_emitf(node,
"addl %B");
53 static void emit_ia32_Adds(
ir_node const *
const node)
55 ia32_emitf(node,
"adds%FX %B");
58 static void emit_ia32_And(
ir_node const *
const node)
60 ia32_emitf(node,
"and%M %B");
63 static void enc_ia32_And(
ir_node const *
const node)
66 ia32_enc_binop(node, 4);
69 static void emit_ia32_AndMem(
ir_node const *
const node)
71 ia32_emitf(node,
"and%M %S3, %AM");
74 static void enc_ia32_AndMem(
ir_node const *
const node)
77 ia32_enc_binop_mem(node, 4);
80 static void emit_ia32_Andnp(
ir_node const *
const node)
82 ia32_emitf(node,
"andnp%FX %B");
85 static void emit_ia32_Andp(
ir_node const *
const node)
87 ia32_emitf(node,
"andp%FX %B");
90 static void emit_ia32_Breakpoint(
ir_node const *
const node)
92 ia32_emitf(node,
"int3");
95 static void enc_ia32_Breakpoint(
ir_node const *
const node)
98 ia32_enc_simple(0xCC);
101 static void emit_ia32_Bsf(
ir_node const *
const node)
103 ia32_emitf(node,
"bsf%M %AS3, %D0");
106 static void enc_ia32_Bsf(
ir_node const *
const node)
109 ia32_enc_0f_unop_reg(node, 0xBC, n_ia32_Bsf_operand);
112 static void emit_ia32_Bsr(
ir_node const *
const node)
114 ia32_emitf(node,
"bsr%M %AS3, %D0");
117 static void enc_ia32_Bsr(
ir_node const *
const node)
120 ia32_enc_0f_unop_reg(node, 0xBD, n_ia32_Bsr_operand);
123 static void emit_ia32_Bswap(
ir_node const *
const node)
125 ia32_emitf(node,
"bswap%M %D0");
128 static void emit_ia32_Bswap16(
ir_node const *
const node)
130 ia32_emitf(node,
"xchg %<D0, %>D0");
133 static void emit_ia32_Bt(
ir_node const *
const node)
135 ia32_emitf(node,
"bt%M %S1, %S0");
138 static void emit_ia32_CMovcc(
ir_node const *
const node)
140 ia32_emitf(node,
"cmov%P5 %B");
143 static void emit_ia32_Call(
ir_node const *
const node)
145 ia32_emitf(node,
"call %*AS3");
148 static void emit_ia32_Cltd(
ir_node const *
const node)
150 ia32_emitf(node,
"cltd");
153 static void enc_ia32_Cltd(
ir_node const *
const node)
156 ia32_enc_simple(0x99);
159 static void emit_ia32_Cmc(
ir_node const *
const node)
161 ia32_emitf(node,
"cmc");
164 static void enc_ia32_Cmc(
ir_node const *
const node)
167 ia32_enc_simple(0xF5);
170 static void emit_ia32_Cmp(
ir_node const *
const node)
172 ia32_emitf(node,
"cmp%M %B");
175 static void enc_ia32_Cmp(
ir_node const *
const node)
178 ia32_enc_binop(node, 7);
181 static void emit_ia32_CmpXChgMem(
ir_node const *
const node)
183 ia32_emitf(node,
"lock cmpxchg%M %S4, %AM");
186 static void emit_ia32_Const(
ir_node const *
const node)
188 ia32_emitf(node,
"movl %I, %D0");
191 static void emit_ia32_Conv_I2I(
ir_node const *
const node)
193 ia32_emitf(node,
"mov%#Ml %AS3, %#D0");
196 static void emit_ia32_CopyEbpEsp(
ir_node const *
const node)
198 ia32_emitf(node,
"movl %S0, %D0");
201 static void emit_ia32_CvtSI2SD(
ir_node const *
const node)
203 ia32_emitf(node,
"cvtsi2sd %AS3, %D0");
206 static void emit_ia32_CvtSI2SS(
ir_node const *
const node)
208 ia32_emitf(node,
"cvtsi2ss %AS3, %D0");
211 static void emit_ia32_Cwtl(
ir_node const *
const node)
213 ia32_emitf(node,
"cwtl");
216 static void enc_ia32_Cwtl(
ir_node const *
const node)
219 ia32_enc_simple(0x98);
222 static void emit_ia32_Dec(
ir_node const *
const node)
224 ia32_emitf(node,
"dec%M %D0");
227 static void emit_ia32_DecMem(
ir_node const *
const node)
229 ia32_emitf(node,
"dec%M %AM");
232 static void enc_ia32_DecMem(
ir_node const *
const node)
235 ia32_enc_unop_mem(node, 0xFE, 1);
238 static void emit_ia32_Div(
ir_node const *
const node)
240 ia32_emitf(node,
"div%M %AS3");
243 static void enc_ia32_Div(
ir_node const *
const node)
246 ia32_enc_unop(node, 0xF7, 6, n_ia32_Div_divisor);
249 static void emit_ia32_Divs(
ir_node const *
const node)
251 ia32_emitf(node,
"divs%FX %B");
254 static void emit_ia32_Enter(
ir_node const *
const node)
256 ia32_emitf(node,
"enter");
259 static void emit_ia32_FldCW(
ir_node const *
const node)
261 ia32_emitf(node,
"fldcw %AM");
264 static void emit_ia32_FnstCW(
ir_node const *
const node)
266 ia32_emitf(node,
"fnstcw %AM");
269 static void emit_ia32_FtstFnstsw(
ir_node const *
const node)
271 ia32_emitf(node,
"ftst\nfnstsw %%ax");
274 static void emit_ia32_FucomFnstsw(
ir_node const *
const node)
276 ia32_emitf(node,
"fucom%FP %F0\nfnstsw %%ax");
279 static void emit_ia32_Fucomi(
ir_node const *
const node)
281 ia32_emitf(node,
"fucom%FPi %F0");
284 static void emit_ia32_FucomppFnstsw(
ir_node const *
const node)
286 ia32_emitf(node,
"fucompp\nfnstsw %%ax");
289 static void emit_ia32_IDiv(
ir_node const *
const node)
291 ia32_emitf(node,
"idiv%M %AS3");
294 static void enc_ia32_IDiv(
ir_node const *
const node)
297 ia32_enc_unop(node, 0xF7, 7, n_ia32_IDiv_divisor);
300 static void emit_ia32_IJmp(
ir_node const *
const node)
302 ia32_emitf(node,
"jmp %*AS3");
305 static void enc_ia32_IJmp(
ir_node const *
const node)
308 ia32_enc_unop(node, 0xFF, 4, n_ia32_IJmp_target);
311 static void emit_ia32_IMul(
ir_node const *
const node)
313 ia32_emitf(node,
"imul%M %B");
316 static void enc_ia32_IMul(
ir_node const *
const node)
319 ia32_enc_0f_unop_reg(node, 0xAF, n_ia32_IMul_right);
322 static void emit_ia32_IMul1OP(
ir_node const *
const node)
324 ia32_emitf(node,
"imul%M %AS4");
327 static void enc_ia32_IMul1OP(
ir_node const *
const node)
330 ia32_enc_unop(node, 0xF7, 5, n_ia32_IMul1OP_right);
333 static void emit_ia32_IMulImm(
ir_node const *
const node)
335 ia32_emitf(node,
"imul%M %S4, %AS3, %D0");
338 static void emit_ia32_Inc(
ir_node const *
const node)
340 ia32_emitf(node,
"inc%M %D0");
343 static void emit_ia32_IncMem(
ir_node const *
const node)
345 ia32_emitf(node,
"inc%M %AM");
348 static void enc_ia32_IncMem(
ir_node const *
const node)
351 ia32_enc_unop_mem(node, 0xFE, 0);
354 static void emit_ia32_Inport(
ir_node const *
const node)
356 ia32_emitf(node,
"in%M %^S0, %D0");
359 static void emit_ia32_LdTls(
ir_node const *
const node)
361 ia32_emitf(node,
"movl %%gs:0, %D0");
364 static void emit_ia32_Lea(
ir_node const *
const node)
366 ia32_emitf(node,
"leal %AM, %D0");
369 static void emit_ia32_Leave(
ir_node const *
const node)
371 ia32_emitf(node,
"leave");
374 static void enc_ia32_Leave(
ir_node const *
const node)
377 ia32_enc_simple(0xC9);
380 static void emit_ia32_Load(
ir_node const *
const node)
382 ia32_emitf(node,
"mov%#Ml %AM, %#D0");
385 static void emit_ia32_Maxs(
ir_node const *
const node)
387 ia32_emitf(node,
"maxs%FX %B");
390 static void emit_ia32_Mins(
ir_node const *
const node)
392 ia32_emitf(node,
"mins%FX %B");
395 static void emit_ia32_Movd(
ir_node const *
const node)
397 ia32_emitf(node,
"movd %S0, %D0");
400 static void emit_ia32_Mul(
ir_node const *
const node)
402 ia32_emitf(node,
"mul%M %AS4");
405 static void enc_ia32_Mul(
ir_node const *
const node)
408 ia32_enc_unop(node, 0xF7, 4, n_ia32_Mul_right);
411 static void emit_ia32_Muls(
ir_node const *
const node)
413 ia32_emitf(node,
"muls%FX %B");
416 static void emit_ia32_Neg(
ir_node const *
const node)
418 ia32_emitf(node,
"neg%M %D0");
421 static void enc_ia32_Neg(
ir_node const *
const node)
424 ia32_enc_unop(node, 0xF7, 3, n_ia32_Neg_val);
427 static void emit_ia32_NegMem(
ir_node const *
const node)
429 ia32_emitf(node,
"neg%M %AM");
432 static void enc_ia32_NegMem(
ir_node const *
const node)
435 ia32_enc_unop_mem(node, 0xF6, 3);
438 static void emit_ia32_Not(
ir_node const *
const node)
440 ia32_emitf(node,
"not%M %D0");
443 static void enc_ia32_Not(
ir_node const *
const node)
446 ia32_enc_unop(node, 0xF7, 2, n_ia32_Not_val);
449 static void emit_ia32_NotMem(
ir_node const *
const node)
451 ia32_emitf(node,
"not%M %AM");
454 static void enc_ia32_NotMem(
ir_node const *
const node)
457 ia32_enc_unop_mem(node, 0xF6, 2);
460 static void emit_ia32_Or(
ir_node const *
const node)
462 ia32_emitf(node,
"or%M %B");
465 static void enc_ia32_Or(
ir_node const *
const node)
468 ia32_enc_binop(node, 1);
471 static void emit_ia32_OrMem(
ir_node const *
const node)
473 ia32_emitf(node,
"or%M %S3, %AM");
476 static void enc_ia32_OrMem(
ir_node const *
const node)
479 ia32_enc_binop_mem(node, 1);
482 static void emit_ia32_Orp(
ir_node const *
const node)
484 ia32_emitf(node,
"orp%FX %B");
487 static void emit_ia32_Outport(
ir_node const *
const node)
489 ia32_emitf(node,
"out%M %S1, %^S0");
492 static void emit_ia32_Pop(
ir_node const *
const node)
494 ia32_emitf(node,
"pop%M %D0");
497 static void emit_ia32_PopMem(
ir_node const *
const node)
499 ia32_emitf(node,
"pop%M %AM");
502 static void emit_ia32_Popcnt(
ir_node const *
const node)
504 ia32_emitf(node,
"popcnt%M %AS3, %D0");
507 static void emit_ia32_Prefetch(
ir_node const *
const node)
509 ia32_emitf(node,
"prefetch %AM");
512 static void emit_ia32_PrefetchNTA(
ir_node const *
const node)
514 ia32_emitf(node,
"prefetchnta %AM");
517 static void emit_ia32_PrefetchT0(
ir_node const *
const node)
519 ia32_emitf(node,
"prefetcht0 %AM");
522 static void emit_ia32_PrefetchT1(
ir_node const *
const node)
524 ia32_emitf(node,
"prefetcht1 %AM");
527 static void emit_ia32_PrefetchT2(
ir_node const *
const node)
529 ia32_emitf(node,
"prefetcht2 %AM");
532 static void emit_ia32_PrefetchW(
ir_node const *
const node)
534 ia32_emitf(node,
"prefetchw %AM");
537 static void emit_ia32_Pslld(
ir_node const *
const node)
539 ia32_emitf(node,
"pslld %S1, %D0");
542 static void emit_ia32_Psllq(
ir_node const *
const node)
544 ia32_emitf(node,
"psllq %S1, %D0");
547 static void emit_ia32_Psrld(
ir_node const *
const node)
549 ia32_emitf(node,
"psrld %S1, %D0");
552 static void emit_ia32_Push(
ir_node const *
const node)
554 ia32_emitf(node,
"push%M %AS3");
557 static void emit_ia32_PushEax(
ir_node const *
const node)
559 ia32_emitf(node,
"pushl %%eax");
562 static void emit_ia32_Rol(
ir_node const *
const node)
564 ia32_emitf(node,
"rol%M %<,S1 %D0");
567 static void enc_ia32_Rol(
ir_node const *
const node)
570 ia32_enc_shiftop(node, 0);
573 static void emit_ia32_RolMem(
ir_node const *
const node)
575 ia32_emitf(node,
"rol%M %<,S3 %AM");
578 static void enc_ia32_RolMem(
ir_node const *
const node)
581 ia32_enc_shiftop_mem(node, 0);
584 static void emit_ia32_Ror(
ir_node const *
const node)
586 ia32_emitf(node,
"ror%M %<,S1 %D0");
589 static void enc_ia32_Ror(
ir_node const *
const node)
592 ia32_enc_shiftop(node, 1);
595 static void emit_ia32_RorMem(
ir_node const *
const node)
597 ia32_emitf(node,
"ror%M %<,S3 %AM");
600 static void enc_ia32_RorMem(
ir_node const *
const node)
603 ia32_enc_shiftop_mem(node, 1);
606 static void emit_ia32_Sahf(
ir_node const *
const node)
608 ia32_emitf(node,
"sahf");
611 static void enc_ia32_Sahf(
ir_node const *
const node)
614 ia32_enc_simple(0x9E);
617 static void emit_ia32_Sar(
ir_node const *
const node)
619 ia32_emitf(node,
"sar%M %<,S1 %D0");
622 static void enc_ia32_Sar(
ir_node const *
const node)
625 ia32_enc_shiftop(node, 7);
628 static void emit_ia32_SarMem(
ir_node const *
const node)
630 ia32_emitf(node,
"sar%M %<,S3 %AM");
633 static void enc_ia32_SarMem(
ir_node const *
const node)
636 ia32_enc_shiftop_mem(node, 7);
639 static void emit_ia32_Sbb(
ir_node const *
const node)
641 ia32_emitf(node,
"sbb%M %B");
644 static void enc_ia32_Sbb(
ir_node const *
const node)
647 ia32_enc_binop(node, 3);
650 static void emit_ia32_Sbb0(
ir_node const *
const node)
652 ia32_emitf(node,
"sbb%M %D0, %D0");
655 static void emit_ia32_SetccMem(
ir_node const *
const node)
657 ia32_emitf(node,
"set%P3 %AM");
660 static void emit_ia32_Shl(
ir_node const *
const node)
662 ia32_emitf(node,
"shl%M %<,S1 %D0");
665 static void enc_ia32_Shl(
ir_node const *
const node)
668 ia32_enc_shiftop(node, 4);
671 static void emit_ia32_ShlD(
ir_node const *
const node)
673 ia32_emitf(node,
"shld%M %<S2, %S1, %D0");
676 static void emit_ia32_ShlMem(
ir_node const *
const node)
678 ia32_emitf(node,
"shl%M %<,S3 %AM");
681 static void enc_ia32_ShlMem(
ir_node const *
const node)
684 ia32_enc_shiftop_mem(node, 4);
687 static void emit_ia32_Shr(
ir_node const *
const node)
689 ia32_emitf(node,
"shr%M %<,S1 %D0");
692 static void enc_ia32_Shr(
ir_node const *
const node)
695 ia32_enc_shiftop(node, 5);
698 static void emit_ia32_ShrD(
ir_node const *
const node)
700 ia32_emitf(node,
"shrd%M %<S2, %S1, %D0");
703 static void emit_ia32_ShrMem(
ir_node const *
const node)
705 ia32_emitf(node,
"shr%M %<,S3 %AM");
708 static void enc_ia32_ShrMem(
ir_node const *
const node)
711 ia32_enc_shiftop_mem(node, 5);
714 static void emit_ia32_Stc(
ir_node const *
const node)
716 ia32_emitf(node,
"stc");
719 static void enc_ia32_Stc(
ir_node const *
const node)
722 ia32_enc_simple(0xF9);
725 static void emit_ia32_Store(
ir_node const *
const node)
727 ia32_emitf(node,
"mov%M %S3, %AM");
730 static void emit_ia32_Sub(
ir_node const *
const node)
732 ia32_emitf(node,
"sub%M %B");
735 static void enc_ia32_Sub(
ir_node const *
const node)
738 ia32_enc_binop(node, 5);
741 static void emit_ia32_SubMem(
ir_node const *
const node)
743 ia32_emitf(node,
"sub%M %S3, %AM");
746 static void enc_ia32_SubMem(
ir_node const *
const node)
749 ia32_enc_binop_mem(node, 5);
752 static void emit_ia32_SubSP(
ir_node const *
const node)
754 ia32_emitf(node,
"subl %B\nmovl %%esp, %D1");
757 static void emit_ia32_Subs(
ir_node const *
const node)
759 ia32_emitf(node,
"subs%FX %B");
762 static void emit_ia32_Test(
ir_node const *
const node)
764 ia32_emitf(node,
"test%M %B");
767 static void emit_ia32_UD2(
ir_node const *
const node)
769 ia32_emitf(node,
"ud2");
772 static void emit_ia32_Ucomis(
ir_node const *
const node)
774 ia32_emitf(node,
"ucomis%FX %B");
777 static void emit_ia32_Xor(
ir_node const *
const node)
779 ia32_emitf(node,
"xor%M %B");
782 static void enc_ia32_Xor(
ir_node const *
const node)
785 ia32_enc_binop(node, 6);
788 static void emit_ia32_Xor0(
ir_node const *
const node)
790 ia32_emitf(node,
"xor%M %D0, %D0");
793 static void emit_ia32_XorHighLow(
ir_node const *
const node)
795 ia32_emitf(node,
"xorb %>D0, %<D0");
798 static void emit_ia32_XorMem(
ir_node const *
const node)
800 ia32_emitf(node,
"xor%M %S3, %AM");
803 static void enc_ia32_XorMem(
ir_node const *
const node)
806 ia32_enc_binop_mem(node, 6);
809 static void emit_ia32_Xorp(
ir_node const *
const node)
811 ia32_emitf(node,
"xorp%FX %B");
814 static void emit_ia32_emms(
ir_node const *
const node)
816 ia32_emitf(node,
"emms");
819 static void emit_ia32_fabs(
ir_node const *
const node)
821 ia32_emitf(node,
"fabs");
824 static void enc_ia32_fabs(
ir_node const *
const node)
827 ia32_enc_fsimple(0xE1);
830 static void emit_ia32_fadd(
ir_node const *
const node)
832 ia32_emitf(node,
"fadd%FP%FM %AF");
835 static void enc_ia32_fadd(
ir_node const *
const node)
838 ia32_enc_fbinop(node, 0, 0);
841 static void emit_ia32_fchs(
ir_node const *
const node)
843 ia32_emitf(node,
"fchs");
846 static void enc_ia32_fchs(
ir_node const *
const node)
849 ia32_enc_fsimple(0xE0);
852 static void emit_ia32_fdiv(
ir_node const *
const node)
854 ia32_emitf(node,
"fdiv%FR%FP%FM %AF");
857 static void enc_ia32_fdiv(
ir_node const *
const node)
860 ia32_enc_fbinop(node, 6, 7);
863 static void emit_ia32_fdup(
ir_node const *
const node)
865 ia32_emitf(node,
"fld %F0");
868 static void enc_ia32_fdup(
ir_node const *
const node)
871 ia32_enc_fop_reg(node, 0xD9, 0xC0);
874 static void emit_ia32_femms(
ir_node const *
const node)
876 ia32_emitf(node,
"femms");
879 static void emit_ia32_ffreep(
ir_node const *
const node)
881 ia32_emitf(node,
"ffreep %F0");
884 static void enc_ia32_ffreep(
ir_node const *
const node)
887 ia32_enc_fop_reg(node, 0xDF, 0xC0);
890 static void emit_ia32_fild(
ir_node const *
const node)
892 ia32_emitf(node,
"fild%FI %AM");
895 static void emit_ia32_fist(
ir_node const *
const node)
897 ia32_emitf(node,
"fist%FP%FI %AM");
900 static void emit_ia32_fistp(
ir_node const *
const node)
902 ia32_emitf(node,
"fistp%FI %AM");
905 static void emit_ia32_fisttp(
ir_node const *
const node)
907 ia32_emitf(node,
"fisttp%FI %AM");
910 static void emit_ia32_fld(
ir_node const *
const node)
912 ia32_emitf(node,
"fld%FM %AM");
915 static void emit_ia32_fld1(
ir_node const *
const node)
917 ia32_emitf(node,
"fld1");
920 static void enc_ia32_fld1(
ir_node const *
const node)
923 ia32_enc_fsimple(0xE8);
926 static void emit_ia32_fldl2e(
ir_node const *
const node)
928 ia32_emitf(node,
"fldl2e");
931 static void emit_ia32_fldl2t(
ir_node const *
const node)
933 ia32_emitf(node,
"fldl2t");
936 static void emit_ia32_fldlg2(
ir_node const *
const node)
938 ia32_emitf(node,
"fldlg2");
941 static void emit_ia32_fldln2(
ir_node const *
const node)
943 ia32_emitf(node,
"fldln2");
946 static void emit_ia32_fldpi(
ir_node const *
const node)
948 ia32_emitf(node,
"fldpi");
951 static void emit_ia32_fldz(
ir_node const *
const node)
953 ia32_emitf(node,
"fldz");
956 static void enc_ia32_fldz(
ir_node const *
const node)
959 ia32_enc_fsimple(0xEE);
962 static void emit_ia32_fmul(
ir_node const *
const node)
964 ia32_emitf(node,
"fmul%FP%FM %AF");
967 static void enc_ia32_fmul(
ir_node const *
const node)
970 ia32_enc_fbinop(node, 1, 1);
973 static void emit_ia32_fpop(
ir_node const *
const node)
975 ia32_emitf(node,
"fstp %F0");
978 static void enc_ia32_fpop(
ir_node const *
const node)
981 ia32_enc_fop_reg(node, 0xDD, 0xD8);
984 static void emit_ia32_fst(
ir_node const *
const node)
986 ia32_emitf(node,
"fst%FP%FM %AM");
989 static void emit_ia32_fstp(
ir_node const *
const node)
991 ia32_emitf(node,
"fstp%FM %AM");
994 static void emit_ia32_fsub(
ir_node const *
const node)
996 ia32_emitf(node,
"fsub%FR%FP%FM %AF");
999 static void enc_ia32_fsub(
ir_node const *
const node)
1002 ia32_enc_fbinop(node, 4, 5);
1005 static void emit_ia32_fxch(
ir_node const *
const node)
1007 ia32_emitf(node,
"fxch %F0");
1010 static void enc_ia32_fxch(
ir_node const *
const node)
1013 ia32_enc_fop_reg(node, 0xD9, 0xC8);
1016 static void emit_ia32_xAllOnes(
ir_node const *
const node)
1018 ia32_emitf(node,
"pcmpeqb %D0, %D0");
1021 static void emit_ia32_xLoad(
ir_node const *
const node)
1023 ia32_emitf(node,
"movs%FX %AM, %D0");
1026 static void emit_ia32_xPzero(
ir_node const *
const node)
1028 ia32_emitf(node,
"pxor %D0, %D0");
1031 static void emit_ia32_xStore(
ir_node const *
const node)
1033 ia32_emitf(node,
"movs%FX %S3, %AM");
1036 static void emit_ia32_xZero(
ir_node const *
const node)
1038 ia32_emitf(node,
"xorp%FX %D0, %D0");
1041 static void emit_ia32_xxLoad(
ir_node const *
const node)
1043 ia32_emitf(node,
"movdqu %D0, %AM");
1046 static void emit_ia32_xxStore(
ir_node const *
const node)
1048 ia32_emitf(node,
"movdqu %S3, %AM");
1053 void ia32_register_spec_emitters(
void)
1055 be_set_emitter(op_ia32_Adc, emit_ia32_Adc);
1056 be_set_emitter(op_ia32_Add, emit_ia32_Add);
1057 be_set_emitter(op_ia32_AddMem, emit_ia32_AddMem);
1058 be_set_emitter(op_ia32_AddSP, emit_ia32_AddSP);
1059 be_set_emitter(op_ia32_Adds, emit_ia32_Adds);
1060 be_set_emitter(op_ia32_And, emit_ia32_And);
1061 be_set_emitter(op_ia32_AndMem, emit_ia32_AndMem);
1062 be_set_emitter(op_ia32_Andnp, emit_ia32_Andnp);
1063 be_set_emitter(op_ia32_Andp, emit_ia32_Andp);
1064 be_set_emitter(op_ia32_Breakpoint, emit_ia32_Breakpoint);
1065 be_set_emitter(op_ia32_Bsf, emit_ia32_Bsf);
1066 be_set_emitter(op_ia32_Bsr, emit_ia32_Bsr);
1067 be_set_emitter(op_ia32_Bswap, emit_ia32_Bswap);
1068 be_set_emitter(op_ia32_Bswap16, emit_ia32_Bswap16);
1069 be_set_emitter(op_ia32_Bt, emit_ia32_Bt);
1070 be_set_emitter(op_ia32_CMovcc, emit_ia32_CMovcc);
1071 be_set_emitter(op_ia32_Call, emit_ia32_Call);
1072 be_set_emitter(op_ia32_Cltd, emit_ia32_Cltd);
1073 be_set_emitter(op_ia32_Cmc, emit_ia32_Cmc);
1074 be_set_emitter(op_ia32_Cmp, emit_ia32_Cmp);
1075 be_set_emitter(op_ia32_CmpXChgMem, emit_ia32_CmpXChgMem);
1076 be_set_emitter(op_ia32_Const, emit_ia32_Const);
1077 be_set_emitter(op_ia32_Conv_I2I, emit_ia32_Conv_I2I);
1078 be_set_emitter(op_ia32_CopyEbpEsp, emit_ia32_CopyEbpEsp);
1079 be_set_emitter(op_ia32_CvtSI2SD, emit_ia32_CvtSI2SD);
1080 be_set_emitter(op_ia32_CvtSI2SS, emit_ia32_CvtSI2SS);
1081 be_set_emitter(op_ia32_Cwtl, emit_ia32_Cwtl);
1082 be_set_emitter(op_ia32_Dec, emit_ia32_Dec);
1083 be_set_emitter(op_ia32_DecMem, emit_ia32_DecMem);
1084 be_set_emitter(op_ia32_Div, emit_ia32_Div);
1085 be_set_emitter(op_ia32_Divs, emit_ia32_Divs);
1086 be_set_emitter(op_ia32_Enter, emit_ia32_Enter);
1087 be_set_emitter(op_ia32_FldCW, emit_ia32_FldCW);
1088 be_set_emitter(op_ia32_FnstCW, emit_ia32_FnstCW);
1089 be_set_emitter(op_ia32_FnstCWNOP, be_emit_nothing);
1090 be_set_emitter(op_ia32_FtstFnstsw, emit_ia32_FtstFnstsw);
1091 be_set_emitter(op_ia32_FucomFnstsw, emit_ia32_FucomFnstsw);
1092 be_set_emitter(op_ia32_Fucomi, emit_ia32_Fucomi);
1093 be_set_emitter(op_ia32_FucomppFnstsw, emit_ia32_FucomppFnstsw);
1094 be_set_emitter(op_ia32_IDiv, emit_ia32_IDiv);
1095 be_set_emitter(op_ia32_IJmp, emit_ia32_IJmp);
1096 be_set_emitter(op_ia32_IMul, emit_ia32_IMul);
1097 be_set_emitter(op_ia32_IMul1OP, emit_ia32_IMul1OP);
1098 be_set_emitter(op_ia32_IMulImm, emit_ia32_IMulImm);
1099 be_set_emitter(op_ia32_Inc, emit_ia32_Inc);
1100 be_set_emitter(op_ia32_IncMem, emit_ia32_IncMem);
1101 be_set_emitter(op_ia32_Inport, emit_ia32_Inport);
1102 be_set_emitter(op_ia32_LdTls, emit_ia32_LdTls);
1103 be_set_emitter(op_ia32_Lea, emit_ia32_Lea);
1104 be_set_emitter(op_ia32_Leave, emit_ia32_Leave);
1105 be_set_emitter(op_ia32_Load, emit_ia32_Load);
1106 be_set_emitter(op_ia32_Maxs, emit_ia32_Maxs);
1107 be_set_emitter(op_ia32_Mins, emit_ia32_Mins);
1108 be_set_emitter(op_ia32_Movd, emit_ia32_Movd);
1109 be_set_emitter(op_ia32_Mul, emit_ia32_Mul);
1110 be_set_emitter(op_ia32_Muls, emit_ia32_Muls);
1111 be_set_emitter(op_ia32_Neg, emit_ia32_Neg);
1112 be_set_emitter(op_ia32_NegMem, emit_ia32_NegMem);
1113 be_set_emitter(op_ia32_Not, emit_ia32_Not);
1114 be_set_emitter(op_ia32_NotMem, emit_ia32_NotMem);
1115 be_set_emitter(op_ia32_Or, emit_ia32_Or);
1116 be_set_emitter(op_ia32_OrMem, emit_ia32_OrMem);
1117 be_set_emitter(op_ia32_Orp, emit_ia32_Orp);
1118 be_set_emitter(op_ia32_Outport, emit_ia32_Outport);
1119 be_set_emitter(op_ia32_Pop, emit_ia32_Pop);
1120 be_set_emitter(op_ia32_PopMem, emit_ia32_PopMem);
1121 be_set_emitter(op_ia32_Popcnt, emit_ia32_Popcnt);
1122 be_set_emitter(op_ia32_Prefetch, emit_ia32_Prefetch);
1123 be_set_emitter(op_ia32_PrefetchNTA, emit_ia32_PrefetchNTA);
1124 be_set_emitter(op_ia32_PrefetchT0, emit_ia32_PrefetchT0);
1125 be_set_emitter(op_ia32_PrefetchT1, emit_ia32_PrefetchT1);
1126 be_set_emitter(op_ia32_PrefetchT2, emit_ia32_PrefetchT2);
1127 be_set_emitter(op_ia32_PrefetchW, emit_ia32_PrefetchW);
1128 be_set_emitter(op_ia32_Pslld, emit_ia32_Pslld);
1129 be_set_emitter(op_ia32_Psllq, emit_ia32_Psllq);
1130 be_set_emitter(op_ia32_Psrld, emit_ia32_Psrld);
1131 be_set_emitter(op_ia32_Push, emit_ia32_Push);
1132 be_set_emitter(op_ia32_PushEax, emit_ia32_PushEax);
1133 be_set_emitter(op_ia32_Rol, emit_ia32_Rol);
1134 be_set_emitter(op_ia32_RolMem, emit_ia32_RolMem);
1135 be_set_emitter(op_ia32_Ror, emit_ia32_Ror);
1136 be_set_emitter(op_ia32_RorMem, emit_ia32_RorMem);
1137 be_set_emitter(op_ia32_Sahf, emit_ia32_Sahf);
1138 be_set_emitter(op_ia32_Sar, emit_ia32_Sar);
1139 be_set_emitter(op_ia32_SarMem, emit_ia32_SarMem);
1140 be_set_emitter(op_ia32_Sbb, emit_ia32_Sbb);
1141 be_set_emitter(op_ia32_Sbb0, emit_ia32_Sbb0);
1142 be_set_emitter(op_ia32_SetccMem, emit_ia32_SetccMem);
1143 be_set_emitter(op_ia32_Shl, emit_ia32_Shl);
1144 be_set_emitter(op_ia32_ShlD, emit_ia32_ShlD);
1145 be_set_emitter(op_ia32_ShlMem, emit_ia32_ShlMem);
1146 be_set_emitter(op_ia32_Shr, emit_ia32_Shr);
1147 be_set_emitter(op_ia32_ShrD, emit_ia32_ShrD);
1148 be_set_emitter(op_ia32_ShrMem, emit_ia32_ShrMem);
1149 be_set_emitter(op_ia32_Stc, emit_ia32_Stc);
1150 be_set_emitter(op_ia32_Store, emit_ia32_Store);
1151 be_set_emitter(op_ia32_Sub, emit_ia32_Sub);
1152 be_set_emitter(op_ia32_SubMem, emit_ia32_SubMem);
1153 be_set_emitter(op_ia32_SubSP, emit_ia32_SubSP);
1154 be_set_emitter(op_ia32_Subs, emit_ia32_Subs);
1155 be_set_emitter(op_ia32_Test, emit_ia32_Test);
1156 be_set_emitter(op_ia32_UD2, emit_ia32_UD2);
1157 be_set_emitter(op_ia32_Ucomis, emit_ia32_Ucomis);
1158 be_set_emitter(op_ia32_Xor, emit_ia32_Xor);
1159 be_set_emitter(op_ia32_Xor0, emit_ia32_Xor0);
1160 be_set_emitter(op_ia32_XorHighLow, emit_ia32_XorHighLow);
1161 be_set_emitter(op_ia32_XorMem, emit_ia32_XorMem);
1162 be_set_emitter(op_ia32_Xorp, emit_ia32_Xorp);
1163 be_set_emitter(op_ia32_emms, emit_ia32_emms);
1164 be_set_emitter(op_ia32_fabs, emit_ia32_fabs);
1165 be_set_emitter(op_ia32_fadd, emit_ia32_fadd);
1166 be_set_emitter(op_ia32_fchs, emit_ia32_fchs);
1167 be_set_emitter(op_ia32_fdiv, emit_ia32_fdiv);
1168 be_set_emitter(op_ia32_fdup, emit_ia32_fdup);
1169 be_set_emitter(op_ia32_femms, emit_ia32_femms);
1170 be_set_emitter(op_ia32_ffreep, emit_ia32_ffreep);
1171 be_set_emitter(op_ia32_fild, emit_ia32_fild);
1172 be_set_emitter(op_ia32_fist, emit_ia32_fist);
1173 be_set_emitter(op_ia32_fistp, emit_ia32_fistp);
1174 be_set_emitter(op_ia32_fisttp, emit_ia32_fisttp);
1175 be_set_emitter(op_ia32_fld, emit_ia32_fld);
1176 be_set_emitter(op_ia32_fld1, emit_ia32_fld1);
1177 be_set_emitter(op_ia32_fldl2e, emit_ia32_fldl2e);
1178 be_set_emitter(op_ia32_fldl2t, emit_ia32_fldl2t);
1179 be_set_emitter(op_ia32_fldlg2, emit_ia32_fldlg2);
1180 be_set_emitter(op_ia32_fldln2, emit_ia32_fldln2);
1181 be_set_emitter(op_ia32_fldpi, emit_ia32_fldpi);
1182 be_set_emitter(op_ia32_fldz, emit_ia32_fldz);
1183 be_set_emitter(op_ia32_fmul, emit_ia32_fmul);
1184 be_set_emitter(op_ia32_fpop, emit_ia32_fpop);
1185 be_set_emitter(op_ia32_fst, emit_ia32_fst);
1186 be_set_emitter(op_ia32_fstp, emit_ia32_fstp);
1187 be_set_emitter(op_ia32_fsub, emit_ia32_fsub);
1188 be_set_emitter(op_ia32_fxch, emit_ia32_fxch);
1189 be_set_emitter(op_ia32_xAllOnes, emit_ia32_xAllOnes);
1190 be_set_emitter(op_ia32_xLoad, emit_ia32_xLoad);
1191 be_set_emitter(op_ia32_xPzero, emit_ia32_xPzero);
1192 be_set_emitter(op_ia32_xStore, emit_ia32_xStore);
1193 be_set_emitter(op_ia32_xZero, emit_ia32_xZero);
1194 be_set_emitter(op_ia32_xxLoad, emit_ia32_xxLoad);
1195 be_set_emitter(op_ia32_xxStore, emit_ia32_xxStore);
1199 void ia32_register_spec_binary_emitters(
void)
1201 be_set_emitter(op_ia32_Adc, enc_ia32_Adc);
1202 be_set_emitter(op_ia32_Add, enc_ia32_Add);
1203 be_set_emitter(op_ia32_AddMem, enc_ia32_AddMem);
1204 be_set_emitter(op_ia32_And, enc_ia32_And);
1205 be_set_emitter(op_ia32_AndMem, enc_ia32_AndMem);
1206 be_set_emitter(op_ia32_Breakpoint, enc_ia32_Breakpoint);
1207 be_set_emitter(op_ia32_Bsf, enc_ia32_Bsf);
1208 be_set_emitter(op_ia32_Bsr, enc_ia32_Bsr);
1209 be_set_emitter(op_ia32_Cltd, enc_ia32_Cltd);
1210 be_set_emitter(op_ia32_Cmc, enc_ia32_Cmc);
1211 be_set_emitter(op_ia32_Cmp, enc_ia32_Cmp);
1212 be_set_emitter(op_ia32_Cwtl, enc_ia32_Cwtl);
1213 be_set_emitter(op_ia32_DecMem, enc_ia32_DecMem);
1214 be_set_emitter(op_ia32_Div, enc_ia32_Div);
1215 be_set_emitter(op_ia32_IDiv, enc_ia32_IDiv);
1216 be_set_emitter(op_ia32_IJmp, enc_ia32_IJmp);
1217 be_set_emitter(op_ia32_IMul, enc_ia32_IMul);
1218 be_set_emitter(op_ia32_IMul1OP, enc_ia32_IMul1OP);
1219 be_set_emitter(op_ia32_IncMem, enc_ia32_IncMem);
1220 be_set_emitter(op_ia32_Leave, enc_ia32_Leave);
1221 be_set_emitter(op_ia32_Mul, enc_ia32_Mul);
1222 be_set_emitter(op_ia32_Neg, enc_ia32_Neg);
1223 be_set_emitter(op_ia32_NegMem, enc_ia32_NegMem);
1224 be_set_emitter(op_ia32_Not, enc_ia32_Not);
1225 be_set_emitter(op_ia32_NotMem, enc_ia32_NotMem);
1226 be_set_emitter(op_ia32_Or, enc_ia32_Or);
1227 be_set_emitter(op_ia32_OrMem, enc_ia32_OrMem);
1228 be_set_emitter(op_ia32_Rol, enc_ia32_Rol);
1229 be_set_emitter(op_ia32_RolMem, enc_ia32_RolMem);
1230 be_set_emitter(op_ia32_Ror, enc_ia32_Ror);
1231 be_set_emitter(op_ia32_RorMem, enc_ia32_RorMem);
1232 be_set_emitter(op_ia32_Sahf, enc_ia32_Sahf);
1233 be_set_emitter(op_ia32_Sar, enc_ia32_Sar);
1234 be_set_emitter(op_ia32_SarMem, enc_ia32_SarMem);
1235 be_set_emitter(op_ia32_Sbb, enc_ia32_Sbb);
1236 be_set_emitter(op_ia32_Shl, enc_ia32_Shl);
1237 be_set_emitter(op_ia32_ShlMem, enc_ia32_ShlMem);
1238 be_set_emitter(op_ia32_Shr, enc_ia32_Shr);
1239 be_set_emitter(op_ia32_ShrMem, enc_ia32_ShrMem);
1240 be_set_emitter(op_ia32_Stc, enc_ia32_Stc);
1241 be_set_emitter(op_ia32_Sub, enc_ia32_Sub);
1242 be_set_emitter(op_ia32_SubMem, enc_ia32_SubMem);
1243 be_set_emitter(op_ia32_Xor, enc_ia32_Xor);
1244 be_set_emitter(op_ia32_XorMem, enc_ia32_XorMem);
1245 be_set_emitter(op_ia32_fabs, enc_ia32_fabs);
1246 be_set_emitter(op_ia32_fadd, enc_ia32_fadd);
1247 be_set_emitter(op_ia32_fchs, enc_ia32_fchs);
1248 be_set_emitter(op_ia32_fdiv, enc_ia32_fdiv);
1249 be_set_emitter(op_ia32_fdup, enc_ia32_fdup);
1250 be_set_emitter(op_ia32_ffreep, enc_ia32_ffreep);
1251 be_set_emitter(op_ia32_fld1, enc_ia32_fld1);
1252 be_set_emitter(op_ia32_fldz, enc_ia32_fldz);
1253 be_set_emitter(op_ia32_fmul, enc_ia32_fmul);
1254 be_set_emitter(op_ia32_fpop, enc_ia32_fpop);
1255 be_set_emitter(op_ia32_fsub, enc_ia32_fsub);
1256 be_set_emitter(op_ia32_fxch, enc_ia32_fxch);
struct ir_node ir_node
Procedure Graph Node.