Lines Matching refs:p
20 static void do_realloc( struct x86_function *p ) in do_realloc() argument
22 if (p->size == 0) { in do_realloc()
23 p->size = 1024; in do_realloc()
24 p->store = _mesa_exec_malloc(p->size); in do_realloc()
25 p->csr = p->store; in do_realloc()
28 unsigned used = p->csr - p->store; in do_realloc()
29 unsigned char *tmp = p->store; in do_realloc()
30 p->size *= 2; in do_realloc()
31 p->store = _mesa_exec_malloc(p->size); in do_realloc()
32 memcpy(p->store, tmp, used); in do_realloc()
33 p->csr = p->store + used; in do_realloc()
40 static unsigned char *reserve( struct x86_function *p, int bytes ) in reserve() argument
42 if (p->csr + bytes - p->store > p->size) in reserve()
43 do_realloc(p); in reserve()
46 unsigned char *csr = p->csr; in reserve()
47 p->csr += bytes; in reserve()
54 static void emit_1b( struct x86_function *p, char b0 ) in emit_1b() argument
56 char *csr = (char *)reserve(p, 1); in emit_1b()
60 static void emit_1i( struct x86_function *p, int i0 ) in emit_1i() argument
62 int *icsr = (int *)reserve(p, sizeof(i0)); in emit_1i()
66 static void emit_1ub( struct x86_function *p, unsigned char b0 ) in emit_1ub() argument
68 unsigned char *csr = reserve(p, 1); in emit_1ub()
72 static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) in emit_2ub() argument
74 unsigned char *csr = reserve(p, 2); in emit_2ub()
79 static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) in emit_3ub() argument
81 unsigned char *csr = reserve(p, 3); in emit_3ub()
91 static void emit_modrm( struct x86_function *p, in emit_modrm() argument
103 emit_1ub(p, val); in emit_modrm()
109 emit_1ub(p, 0x24); /* simplistic! */ in emit_modrm()
117 emit_1b(p, regmem.disp); in emit_modrm()
120 emit_1i(p, regmem.disp); in emit_modrm()
129 static void emit_modrm_noreg( struct x86_function *p, in emit_modrm_noreg() argument
134 emit_modrm(p, dummy, regmem); in emit_modrm_noreg()
142 static void emit_op_modrm( struct x86_function *p, in emit_op_modrm() argument
150 emit_1ub(p, op_dst_is_reg); in emit_op_modrm()
151 emit_modrm(p, dst, src); in emit_op_modrm()
157 emit_1ub(p, op_dst_is_mem); in emit_op_modrm()
158 emit_modrm(p, src, dst); in emit_op_modrm()
217 unsigned char *x86_get_label( struct x86_function *p ) in x86_get_label() argument
219 return p->csr; in x86_get_label()
229 void x86_jcc( struct x86_function *p, in x86_jcc() argument
233 int offset = label - (x86_get_label(p) + 2); in x86_jcc()
236 emit_1ub(p, 0x70 + cc); in x86_jcc()
237 emit_1b(p, (char) offset); in x86_jcc()
240 offset = label - (x86_get_label(p) + 6); in x86_jcc()
241 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc()
242 emit_1i(p, offset); in x86_jcc()
248 unsigned char *x86_jcc_forward( struct x86_function *p, in x86_jcc_forward() argument
251 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc_forward()
252 emit_1i(p, 0); in x86_jcc_forward()
253 return x86_get_label(p); in x86_jcc_forward()
256 unsigned char *x86_jmp_forward( struct x86_function *p) in x86_jmp_forward() argument
258 emit_1ub(p, 0xe9); in x86_jmp_forward()
259 emit_1i(p, 0); in x86_jmp_forward()
260 return x86_get_label(p); in x86_jmp_forward()
263 unsigned char *x86_call_forward( struct x86_function *p) in x86_call_forward() argument
265 emit_1ub(p, 0xe8); in x86_call_forward()
266 emit_1i(p, 0); in x86_call_forward()
267 return x86_get_label(p); in x86_call_forward()
272 void x86_fixup_fwd_jump( struct x86_function *p, in x86_fixup_fwd_jump() argument
275 *(int *)(fixup - 4) = x86_get_label(p) - fixup; in x86_fixup_fwd_jump()
278 void x86_jmp( struct x86_function *p, unsigned char *label) in x86_jmp() argument
280 emit_1ub(p, 0xe9); in x86_jmp()
281 emit_1i(p, label - x86_get_label(p) - 4); in x86_jmp()
289 void x86_call( struct x86_function *p, void (*label)())
291 emit_1ub(p, 0xe8);
292 emit_1i(p, cptr(label) - x86_get_label(p) - 4);
295 void x86_call( struct x86_function *p, struct x86_reg reg) in x86_call() argument
297 emit_1ub(p, 0xff); in x86_call()
298 emit_modrm_noreg(p, 2, reg); in x86_call()
307 void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) in x86_mov_reg_imm() argument
310 emit_1ub(p, 0xb8 + dst.idx); in x86_mov_reg_imm()
311 emit_1i(p, imm); in x86_mov_reg_imm()
314 void x86_push( struct x86_function *p, in x86_push() argument
318 emit_1ub(p, 0x50 + reg.idx); in x86_push()
319 p->stack_offset += 4; in x86_push()
322 void x86_pop( struct x86_function *p, in x86_pop() argument
326 emit_1ub(p, 0x58 + reg.idx); in x86_pop()
327 p->stack_offset -= 4; in x86_pop()
330 void x86_inc( struct x86_function *p, in x86_inc() argument
334 emit_1ub(p, 0x40 + reg.idx); in x86_inc()
337 void x86_dec( struct x86_function *p, in x86_dec() argument
341 emit_1ub(p, 0x48 + reg.idx); in x86_dec()
344 void x86_ret( struct x86_function *p ) in x86_ret() argument
346 emit_1ub(p, 0xc3); in x86_ret()
349 void x86_sahf( struct x86_function *p ) in x86_sahf() argument
351 emit_1ub(p, 0x9e); in x86_sahf()
354 void x86_mov( struct x86_function *p, in x86_mov() argument
358 emit_op_modrm( p, 0x8b, 0x89, dst, src ); in x86_mov()
361 void x86_xor( struct x86_function *p, in x86_xor() argument
365 emit_op_modrm( p, 0x33, 0x31, dst, src ); in x86_xor()
368 void x86_cmp( struct x86_function *p, in x86_cmp() argument
372 emit_op_modrm( p, 0x3b, 0x39, dst, src ); in x86_cmp()
375 void x86_lea( struct x86_function *p, in x86_lea() argument
379 emit_1ub(p, 0x8d); in x86_lea()
380 emit_modrm( p, dst, src ); in x86_lea()
383 void x86_test( struct x86_function *p, in x86_test() argument
387 emit_1ub(p, 0x85); in x86_test()
388 emit_modrm( p, dst, src ); in x86_test()
391 void x86_add( struct x86_function *p, in x86_add() argument
395 emit_op_modrm(p, 0x03, 0x01, dst, src ); in x86_add()
398 void x86_mul( struct x86_function *p, in x86_mul() argument
402 emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); in x86_mul()
405 void x86_sub( struct x86_function *p, in x86_sub() argument
409 emit_op_modrm(p, 0x2b, 0x29, dst, src ); in x86_sub()
412 void x86_or( struct x86_function *p, in x86_or() argument
416 emit_op_modrm( p, 0x0b, 0x09, dst, src ); in x86_or()
419 void x86_and( struct x86_function *p, in x86_and() argument
423 emit_op_modrm( p, 0x23, 0x21, dst, src ); in x86_and()
433 void sse_movss( struct x86_function *p, in sse_movss() argument
437 emit_2ub(p, 0xF3, X86_TWOB); in sse_movss()
438 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movss()
441 void sse_movaps( struct x86_function *p, in sse_movaps() argument
445 emit_1ub(p, X86_TWOB); in sse_movaps()
446 emit_op_modrm( p, 0x28, 0x29, dst, src ); in sse_movaps()
449 void sse_movups( struct x86_function *p, in sse_movups() argument
453 emit_1ub(p, X86_TWOB); in sse_movups()
454 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movups()
457 void sse_movhps( struct x86_function *p, in sse_movhps() argument
462 emit_1ub(p, X86_TWOB); in sse_movhps()
463 emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ in sse_movhps()
466 void sse_movlps( struct x86_function *p, in sse_movlps() argument
471 emit_1ub(p, X86_TWOB); in sse_movlps()
472 emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ in sse_movlps()
475 void sse_maxps( struct x86_function *p, in sse_maxps() argument
479 emit_2ub(p, X86_TWOB, 0x5F); in sse_maxps()
480 emit_modrm( p, dst, src ); in sse_maxps()
483 void sse_maxss( struct x86_function *p, in sse_maxss() argument
487 emit_3ub(p, 0xF3, X86_TWOB, 0x5F); in sse_maxss()
488 emit_modrm( p, dst, src ); in sse_maxss()
491 void sse_divss( struct x86_function *p, in sse_divss() argument
495 emit_3ub(p, 0xF3, X86_TWOB, 0x5E); in sse_divss()
496 emit_modrm( p, dst, src ); in sse_divss()
499 void sse_minps( struct x86_function *p, in sse_minps() argument
503 emit_2ub(p, X86_TWOB, 0x5D); in sse_minps()
504 emit_modrm( p, dst, src ); in sse_minps()
507 void sse_subps( struct x86_function *p, in sse_subps() argument
511 emit_2ub(p, X86_TWOB, 0x5C); in sse_subps()
512 emit_modrm( p, dst, src ); in sse_subps()
515 void sse_mulps( struct x86_function *p, in sse_mulps() argument
519 emit_2ub(p, X86_TWOB, 0x59); in sse_mulps()
520 emit_modrm( p, dst, src ); in sse_mulps()
523 void sse_mulss( struct x86_function *p, in sse_mulss() argument
527 emit_3ub(p, 0xF3, X86_TWOB, 0x59); in sse_mulss()
528 emit_modrm( p, dst, src ); in sse_mulss()
531 void sse_addps( struct x86_function *p, in sse_addps() argument
535 emit_2ub(p, X86_TWOB, 0x58); in sse_addps()
536 emit_modrm( p, dst, src ); in sse_addps()
539 void sse_addss( struct x86_function *p, in sse_addss() argument
543 emit_3ub(p, 0xF3, X86_TWOB, 0x58); in sse_addss()
544 emit_modrm( p, dst, src ); in sse_addss()
547 void sse_andnps( struct x86_function *p, in sse_andnps() argument
551 emit_2ub(p, X86_TWOB, 0x55); in sse_andnps()
552 emit_modrm( p, dst, src ); in sse_andnps()
555 void sse_andps( struct x86_function *p, in sse_andps() argument
559 emit_2ub(p, X86_TWOB, 0x54); in sse_andps()
560 emit_modrm( p, dst, src ); in sse_andps()
563 void sse_rsqrtps( struct x86_function *p, in sse_rsqrtps() argument
567 emit_2ub(p, X86_TWOB, 0x52); in sse_rsqrtps()
568 emit_modrm( p, dst, src ); in sse_rsqrtps()
571 void sse_rsqrtss( struct x86_function *p, in sse_rsqrtss() argument
575 emit_3ub(p, 0xF3, X86_TWOB, 0x52); in sse_rsqrtss()
576 emit_modrm( p, dst, src ); in sse_rsqrtss()
580 void sse_movhlps( struct x86_function *p, in sse_movhlps() argument
585 emit_2ub(p, X86_TWOB, 0x12); in sse_movhlps()
586 emit_modrm( p, dst, src ); in sse_movhlps()
589 void sse_movlhps( struct x86_function *p, in sse_movlhps() argument
594 emit_2ub(p, X86_TWOB, 0x16); in sse_movlhps()
595 emit_modrm( p, dst, src ); in sse_movlhps()
598 void sse_orps( struct x86_function *p, in sse_orps() argument
602 emit_2ub(p, X86_TWOB, 0x56); in sse_orps()
603 emit_modrm( p, dst, src ); in sse_orps()
606 void sse_xorps( struct x86_function *p, in sse_xorps() argument
610 emit_2ub(p, X86_TWOB, 0x57); in sse_xorps()
611 emit_modrm( p, dst, src ); in sse_xorps()
614 void sse_cvtps2pi( struct x86_function *p, in sse_cvtps2pi() argument
621 p->need_emms = 1; in sse_cvtps2pi()
623 emit_2ub(p, X86_TWOB, 0x2d); in sse_cvtps2pi()
624 emit_modrm( p, dst, src ); in sse_cvtps2pi()
631 void sse_shufps( struct x86_function *p, in sse_shufps() argument
636 emit_2ub(p, X86_TWOB, 0xC6); in sse_shufps()
637 emit_modrm(p, dest, arg0); in sse_shufps()
638 emit_1ub(p, shuf); in sse_shufps()
641 void sse_cmpps( struct x86_function *p, in sse_cmpps() argument
646 emit_2ub(p, X86_TWOB, 0xC2); in sse_cmpps()
647 emit_modrm(p, dest, arg0); in sse_cmpps()
648 emit_1ub(p, cc); in sse_cmpps()
651 void sse_pmovmskb( struct x86_function *p, in sse_pmovmskb() argument
655 emit_3ub(p, 0x66, X86_TWOB, 0xD7); in sse_pmovmskb()
656 emit_modrm(p, dest, src); in sse_pmovmskb()
666 void sse2_pshufd( struct x86_function *p, in sse2_pshufd() argument
671 emit_3ub(p, 0x66, X86_TWOB, 0x70); in sse2_pshufd()
672 emit_modrm(p, dest, arg0); in sse2_pshufd()
673 emit_1ub(p, shuf); in sse2_pshufd()
676 void sse2_cvttps2dq( struct x86_function *p, in sse2_cvttps2dq() argument
680 emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); in sse2_cvttps2dq()
681 emit_modrm( p, dst, src ); in sse2_cvttps2dq()
684 void sse2_cvtps2dq( struct x86_function *p, in sse2_cvtps2dq() argument
688 emit_3ub(p, 0x66, X86_TWOB, 0x5B); in sse2_cvtps2dq()
689 emit_modrm( p, dst, src ); in sse2_cvtps2dq()
692 void sse2_packssdw( struct x86_function *p, in sse2_packssdw() argument
696 emit_3ub(p, 0x66, X86_TWOB, 0x6B); in sse2_packssdw()
697 emit_modrm( p, dst, src ); in sse2_packssdw()
700 void sse2_packsswb( struct x86_function *p, in sse2_packsswb() argument
704 emit_3ub(p, 0x66, X86_TWOB, 0x63); in sse2_packsswb()
705 emit_modrm( p, dst, src ); in sse2_packsswb()
708 void sse2_packuswb( struct x86_function *p, in sse2_packuswb() argument
712 emit_3ub(p, 0x66, X86_TWOB, 0x67); in sse2_packuswb()
713 emit_modrm( p, dst, src ); in sse2_packuswb()
716 void sse2_rcpps( struct x86_function *p, in sse2_rcpps() argument
720 emit_2ub(p, X86_TWOB, 0x53); in sse2_rcpps()
721 emit_modrm( p, dst, src ); in sse2_rcpps()
724 void sse2_rcpss( struct x86_function *p, in sse2_rcpss() argument
728 emit_3ub(p, 0xF3, X86_TWOB, 0x53); in sse2_rcpss()
729 emit_modrm( p, dst, src ); in sse2_rcpss()
732 void sse2_movd( struct x86_function *p, in sse2_movd() argument
736 emit_2ub(p, 0x66, X86_TWOB); in sse2_movd()
737 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in sse2_movd()
746 void x87_fist( struct x86_function *p, struct x86_reg dst ) in x87_fist() argument
748 emit_1ub(p, 0xdb); in x87_fist()
749 emit_modrm_noreg(p, 2, dst); in x87_fist()
752 void x87_fistp( struct x86_function *p, struct x86_reg dst ) in x87_fistp() argument
754 emit_1ub(p, 0xdb); in x87_fistp()
755 emit_modrm_noreg(p, 3, dst); in x87_fistp()
758 void x87_fild( struct x86_function *p, struct x86_reg arg ) in x87_fild() argument
760 emit_1ub(p, 0xdf); in x87_fild()
761 emit_modrm_noreg(p, 0, arg); in x87_fild()
764 void x87_fldz( struct x86_function *p ) in x87_fldz() argument
766 emit_2ub(p, 0xd9, 0xee); in x87_fldz()
770 void x87_fldcw( struct x86_function *p, struct x86_reg arg ) in x87_fldcw() argument
774 emit_1ub(p, 0xd9); in x87_fldcw()
775 emit_modrm_noreg(p, 5, arg); in x87_fldcw()
778 void x87_fld1( struct x86_function *p ) in x87_fld1() argument
780 emit_2ub(p, 0xd9, 0xe8); in x87_fld1()
783 void x87_fldl2e( struct x86_function *p ) in x87_fldl2e() argument
785 emit_2ub(p, 0xd9, 0xea); in x87_fldl2e()
788 void x87_fldln2( struct x86_function *p ) in x87_fldln2() argument
790 emit_2ub(p, 0xd9, 0xed); in x87_fldln2()
793 void x87_fwait( struct x86_function *p ) in x87_fwait() argument
795 emit_1ub(p, 0x9b); in x87_fwait()
798 void x87_fnclex( struct x86_function *p ) in x87_fnclex() argument
800 emit_2ub(p, 0xdb, 0xe2); in x87_fnclex()
803 void x87_fclex( struct x86_function *p ) in x87_fclex() argument
805 x87_fwait(p); in x87_fclex()
806 x87_fnclex(p); in x87_fclex()
810 static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, in x87_arith_op() argument
821 emit_2ub(p, dst0ub0, dst0ub1+arg.idx); in x87_arith_op()
823 emit_2ub(p, arg0ub0, arg0ub1+arg.idx); in x87_arith_op()
829 emit_1ub(p, 0xd8); in x87_arith_op()
830 emit_modrm_noreg(p, argmem_noreg, arg); in x87_arith_op()
836 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fmul() argument
838 x87_arith_op(p, dst, arg, in x87_fmul()
844 void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsub() argument
846 x87_arith_op(p, dst, arg, in x87_fsub()
852 void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsubr() argument
854 x87_arith_op(p, dst, arg, in x87_fsubr()
860 void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fadd() argument
862 x87_arith_op(p, dst, arg, in x87_fadd()
868 void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdiv() argument
870 x87_arith_op(p, dst, arg, in x87_fdiv()
876 void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdivr() argument
878 x87_arith_op(p, dst, arg, in x87_fdivr()
884 void x87_fmulp( struct x86_function *p, struct x86_reg dst ) in x87_fmulp() argument
888 emit_2ub(p, 0xde, 0xc8+dst.idx); in x87_fmulp()
891 void x87_fsubp( struct x86_function *p, struct x86_reg dst ) in x87_fsubp() argument
895 emit_2ub(p, 0xde, 0xe8+dst.idx); in x87_fsubp()
898 void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) in x87_fsubrp() argument
902 emit_2ub(p, 0xde, 0xe0+dst.idx); in x87_fsubrp()
905 void x87_faddp( struct x86_function *p, struct x86_reg dst ) in x87_faddp() argument
909 emit_2ub(p, 0xde, 0xc0+dst.idx); in x87_faddp()
912 void x87_fdivp( struct x86_function *p, struct x86_reg dst ) in x87_fdivp() argument
916 emit_2ub(p, 0xde, 0xf8+dst.idx); in x87_fdivp()
919 void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) in x87_fdivrp() argument
923 emit_2ub(p, 0xde, 0xf0+dst.idx); in x87_fdivrp()
926 void x87_fucom( struct x86_function *p, struct x86_reg arg ) in x87_fucom() argument
929 emit_2ub(p, 0xdd, 0xe0+arg.idx); in x87_fucom()
932 void x87_fucomp( struct x86_function *p, struct x86_reg arg ) in x87_fucomp() argument
935 emit_2ub(p, 0xdd, 0xe8+arg.idx); in x87_fucomp()
938 void x87_fucompp( struct x86_function *p ) in x87_fucompp() argument
940 emit_2ub(p, 0xda, 0xe9); in x87_fucompp()
943 void x87_fxch( struct x86_function *p, struct x86_reg arg ) in x87_fxch() argument
946 emit_2ub(p, 0xd9, 0xc8+arg.idx); in x87_fxch()
949 void x87_fabs( struct x86_function *p ) in x87_fabs() argument
951 emit_2ub(p, 0xd9, 0xe1); in x87_fabs()
954 void x87_fchs( struct x86_function *p ) in x87_fchs() argument
956 emit_2ub(p, 0xd9, 0xe0); in x87_fchs()
959 void x87_fcos( struct x86_function *p ) in x87_fcos() argument
961 emit_2ub(p, 0xd9, 0xff); in x87_fcos()
965 void x87_fprndint( struct x86_function *p ) in x87_fprndint() argument
967 emit_2ub(p, 0xd9, 0xfc); in x87_fprndint()
970 void x87_fscale( struct x86_function *p ) in x87_fscale() argument
972 emit_2ub(p, 0xd9, 0xfd); in x87_fscale()
975 void x87_fsin( struct x86_function *p ) in x87_fsin() argument
977 emit_2ub(p, 0xd9, 0xfe); in x87_fsin()
980 void x87_fsincos( struct x86_function *p ) in x87_fsincos() argument
982 emit_2ub(p, 0xd9, 0xfb); in x87_fsincos()
985 void x87_fsqrt( struct x86_function *p ) in x87_fsqrt() argument
987 emit_2ub(p, 0xd9, 0xfa); in x87_fsqrt()
990 void x87_fxtract( struct x86_function *p ) in x87_fxtract() argument
992 emit_2ub(p, 0xd9, 0xf4); in x87_fxtract()
999 void x87_f2xm1( struct x86_function *p ) in x87_f2xm1() argument
1001 emit_2ub(p, 0xd9, 0xf0); in x87_f2xm1()
1007 void x87_fyl2x( struct x86_function *p ) in x87_fyl2x() argument
1009 emit_2ub(p, 0xd9, 0xf1); in x87_fyl2x()
1017 void x87_fyl2xp1( struct x86_function *p ) in x87_fyl2xp1() argument
1019 emit_2ub(p, 0xd9, 0xf9); in x87_fyl2xp1()
1023 void x87_fld( struct x86_function *p, struct x86_reg arg ) in x87_fld() argument
1026 emit_2ub(p, 0xd9, 0xc0 + arg.idx); in x87_fld()
1028 emit_1ub(p, 0xd9); in x87_fld()
1029 emit_modrm_noreg(p, 0, arg); in x87_fld()
1033 void x87_fst( struct x86_function *p, struct x86_reg dst ) in x87_fst() argument
1036 emit_2ub(p, 0xdd, 0xd0 + dst.idx); in x87_fst()
1038 emit_1ub(p, 0xd9); in x87_fst()
1039 emit_modrm_noreg(p, 2, dst); in x87_fst()
1043 void x87_fstp( struct x86_function *p, struct x86_reg dst ) in x87_fstp() argument
1046 emit_2ub(p, 0xdd, 0xd8 + dst.idx); in x87_fstp()
1048 emit_1ub(p, 0xd9); in x87_fstp()
1049 emit_modrm_noreg(p, 3, dst); in x87_fstp()
1053 void x87_fcom( struct x86_function *p, struct x86_reg dst ) in x87_fcom() argument
1056 emit_2ub(p, 0xd8, 0xd0 + dst.idx); in x87_fcom()
1058 emit_1ub(p, 0xd8); in x87_fcom()
1059 emit_modrm_noreg(p, 2, dst); in x87_fcom()
1063 void x87_fcomp( struct x86_function *p, struct x86_reg dst ) in x87_fcomp() argument
1066 emit_2ub(p, 0xd8, 0xd8 + dst.idx); in x87_fcomp()
1068 emit_1ub(p, 0xd8); in x87_fcomp()
1069 emit_modrm_noreg(p, 3, dst); in x87_fcomp()
1074 void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) in x87_fnstsw() argument
1080 emit_2ub(p, 0xdf, 0xe0); in x87_fnstsw()
1082 emit_1ub(p, 0xdd); in x87_fnstsw()
1083 emit_modrm_noreg(p, 7, dst); in x87_fnstsw()
1094 void mmx_emms( struct x86_function *p ) in mmx_emms() argument
1096 assert(p->need_emms); in mmx_emms()
1097 emit_2ub(p, 0x0f, 0x77); in mmx_emms()
1098 p->need_emms = 0; in mmx_emms()
1101 void mmx_packssdw( struct x86_function *p, in mmx_packssdw() argument
1108 p->need_emms = 1; in mmx_packssdw()
1110 emit_2ub(p, X86_TWOB, 0x6b); in mmx_packssdw()
1111 emit_modrm( p, dst, src ); in mmx_packssdw()
1114 void mmx_packuswb( struct x86_function *p, in mmx_packuswb() argument
1121 p->need_emms = 1; in mmx_packuswb()
1123 emit_2ub(p, X86_TWOB, 0x67); in mmx_packuswb()
1124 emit_modrm( p, dst, src ); in mmx_packuswb()
1127 void mmx_movd( struct x86_function *p, in mmx_movd() argument
1131 p->need_emms = 1; in mmx_movd()
1132 emit_1ub(p, X86_TWOB); in mmx_movd()
1133 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in mmx_movd()
1136 void mmx_movq( struct x86_function *p, in mmx_movq() argument
1140 p->need_emms = 1; in mmx_movq()
1141 emit_1ub(p, X86_TWOB); in mmx_movq()
1142 emit_op_modrm( p, 0x6f, 0x7f, dst, src ); in mmx_movq()
1154 struct x86_reg x86_fn_arg( struct x86_function *p, in x86_fn_arg() argument
1158 p->stack_offset + arg * 4); /* ??? */ in x86_fn_arg()
1162 void x86_init_func( struct x86_function *p ) in x86_init_func() argument
1164 p->size = 0; in x86_init_func()
1165 p->store = NULL; in x86_init_func()
1166 p->csr = p->store; in x86_init_func()
1169 int x86_init_func_size( struct x86_function *p, unsigned code_size ) in x86_init_func_size() argument
1171 p->size = code_size; in x86_init_func_size()
1172 p->store = _mesa_exec_malloc(code_size); in x86_init_func_size()
1173 p->csr = p->store; in x86_init_func_size()
1174 return p->store != NULL; in x86_init_func_size()
1177 void x86_release_func( struct x86_function *p ) in x86_release_func() argument
1179 _mesa_exec_free(p->store); in x86_release_func()
1180 p->store = NULL; in x86_release_func()
1181 p->csr = NULL; in x86_release_func()
1182 p->size = 0; in x86_release_func()
1186 void (*x86_get_func( struct x86_function *p ))(void) in x86_get_func() argument
1188 if (DISASSEM && p->store) in x86_get_func()
1189 printf("disassemble %p %p\n", p->store, p->csr); in x86_get_func()
1190 return (void (*)(void)) (unsigned long) p->store; in x86_get_func()