Lines Matching refs:p

18 static void do_realloc( struct x86_function *p )  in do_realloc()  argument
20 if (p->size == 0) { in do_realloc()
21 p->size = 1024; in do_realloc()
22 p->store = _mesa_exec_malloc(p->size); in do_realloc()
23 p->csr = p->store; in do_realloc()
26 unsigned used = p->csr - p->store; in do_realloc()
27 unsigned char *tmp = p->store; in do_realloc()
28 p->size *= 2; in do_realloc()
29 p->store = _mesa_exec_malloc(p->size); in do_realloc()
30 memcpy(p->store, tmp, used); in do_realloc()
31 p->csr = p->store + used; in do_realloc()
38 static unsigned char *reserve( struct x86_function *p, int bytes ) in reserve() argument
40 if (p->csr + bytes - p->store > p->size) in reserve()
41 do_realloc(p); in reserve()
44 unsigned char *csr = p->csr; in reserve()
45 p->csr += bytes; in reserve()
52 static void emit_1b( struct x86_function *p, char b0 ) in emit_1b() argument
54 char *csr = (char *)reserve(p, 1); in emit_1b()
58 static void emit_1i( struct x86_function *p, int i0 ) in emit_1i() argument
60 int *icsr = (int *)reserve(p, sizeof(i0)); in emit_1i()
64 static void emit_1ub( struct x86_function *p, unsigned char b0 ) in emit_1ub() argument
66 unsigned char *csr = reserve(p, 1); in emit_1ub()
70 static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) in emit_2ub() argument
72 unsigned char *csr = reserve(p, 2); in emit_2ub()
77 static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) in emit_3ub() argument
79 unsigned char *csr = reserve(p, 3); in emit_3ub()
89 static void emit_modrm( struct x86_function *p, in emit_modrm() argument
101 emit_1ub(p, val); in emit_modrm()
107 emit_1ub(p, 0x24); /* simplistic! */ in emit_modrm()
115 emit_1b(p, regmem.disp); in emit_modrm()
118 emit_1i(p, regmem.disp); in emit_modrm()
127 static void emit_modrm_noreg( struct x86_function *p, in emit_modrm_noreg() argument
132 emit_modrm(p, dummy, regmem); in emit_modrm_noreg()
140 static void emit_op_modrm( struct x86_function *p, in emit_op_modrm() argument
148 emit_1ub(p, op_dst_is_reg); in emit_op_modrm()
149 emit_modrm(p, dst, src); in emit_op_modrm()
155 emit_1ub(p, op_dst_is_mem); in emit_op_modrm()
156 emit_modrm(p, src, dst); in emit_op_modrm()
215 unsigned char *x86_get_label( struct x86_function *p ) in x86_get_label() argument
217 return p->csr; in x86_get_label()
227 void x86_jcc( struct x86_function *p, in x86_jcc() argument
231 int offset = label - (x86_get_label(p) + 2); in x86_jcc()
234 emit_1ub(p, 0x70 + cc); in x86_jcc()
235 emit_1b(p, (char) offset); in x86_jcc()
238 offset = label - (x86_get_label(p) + 6); in x86_jcc()
239 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc()
240 emit_1i(p, offset); in x86_jcc()
246 unsigned char *x86_jcc_forward( struct x86_function *p, in x86_jcc_forward() argument
249 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc_forward()
250 emit_1i(p, 0); in x86_jcc_forward()
251 return x86_get_label(p); in x86_jcc_forward()
254 unsigned char *x86_jmp_forward( struct x86_function *p) in x86_jmp_forward() argument
256 emit_1ub(p, 0xe9); in x86_jmp_forward()
257 emit_1i(p, 0); in x86_jmp_forward()
258 return x86_get_label(p); in x86_jmp_forward()
261 unsigned char *x86_call_forward( struct x86_function *p) in x86_call_forward() argument
263 emit_1ub(p, 0xe8); in x86_call_forward()
264 emit_1i(p, 0); in x86_call_forward()
265 return x86_get_label(p); in x86_call_forward()
270 void x86_fixup_fwd_jump( struct x86_function *p, in x86_fixup_fwd_jump() argument
273 *(int *)(fixup - 4) = x86_get_label(p) - fixup; in x86_fixup_fwd_jump()
276 void x86_jmp( struct x86_function *p, unsigned char *label) in x86_jmp() argument
278 emit_1ub(p, 0xe9); in x86_jmp()
279 emit_1i(p, label - x86_get_label(p) - 4); in x86_jmp()
287 void x86_call( struct x86_function *p, void (*label)())
289 emit_1ub(p, 0xe8);
290 emit_1i(p, cptr(label) - x86_get_label(p) - 4);
293 void x86_call( struct x86_function *p, struct x86_reg reg) in x86_call() argument
295 emit_1ub(p, 0xff); in x86_call()
296 emit_modrm_noreg(p, 2, reg); in x86_call()
305 void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) in x86_mov_reg_imm() argument
308 emit_1ub(p, 0xb8 + dst.idx); in x86_mov_reg_imm()
309 emit_1i(p, imm); in x86_mov_reg_imm()
312 void x86_push( struct x86_function *p, in x86_push() argument
316 emit_1ub(p, 0x50 + reg.idx); in x86_push()
317 p->stack_offset += 4; in x86_push()
320 void x86_pop( struct x86_function *p, in x86_pop() argument
324 emit_1ub(p, 0x58 + reg.idx); in x86_pop()
325 p->stack_offset -= 4; in x86_pop()
328 void x86_inc( struct x86_function *p, in x86_inc() argument
332 emit_1ub(p, 0x40 + reg.idx); in x86_inc()
335 void x86_dec( struct x86_function *p, in x86_dec() argument
339 emit_1ub(p, 0x48 + reg.idx); in x86_dec()
342 void x86_ret( struct x86_function *p ) in x86_ret() argument
344 emit_1ub(p, 0xc3); in x86_ret()
347 void x86_sahf( struct x86_function *p ) in x86_sahf() argument
349 emit_1ub(p, 0x9e); in x86_sahf()
352 void x86_mov( struct x86_function *p, in x86_mov() argument
356 emit_op_modrm( p, 0x8b, 0x89, dst, src ); in x86_mov()
359 void x86_xor( struct x86_function *p, in x86_xor() argument
363 emit_op_modrm( p, 0x33, 0x31, dst, src ); in x86_xor()
366 void x86_cmp( struct x86_function *p, in x86_cmp() argument
370 emit_op_modrm( p, 0x3b, 0x39, dst, src ); in x86_cmp()
373 void x86_lea( struct x86_function *p, in x86_lea() argument
377 emit_1ub(p, 0x8d); in x86_lea()
378 emit_modrm( p, dst, src ); in x86_lea()
381 void x86_test( struct x86_function *p, in x86_test() argument
385 emit_1ub(p, 0x85); in x86_test()
386 emit_modrm( p, dst, src ); in x86_test()
389 void x86_add( struct x86_function *p, in x86_add() argument
393 emit_op_modrm(p, 0x03, 0x01, dst, src ); in x86_add()
396 void x86_mul( struct x86_function *p, in x86_mul() argument
400 emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); in x86_mul()
403 void x86_sub( struct x86_function *p, in x86_sub() argument
407 emit_op_modrm(p, 0x2b, 0x29, dst, src ); in x86_sub()
410 void x86_or( struct x86_function *p, in x86_or() argument
414 emit_op_modrm( p, 0x0b, 0x09, dst, src ); in x86_or()
417 void x86_and( struct x86_function *p, in x86_and() argument
421 emit_op_modrm( p, 0x23, 0x21, dst, src ); in x86_and()
431 void sse_movss( struct x86_function *p, in sse_movss() argument
435 emit_2ub(p, 0xF3, X86_TWOB); in sse_movss()
436 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movss()
439 void sse_movaps( struct x86_function *p, in sse_movaps() argument
443 emit_1ub(p, X86_TWOB); in sse_movaps()
444 emit_op_modrm( p, 0x28, 0x29, dst, src ); in sse_movaps()
447 void sse_movups( struct x86_function *p, in sse_movups() argument
451 emit_1ub(p, X86_TWOB); in sse_movups()
452 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movups()
455 void sse_movhps( struct x86_function *p, in sse_movhps() argument
460 emit_1ub(p, X86_TWOB); in sse_movhps()
461 emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ in sse_movhps()
464 void sse_movlps( struct x86_function *p, in sse_movlps() argument
469 emit_1ub(p, X86_TWOB); in sse_movlps()
470 emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ in sse_movlps()
473 void sse_maxps( struct x86_function *p, in sse_maxps() argument
477 emit_2ub(p, X86_TWOB, 0x5F); in sse_maxps()
478 emit_modrm( p, dst, src ); in sse_maxps()
481 void sse_maxss( struct x86_function *p, in sse_maxss() argument
485 emit_3ub(p, 0xF3, X86_TWOB, 0x5F); in sse_maxss()
486 emit_modrm( p, dst, src ); in sse_maxss()
489 void sse_divss( struct x86_function *p, in sse_divss() argument
493 emit_3ub(p, 0xF3, X86_TWOB, 0x5E); in sse_divss()
494 emit_modrm( p, dst, src ); in sse_divss()
497 void sse_minps( struct x86_function *p, in sse_minps() argument
501 emit_2ub(p, X86_TWOB, 0x5D); in sse_minps()
502 emit_modrm( p, dst, src ); in sse_minps()
505 void sse_subps( struct x86_function *p, in sse_subps() argument
509 emit_2ub(p, X86_TWOB, 0x5C); in sse_subps()
510 emit_modrm( p, dst, src ); in sse_subps()
513 void sse_mulps( struct x86_function *p, in sse_mulps() argument
517 emit_2ub(p, X86_TWOB, 0x59); in sse_mulps()
518 emit_modrm( p, dst, src ); in sse_mulps()
521 void sse_mulss( struct x86_function *p, in sse_mulss() argument
525 emit_3ub(p, 0xF3, X86_TWOB, 0x59); in sse_mulss()
526 emit_modrm( p, dst, src ); in sse_mulss()
529 void sse_addps( struct x86_function *p, in sse_addps() argument
533 emit_2ub(p, X86_TWOB, 0x58); in sse_addps()
534 emit_modrm( p, dst, src ); in sse_addps()
537 void sse_addss( struct x86_function *p, in sse_addss() argument
541 emit_3ub(p, 0xF3, X86_TWOB, 0x58); in sse_addss()
542 emit_modrm( p, dst, src ); in sse_addss()
545 void sse_andnps( struct x86_function *p, in sse_andnps() argument
549 emit_2ub(p, X86_TWOB, 0x55); in sse_andnps()
550 emit_modrm( p, dst, src ); in sse_andnps()
553 void sse_andps( struct x86_function *p, in sse_andps() argument
557 emit_2ub(p, X86_TWOB, 0x54); in sse_andps()
558 emit_modrm( p, dst, src ); in sse_andps()
561 void sse_rsqrtps( struct x86_function *p, in sse_rsqrtps() argument
565 emit_2ub(p, X86_TWOB, 0x52); in sse_rsqrtps()
566 emit_modrm( p, dst, src ); in sse_rsqrtps()
569 void sse_rsqrtss( struct x86_function *p, in sse_rsqrtss() argument
573 emit_3ub(p, 0xF3, X86_TWOB, 0x52); in sse_rsqrtss()
574 emit_modrm( p, dst, src ); in sse_rsqrtss()
578 void sse_movhlps( struct x86_function *p, in sse_movhlps() argument
583 emit_2ub(p, X86_TWOB, 0x12); in sse_movhlps()
584 emit_modrm( p, dst, src ); in sse_movhlps()
587 void sse_movlhps( struct x86_function *p, in sse_movlhps() argument
592 emit_2ub(p, X86_TWOB, 0x16); in sse_movlhps()
593 emit_modrm( p, dst, src ); in sse_movlhps()
596 void sse_orps( struct x86_function *p, in sse_orps() argument
600 emit_2ub(p, X86_TWOB, 0x56); in sse_orps()
601 emit_modrm( p, dst, src ); in sse_orps()
604 void sse_xorps( struct x86_function *p, in sse_xorps() argument
608 emit_2ub(p, X86_TWOB, 0x57); in sse_xorps()
609 emit_modrm( p, dst, src ); in sse_xorps()
612 void sse_cvtps2pi( struct x86_function *p, in sse_cvtps2pi() argument
619 p->need_emms = 1; in sse_cvtps2pi()
621 emit_2ub(p, X86_TWOB, 0x2d); in sse_cvtps2pi()
622 emit_modrm( p, dst, src ); in sse_cvtps2pi()
629 void sse_shufps( struct x86_function *p, in sse_shufps() argument
634 emit_2ub(p, X86_TWOB, 0xC6); in sse_shufps()
635 emit_modrm(p, dest, arg0); in sse_shufps()
636 emit_1ub(p, shuf); in sse_shufps()
639 void sse_cmpps( struct x86_function *p, in sse_cmpps() argument
644 emit_2ub(p, X86_TWOB, 0xC2); in sse_cmpps()
645 emit_modrm(p, dest, arg0); in sse_cmpps()
646 emit_1ub(p, cc); in sse_cmpps()
649 void sse_pmovmskb( struct x86_function *p, in sse_pmovmskb() argument
653 emit_3ub(p, 0x66, X86_TWOB, 0xD7); in sse_pmovmskb()
654 emit_modrm(p, dest, src); in sse_pmovmskb()
664 void sse2_pshufd( struct x86_function *p, in sse2_pshufd() argument
669 emit_3ub(p, 0x66, X86_TWOB, 0x70); in sse2_pshufd()
670 emit_modrm(p, dest, arg0); in sse2_pshufd()
671 emit_1ub(p, shuf); in sse2_pshufd()
674 void sse2_cvttps2dq( struct x86_function *p, in sse2_cvttps2dq() argument
678 emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); in sse2_cvttps2dq()
679 emit_modrm( p, dst, src ); in sse2_cvttps2dq()
682 void sse2_cvtps2dq( struct x86_function *p, in sse2_cvtps2dq() argument
686 emit_3ub(p, 0x66, X86_TWOB, 0x5B); in sse2_cvtps2dq()
687 emit_modrm( p, dst, src ); in sse2_cvtps2dq()
690 void sse2_packssdw( struct x86_function *p, in sse2_packssdw() argument
694 emit_3ub(p, 0x66, X86_TWOB, 0x6B); in sse2_packssdw()
695 emit_modrm( p, dst, src ); in sse2_packssdw()
698 void sse2_packsswb( struct x86_function *p, in sse2_packsswb() argument
702 emit_3ub(p, 0x66, X86_TWOB, 0x63); in sse2_packsswb()
703 emit_modrm( p, dst, src ); in sse2_packsswb()
706 void sse2_packuswb( struct x86_function *p, in sse2_packuswb() argument
710 emit_3ub(p, 0x66, X86_TWOB, 0x67); in sse2_packuswb()
711 emit_modrm( p, dst, src ); in sse2_packuswb()
714 void sse2_rcpps( struct x86_function *p, in sse2_rcpps() argument
718 emit_2ub(p, X86_TWOB, 0x53); in sse2_rcpps()
719 emit_modrm( p, dst, src ); in sse2_rcpps()
722 void sse2_rcpss( struct x86_function *p, in sse2_rcpss() argument
726 emit_3ub(p, 0xF3, X86_TWOB, 0x53); in sse2_rcpss()
727 emit_modrm( p, dst, src ); in sse2_rcpss()
730 void sse2_movd( struct x86_function *p, in sse2_movd() argument
734 emit_2ub(p, 0x66, X86_TWOB); in sse2_movd()
735 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in sse2_movd()
744 void x87_fist( struct x86_function *p, struct x86_reg dst ) in x87_fist() argument
746 emit_1ub(p, 0xdb); in x87_fist()
747 emit_modrm_noreg(p, 2, dst); in x87_fist()
750 void x87_fistp( struct x86_function *p, struct x86_reg dst ) in x87_fistp() argument
752 emit_1ub(p, 0xdb); in x87_fistp()
753 emit_modrm_noreg(p, 3, dst); in x87_fistp()
756 void x87_fild( struct x86_function *p, struct x86_reg arg ) in x87_fild() argument
758 emit_1ub(p, 0xdf); in x87_fild()
759 emit_modrm_noreg(p, 0, arg); in x87_fild()
762 void x87_fldz( struct x86_function *p ) in x87_fldz() argument
764 emit_2ub(p, 0xd9, 0xee); in x87_fldz()
768 void x87_fldcw( struct x86_function *p, struct x86_reg arg ) in x87_fldcw() argument
772 emit_1ub(p, 0xd9); in x87_fldcw()
773 emit_modrm_noreg(p, 5, arg); in x87_fldcw()
776 void x87_fld1( struct x86_function *p ) in x87_fld1() argument
778 emit_2ub(p, 0xd9, 0xe8); in x87_fld1()
781 void x87_fldl2e( struct x86_function *p ) in x87_fldl2e() argument
783 emit_2ub(p, 0xd9, 0xea); in x87_fldl2e()
786 void x87_fldln2( struct x86_function *p ) in x87_fldln2() argument
788 emit_2ub(p, 0xd9, 0xed); in x87_fldln2()
791 void x87_fwait( struct x86_function *p ) in x87_fwait() argument
793 emit_1ub(p, 0x9b); in x87_fwait()
796 void x87_fnclex( struct x86_function *p ) in x87_fnclex() argument
798 emit_2ub(p, 0xdb, 0xe2); in x87_fnclex()
801 void x87_fclex( struct x86_function *p ) in x87_fclex() argument
803 x87_fwait(p); in x87_fclex()
804 x87_fnclex(p); in x87_fclex()
808 static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, in x87_arith_op() argument
819 emit_2ub(p, dst0ub0, dst0ub1+arg.idx); in x87_arith_op()
821 emit_2ub(p, arg0ub0, arg0ub1+arg.idx); in x87_arith_op()
827 emit_1ub(p, 0xd8); in x87_arith_op()
828 emit_modrm_noreg(p, argmem_noreg, arg); in x87_arith_op()
834 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fmul() argument
836 x87_arith_op(p, dst, arg, in x87_fmul()
842 void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsub() argument
844 x87_arith_op(p, dst, arg, in x87_fsub()
850 void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsubr() argument
852 x87_arith_op(p, dst, arg, in x87_fsubr()
858 void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fadd() argument
860 x87_arith_op(p, dst, arg, in x87_fadd()
866 void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdiv() argument
868 x87_arith_op(p, dst, arg, in x87_fdiv()
874 void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdivr() argument
876 x87_arith_op(p, dst, arg, in x87_fdivr()
882 void x87_fmulp( struct x86_function *p, struct x86_reg dst ) in x87_fmulp() argument
886 emit_2ub(p, 0xde, 0xc8+dst.idx); in x87_fmulp()
889 void x87_fsubp( struct x86_function *p, struct x86_reg dst ) in x87_fsubp() argument
893 emit_2ub(p, 0xde, 0xe8+dst.idx); in x87_fsubp()
896 void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) in x87_fsubrp() argument
900 emit_2ub(p, 0xde, 0xe0+dst.idx); in x87_fsubrp()
903 void x87_faddp( struct x86_function *p, struct x86_reg dst ) in x87_faddp() argument
907 emit_2ub(p, 0xde, 0xc0+dst.idx); in x87_faddp()
910 void x87_fdivp( struct x86_function *p, struct x86_reg dst ) in x87_fdivp() argument
914 emit_2ub(p, 0xde, 0xf8+dst.idx); in x87_fdivp()
917 void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) in x87_fdivrp() argument
921 emit_2ub(p, 0xde, 0xf0+dst.idx); in x87_fdivrp()
924 void x87_fucom( struct x86_function *p, struct x86_reg arg ) in x87_fucom() argument
927 emit_2ub(p, 0xdd, 0xe0+arg.idx); in x87_fucom()
930 void x87_fucomp( struct x86_function *p, struct x86_reg arg ) in x87_fucomp() argument
933 emit_2ub(p, 0xdd, 0xe8+arg.idx); in x87_fucomp()
936 void x87_fucompp( struct x86_function *p ) in x87_fucompp() argument
938 emit_2ub(p, 0xda, 0xe9); in x87_fucompp()
941 void x87_fxch( struct x86_function *p, struct x86_reg arg ) in x87_fxch() argument
944 emit_2ub(p, 0xd9, 0xc8+arg.idx); in x87_fxch()
947 void x87_fabs( struct x86_function *p ) in x87_fabs() argument
949 emit_2ub(p, 0xd9, 0xe1); in x87_fabs()
952 void x87_fchs( struct x86_function *p ) in x87_fchs() argument
954 emit_2ub(p, 0xd9, 0xe0); in x87_fchs()
957 void x87_fcos( struct x86_function *p ) in x87_fcos() argument
959 emit_2ub(p, 0xd9, 0xff); in x87_fcos()
963 void x87_fprndint( struct x86_function *p ) in x87_fprndint() argument
965 emit_2ub(p, 0xd9, 0xfc); in x87_fprndint()
968 void x87_fscale( struct x86_function *p ) in x87_fscale() argument
970 emit_2ub(p, 0xd9, 0xfd); in x87_fscale()
973 void x87_fsin( struct x86_function *p ) in x87_fsin() argument
975 emit_2ub(p, 0xd9, 0xfe); in x87_fsin()
978 void x87_fsincos( struct x86_function *p ) in x87_fsincos() argument
980 emit_2ub(p, 0xd9, 0xfb); in x87_fsincos()
983 void x87_fsqrt( struct x86_function *p ) in x87_fsqrt() argument
985 emit_2ub(p, 0xd9, 0xfa); in x87_fsqrt()
988 void x87_fxtract( struct x86_function *p ) in x87_fxtract() argument
990 emit_2ub(p, 0xd9, 0xf4); in x87_fxtract()
997 void x87_f2xm1( struct x86_function *p ) in x87_f2xm1() argument
999 emit_2ub(p, 0xd9, 0xf0); in x87_f2xm1()
1005 void x87_fyl2x( struct x86_function *p ) in x87_fyl2x() argument
1007 emit_2ub(p, 0xd9, 0xf1); in x87_fyl2x()
1015 void x87_fyl2xp1( struct x86_function *p ) in x87_fyl2xp1() argument
1017 emit_2ub(p, 0xd9, 0xf9); in x87_fyl2xp1()
1021 void x87_fld( struct x86_function *p, struct x86_reg arg ) in x87_fld() argument
1024 emit_2ub(p, 0xd9, 0xc0 + arg.idx); in x87_fld()
1026 emit_1ub(p, 0xd9); in x87_fld()
1027 emit_modrm_noreg(p, 0, arg); in x87_fld()
1031 void x87_fst( struct x86_function *p, struct x86_reg dst ) in x87_fst() argument
1034 emit_2ub(p, 0xdd, 0xd0 + dst.idx); in x87_fst()
1036 emit_1ub(p, 0xd9); in x87_fst()
1037 emit_modrm_noreg(p, 2, dst); in x87_fst()
1041 void x87_fstp( struct x86_function *p, struct x86_reg dst ) in x87_fstp() argument
1044 emit_2ub(p, 0xdd, 0xd8 + dst.idx); in x87_fstp()
1046 emit_1ub(p, 0xd9); in x87_fstp()
1047 emit_modrm_noreg(p, 3, dst); in x87_fstp()
1051 void x87_fcom( struct x86_function *p, struct x86_reg dst ) in x87_fcom() argument
1054 emit_2ub(p, 0xd8, 0xd0 + dst.idx); in x87_fcom()
1056 emit_1ub(p, 0xd8); in x87_fcom()
1057 emit_modrm_noreg(p, 2, dst); in x87_fcom()
1061 void x87_fcomp( struct x86_function *p, struct x86_reg dst ) in x87_fcomp() argument
1064 emit_2ub(p, 0xd8, 0xd8 + dst.idx); in x87_fcomp()
1066 emit_1ub(p, 0xd8); in x87_fcomp()
1067 emit_modrm_noreg(p, 3, dst); in x87_fcomp()
1072 void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) in x87_fnstsw() argument
1078 emit_2ub(p, 0xdf, 0xe0); in x87_fnstsw()
1080 emit_1ub(p, 0xdd); in x87_fnstsw()
1081 emit_modrm_noreg(p, 7, dst); in x87_fnstsw()
1092 void mmx_emms( struct x86_function *p ) in mmx_emms() argument
1094 assert(p->need_emms); in mmx_emms()
1095 emit_2ub(p, 0x0f, 0x77); in mmx_emms()
1096 p->need_emms = 0; in mmx_emms()
1099 void mmx_packssdw( struct x86_function *p, in mmx_packssdw() argument
1106 p->need_emms = 1; in mmx_packssdw()
1108 emit_2ub(p, X86_TWOB, 0x6b); in mmx_packssdw()
1109 emit_modrm( p, dst, src ); in mmx_packssdw()
1112 void mmx_packuswb( struct x86_function *p, in mmx_packuswb() argument
1119 p->need_emms = 1; in mmx_packuswb()
1121 emit_2ub(p, X86_TWOB, 0x67); in mmx_packuswb()
1122 emit_modrm( p, dst, src ); in mmx_packuswb()
1125 void mmx_movd( struct x86_function *p, in mmx_movd() argument
1129 p->need_emms = 1; in mmx_movd()
1130 emit_1ub(p, X86_TWOB); in mmx_movd()
1131 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in mmx_movd()
1134 void mmx_movq( struct x86_function *p, in mmx_movq() argument
1138 p->need_emms = 1; in mmx_movq()
1139 emit_1ub(p, X86_TWOB); in mmx_movq()
1140 emit_op_modrm( p, 0x6f, 0x7f, dst, src ); in mmx_movq()
1152 struct x86_reg x86_fn_arg( struct x86_function *p, in x86_fn_arg() argument
1156 p->stack_offset + arg * 4); /* ??? */ in x86_fn_arg()
1160 void x86_init_func( struct x86_function *p ) in x86_init_func() argument
1162 p->size = 0; in x86_init_func()
1163 p->store = NULL; in x86_init_func()
1164 p->csr = p->store; in x86_init_func()
1167 int x86_init_func_size( struct x86_function *p, unsigned code_size ) in x86_init_func_size() argument
1169 p->size = code_size; in x86_init_func_size()
1170 p->store = _mesa_exec_malloc(code_size); in x86_init_func_size()
1171 p->csr = p->store; in x86_init_func_size()
1172 return p->store != NULL; in x86_init_func_size()
1175 void x86_release_func( struct x86_function *p ) in x86_release_func() argument
1177 _mesa_exec_free(p->store); in x86_release_func()
1178 p->store = NULL; in x86_release_func()
1179 p->csr = NULL; in x86_release_func()
1180 p->size = 0; in x86_release_func()
1184 void (*x86_get_func( struct x86_function *p ))(void) in x86_get_func() argument
1186 if (DISASSEM && p->store) in x86_get_func()
1187 printf("disassemble %p %p\n", p->store, p->csr); in x86_get_func()
1188 return (void (*)(void)) (unsigned long) p->store; in x86_get_func()