Lines Matching refs:p

21 static void do_realloc( struct x86_function *p )  in do_realloc()  argument
23 if (p->size == 0) { in do_realloc()
24 p->size = 1024; in do_realloc()
25 p->store = _mesa_exec_malloc(p->size); in do_realloc()
26 p->csr = p->store; in do_realloc()
29 unsigned used = p->csr - p->store; in do_realloc()
30 unsigned char *tmp = p->store; in do_realloc()
31 p->size *= 2; in do_realloc()
32 p->store = _mesa_exec_malloc(p->size); in do_realloc()
33 memcpy(p->store, tmp, used); in do_realloc()
34 p->csr = p->store + used; in do_realloc()
41 static unsigned char *reserve( struct x86_function *p, int bytes ) in reserve() argument
43 if (p->csr + bytes - p->store > p->size) in reserve()
44 do_realloc(p); in reserve()
47 unsigned char *csr = p->csr; in reserve()
48 p->csr += bytes; in reserve()
55 static void emit_1b( struct x86_function *p, char b0 ) in emit_1b() argument
57 char *csr = (char *)reserve(p, 1); in emit_1b()
61 static void emit_1i( struct x86_function *p, int i0 ) in emit_1i() argument
63 int *icsr = (int *)reserve(p, sizeof(i0)); in emit_1i()
67 static void emit_1ub( struct x86_function *p, unsigned char b0 ) in emit_1ub() argument
69 unsigned char *csr = reserve(p, 1); in emit_1ub()
73 static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) in emit_2ub() argument
75 unsigned char *csr = reserve(p, 2); in emit_2ub()
80 static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) in emit_3ub() argument
82 unsigned char *csr = reserve(p, 3); in emit_3ub()
92 static void emit_modrm( struct x86_function *p, in emit_modrm() argument
104 emit_1ub(p, val); in emit_modrm()
110 emit_1ub(p, 0x24); /* simplistic! */ in emit_modrm()
118 emit_1b(p, regmem.disp); in emit_modrm()
121 emit_1i(p, regmem.disp); in emit_modrm()
130 static void emit_modrm_noreg( struct x86_function *p, in emit_modrm_noreg() argument
135 emit_modrm(p, dummy, regmem); in emit_modrm_noreg()
143 static void emit_op_modrm( struct x86_function *p, in emit_op_modrm() argument
151 emit_1ub(p, op_dst_is_reg); in emit_op_modrm()
152 emit_modrm(p, dst, src); in emit_op_modrm()
158 emit_1ub(p, op_dst_is_mem); in emit_op_modrm()
159 emit_modrm(p, src, dst); in emit_op_modrm()
218 unsigned char *x86_get_label( struct x86_function *p ) in x86_get_label() argument
220 return p->csr; in x86_get_label()
230 void x86_jcc( struct x86_function *p, in x86_jcc() argument
234 int offset = label - (x86_get_label(p) + 2); in x86_jcc()
237 emit_1ub(p, 0x70 + cc); in x86_jcc()
238 emit_1b(p, (char) offset); in x86_jcc()
241 offset = label - (x86_get_label(p) + 6); in x86_jcc()
242 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc()
243 emit_1i(p, offset); in x86_jcc()
249 unsigned char *x86_jcc_forward( struct x86_function *p, in x86_jcc_forward() argument
252 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc_forward()
253 emit_1i(p, 0); in x86_jcc_forward()
254 return x86_get_label(p); in x86_jcc_forward()
257 unsigned char *x86_jmp_forward( struct x86_function *p) in x86_jmp_forward() argument
259 emit_1ub(p, 0xe9); in x86_jmp_forward()
260 emit_1i(p, 0); in x86_jmp_forward()
261 return x86_get_label(p); in x86_jmp_forward()
264 unsigned char *x86_call_forward( struct x86_function *p) in x86_call_forward() argument
266 emit_1ub(p, 0xe8); in x86_call_forward()
267 emit_1i(p, 0); in x86_call_forward()
268 return x86_get_label(p); in x86_call_forward()
273 void x86_fixup_fwd_jump( struct x86_function *p, in x86_fixup_fwd_jump() argument
276 *(int *)(fixup - 4) = x86_get_label(p) - fixup; in x86_fixup_fwd_jump()
279 void x86_jmp( struct x86_function *p, unsigned char *label) in x86_jmp() argument
281 emit_1ub(p, 0xe9); in x86_jmp()
282 emit_1i(p, label - x86_get_label(p) - 4); in x86_jmp()
290 void x86_call( struct x86_function *p, void (*label)())
292 emit_1ub(p, 0xe8);
293 emit_1i(p, cptr(label) - x86_get_label(p) - 4);
296 void x86_call( struct x86_function *p, struct x86_reg reg) in x86_call() argument
298 emit_1ub(p, 0xff); in x86_call()
299 emit_modrm_noreg(p, 2, reg); in x86_call()
308 void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) in x86_mov_reg_imm() argument
311 emit_1ub(p, 0xb8 + dst.idx); in x86_mov_reg_imm()
312 emit_1i(p, imm); in x86_mov_reg_imm()
315 void x86_push( struct x86_function *p, in x86_push() argument
319 emit_1ub(p, 0x50 + reg.idx); in x86_push()
320 p->stack_offset += 4; in x86_push()
323 void x86_pop( struct x86_function *p, in x86_pop() argument
327 emit_1ub(p, 0x58 + reg.idx); in x86_pop()
328 p->stack_offset -= 4; in x86_pop()
331 void x86_inc( struct x86_function *p, in x86_inc() argument
335 emit_1ub(p, 0x40 + reg.idx); in x86_inc()
338 void x86_dec( struct x86_function *p, in x86_dec() argument
342 emit_1ub(p, 0x48 + reg.idx); in x86_dec()
345 void x86_ret( struct x86_function *p ) in x86_ret() argument
347 emit_1ub(p, 0xc3); in x86_ret()
350 void x86_sahf( struct x86_function *p ) in x86_sahf() argument
352 emit_1ub(p, 0x9e); in x86_sahf()
355 void x86_mov( struct x86_function *p, in x86_mov() argument
359 emit_op_modrm( p, 0x8b, 0x89, dst, src ); in x86_mov()
362 void x86_xor( struct x86_function *p, in x86_xor() argument
366 emit_op_modrm( p, 0x33, 0x31, dst, src ); in x86_xor()
369 void x86_cmp( struct x86_function *p, in x86_cmp() argument
373 emit_op_modrm( p, 0x3b, 0x39, dst, src ); in x86_cmp()
376 void x86_lea( struct x86_function *p, in x86_lea() argument
380 emit_1ub(p, 0x8d); in x86_lea()
381 emit_modrm( p, dst, src ); in x86_lea()
384 void x86_test( struct x86_function *p, in x86_test() argument
388 emit_1ub(p, 0x85); in x86_test()
389 emit_modrm( p, dst, src ); in x86_test()
392 void x86_add( struct x86_function *p, in x86_add() argument
396 emit_op_modrm(p, 0x03, 0x01, dst, src ); in x86_add()
399 void x86_mul( struct x86_function *p, in x86_mul() argument
403 emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); in x86_mul()
406 void x86_sub( struct x86_function *p, in x86_sub() argument
410 emit_op_modrm(p, 0x2b, 0x29, dst, src ); in x86_sub()
413 void x86_or( struct x86_function *p, in x86_or() argument
417 emit_op_modrm( p, 0x0b, 0x09, dst, src ); in x86_or()
420 void x86_and( struct x86_function *p, in x86_and() argument
424 emit_op_modrm( p, 0x23, 0x21, dst, src ); in x86_and()
434 void sse_movss( struct x86_function *p, in sse_movss() argument
438 emit_2ub(p, 0xF3, X86_TWOB); in sse_movss()
439 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movss()
442 void sse_movaps( struct x86_function *p, in sse_movaps() argument
446 emit_1ub(p, X86_TWOB); in sse_movaps()
447 emit_op_modrm( p, 0x28, 0x29, dst, src ); in sse_movaps()
450 void sse_movups( struct x86_function *p, in sse_movups() argument
454 emit_1ub(p, X86_TWOB); in sse_movups()
455 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movups()
458 void sse_movhps( struct x86_function *p, in sse_movhps() argument
463 emit_1ub(p, X86_TWOB); in sse_movhps()
464 emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ in sse_movhps()
467 void sse_movlps( struct x86_function *p, in sse_movlps() argument
472 emit_1ub(p, X86_TWOB); in sse_movlps()
473 emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ in sse_movlps()
476 void sse_maxps( struct x86_function *p, in sse_maxps() argument
480 emit_2ub(p, X86_TWOB, 0x5F); in sse_maxps()
481 emit_modrm( p, dst, src ); in sse_maxps()
484 void sse_maxss( struct x86_function *p, in sse_maxss() argument
488 emit_3ub(p, 0xF3, X86_TWOB, 0x5F); in sse_maxss()
489 emit_modrm( p, dst, src ); in sse_maxss()
492 void sse_divss( struct x86_function *p, in sse_divss() argument
496 emit_3ub(p, 0xF3, X86_TWOB, 0x5E); in sse_divss()
497 emit_modrm( p, dst, src ); in sse_divss()
500 void sse_minps( struct x86_function *p, in sse_minps() argument
504 emit_2ub(p, X86_TWOB, 0x5D); in sse_minps()
505 emit_modrm( p, dst, src ); in sse_minps()
508 void sse_subps( struct x86_function *p, in sse_subps() argument
512 emit_2ub(p, X86_TWOB, 0x5C); in sse_subps()
513 emit_modrm( p, dst, src ); in sse_subps()
516 void sse_mulps( struct x86_function *p, in sse_mulps() argument
520 emit_2ub(p, X86_TWOB, 0x59); in sse_mulps()
521 emit_modrm( p, dst, src ); in sse_mulps()
524 void sse_mulss( struct x86_function *p, in sse_mulss() argument
528 emit_3ub(p, 0xF3, X86_TWOB, 0x59); in sse_mulss()
529 emit_modrm( p, dst, src ); in sse_mulss()
532 void sse_addps( struct x86_function *p, in sse_addps() argument
536 emit_2ub(p, X86_TWOB, 0x58); in sse_addps()
537 emit_modrm( p, dst, src ); in sse_addps()
540 void sse_addss( struct x86_function *p, in sse_addss() argument
544 emit_3ub(p, 0xF3, X86_TWOB, 0x58); in sse_addss()
545 emit_modrm( p, dst, src ); in sse_addss()
548 void sse_andnps( struct x86_function *p, in sse_andnps() argument
552 emit_2ub(p, X86_TWOB, 0x55); in sse_andnps()
553 emit_modrm( p, dst, src ); in sse_andnps()
556 void sse_andps( struct x86_function *p, in sse_andps() argument
560 emit_2ub(p, X86_TWOB, 0x54); in sse_andps()
561 emit_modrm( p, dst, src ); in sse_andps()
564 void sse_rsqrtps( struct x86_function *p, in sse_rsqrtps() argument
568 emit_2ub(p, X86_TWOB, 0x52); in sse_rsqrtps()
569 emit_modrm( p, dst, src ); in sse_rsqrtps()
572 void sse_rsqrtss( struct x86_function *p, in sse_rsqrtss() argument
576 emit_3ub(p, 0xF3, X86_TWOB, 0x52); in sse_rsqrtss()
577 emit_modrm( p, dst, src ); in sse_rsqrtss()
581 void sse_movhlps( struct x86_function *p, in sse_movhlps() argument
586 emit_2ub(p, X86_TWOB, 0x12); in sse_movhlps()
587 emit_modrm( p, dst, src ); in sse_movhlps()
590 void sse_movlhps( struct x86_function *p, in sse_movlhps() argument
595 emit_2ub(p, X86_TWOB, 0x16); in sse_movlhps()
596 emit_modrm( p, dst, src ); in sse_movlhps()
599 void sse_orps( struct x86_function *p, in sse_orps() argument
603 emit_2ub(p, X86_TWOB, 0x56); in sse_orps()
604 emit_modrm( p, dst, src ); in sse_orps()
607 void sse_xorps( struct x86_function *p, in sse_xorps() argument
611 emit_2ub(p, X86_TWOB, 0x57); in sse_xorps()
612 emit_modrm( p, dst, src ); in sse_xorps()
615 void sse_cvtps2pi( struct x86_function *p, in sse_cvtps2pi() argument
622 p->need_emms = 1; in sse_cvtps2pi()
624 emit_2ub(p, X86_TWOB, 0x2d); in sse_cvtps2pi()
625 emit_modrm( p, dst, src ); in sse_cvtps2pi()
632 void sse_shufps( struct x86_function *p, in sse_shufps() argument
637 emit_2ub(p, X86_TWOB, 0xC6); in sse_shufps()
638 emit_modrm(p, dest, arg0); in sse_shufps()
639 emit_1ub(p, shuf); in sse_shufps()
642 void sse_cmpps( struct x86_function *p, in sse_cmpps() argument
647 emit_2ub(p, X86_TWOB, 0xC2); in sse_cmpps()
648 emit_modrm(p, dest, arg0); in sse_cmpps()
649 emit_1ub(p, cc); in sse_cmpps()
652 void sse_pmovmskb( struct x86_function *p, in sse_pmovmskb() argument
656 emit_3ub(p, 0x66, X86_TWOB, 0xD7); in sse_pmovmskb()
657 emit_modrm(p, dest, src); in sse_pmovmskb()
667 void sse2_pshufd( struct x86_function *p, in sse2_pshufd() argument
672 emit_3ub(p, 0x66, X86_TWOB, 0x70); in sse2_pshufd()
673 emit_modrm(p, dest, arg0); in sse2_pshufd()
674 emit_1ub(p, shuf); in sse2_pshufd()
677 void sse2_cvttps2dq( struct x86_function *p, in sse2_cvttps2dq() argument
681 emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); in sse2_cvttps2dq()
682 emit_modrm( p, dst, src ); in sse2_cvttps2dq()
685 void sse2_cvtps2dq( struct x86_function *p, in sse2_cvtps2dq() argument
689 emit_3ub(p, 0x66, X86_TWOB, 0x5B); in sse2_cvtps2dq()
690 emit_modrm( p, dst, src ); in sse2_cvtps2dq()
693 void sse2_packssdw( struct x86_function *p, in sse2_packssdw() argument
697 emit_3ub(p, 0x66, X86_TWOB, 0x6B); in sse2_packssdw()
698 emit_modrm( p, dst, src ); in sse2_packssdw()
701 void sse2_packsswb( struct x86_function *p, in sse2_packsswb() argument
705 emit_3ub(p, 0x66, X86_TWOB, 0x63); in sse2_packsswb()
706 emit_modrm( p, dst, src ); in sse2_packsswb()
709 void sse2_packuswb( struct x86_function *p, in sse2_packuswb() argument
713 emit_3ub(p, 0x66, X86_TWOB, 0x67); in sse2_packuswb()
714 emit_modrm( p, dst, src ); in sse2_packuswb()
717 void sse2_rcpps( struct x86_function *p, in sse2_rcpps() argument
721 emit_2ub(p, X86_TWOB, 0x53); in sse2_rcpps()
722 emit_modrm( p, dst, src ); in sse2_rcpps()
725 void sse2_rcpss( struct x86_function *p, in sse2_rcpss() argument
729 emit_3ub(p, 0xF3, X86_TWOB, 0x53); in sse2_rcpss()
730 emit_modrm( p, dst, src ); in sse2_rcpss()
733 void sse2_movd( struct x86_function *p, in sse2_movd() argument
737 emit_2ub(p, 0x66, X86_TWOB); in sse2_movd()
738 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in sse2_movd()
747 void x87_fist( struct x86_function *p, struct x86_reg dst ) in x87_fist() argument
749 emit_1ub(p, 0xdb); in x87_fist()
750 emit_modrm_noreg(p, 2, dst); in x87_fist()
753 void x87_fistp( struct x86_function *p, struct x86_reg dst ) in x87_fistp() argument
755 emit_1ub(p, 0xdb); in x87_fistp()
756 emit_modrm_noreg(p, 3, dst); in x87_fistp()
759 void x87_fild( struct x86_function *p, struct x86_reg arg ) in x87_fild() argument
761 emit_1ub(p, 0xdf); in x87_fild()
762 emit_modrm_noreg(p, 0, arg); in x87_fild()
765 void x87_fldz( struct x86_function *p ) in x87_fldz() argument
767 emit_2ub(p, 0xd9, 0xee); in x87_fldz()
771 void x87_fldcw( struct x86_function *p, struct x86_reg arg ) in x87_fldcw() argument
775 emit_1ub(p, 0xd9); in x87_fldcw()
776 emit_modrm_noreg(p, 5, arg); in x87_fldcw()
779 void x87_fld1( struct x86_function *p ) in x87_fld1() argument
781 emit_2ub(p, 0xd9, 0xe8); in x87_fld1()
784 void x87_fldl2e( struct x86_function *p ) in x87_fldl2e() argument
786 emit_2ub(p, 0xd9, 0xea); in x87_fldl2e()
789 void x87_fldln2( struct x86_function *p ) in x87_fldln2() argument
791 emit_2ub(p, 0xd9, 0xed); in x87_fldln2()
794 void x87_fwait( struct x86_function *p ) in x87_fwait() argument
796 emit_1ub(p, 0x9b); in x87_fwait()
799 void x87_fnclex( struct x86_function *p ) in x87_fnclex() argument
801 emit_2ub(p, 0xdb, 0xe2); in x87_fnclex()
804 void x87_fclex( struct x86_function *p ) in x87_fclex() argument
806 x87_fwait(p); in x87_fclex()
807 x87_fnclex(p); in x87_fclex()
811 static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, in x87_arith_op() argument
822 emit_2ub(p, dst0ub0, dst0ub1+arg.idx); in x87_arith_op()
824 emit_2ub(p, arg0ub0, arg0ub1+arg.idx); in x87_arith_op()
830 emit_1ub(p, 0xd8); in x87_arith_op()
831 emit_modrm_noreg(p, argmem_noreg, arg); in x87_arith_op()
837 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fmul() argument
839 x87_arith_op(p, dst, arg, in x87_fmul()
845 void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsub() argument
847 x87_arith_op(p, dst, arg, in x87_fsub()
853 void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsubr() argument
855 x87_arith_op(p, dst, arg, in x87_fsubr()
861 void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fadd() argument
863 x87_arith_op(p, dst, arg, in x87_fadd()
869 void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdiv() argument
871 x87_arith_op(p, dst, arg, in x87_fdiv()
877 void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdivr() argument
879 x87_arith_op(p, dst, arg, in x87_fdivr()
885 void x87_fmulp( struct x86_function *p, struct x86_reg dst ) in x87_fmulp() argument
889 emit_2ub(p, 0xde, 0xc8+dst.idx); in x87_fmulp()
892 void x87_fsubp( struct x86_function *p, struct x86_reg dst ) in x87_fsubp() argument
896 emit_2ub(p, 0xde, 0xe8+dst.idx); in x87_fsubp()
899 void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) in x87_fsubrp() argument
903 emit_2ub(p, 0xde, 0xe0+dst.idx); in x87_fsubrp()
906 void x87_faddp( struct x86_function *p, struct x86_reg dst ) in x87_faddp() argument
910 emit_2ub(p, 0xde, 0xc0+dst.idx); in x87_faddp()
913 void x87_fdivp( struct x86_function *p, struct x86_reg dst ) in x87_fdivp() argument
917 emit_2ub(p, 0xde, 0xf8+dst.idx); in x87_fdivp()
920 void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) in x87_fdivrp() argument
924 emit_2ub(p, 0xde, 0xf0+dst.idx); in x87_fdivrp()
927 void x87_fucom( struct x86_function *p, struct x86_reg arg ) in x87_fucom() argument
930 emit_2ub(p, 0xdd, 0xe0+arg.idx); in x87_fucom()
933 void x87_fucomp( struct x86_function *p, struct x86_reg arg ) in x87_fucomp() argument
936 emit_2ub(p, 0xdd, 0xe8+arg.idx); in x87_fucomp()
939 void x87_fucompp( struct x86_function *p ) in x87_fucompp() argument
941 emit_2ub(p, 0xda, 0xe9); in x87_fucompp()
944 void x87_fxch( struct x86_function *p, struct x86_reg arg ) in x87_fxch() argument
947 emit_2ub(p, 0xd9, 0xc8+arg.idx); in x87_fxch()
950 void x87_fabs( struct x86_function *p ) in x87_fabs() argument
952 emit_2ub(p, 0xd9, 0xe1); in x87_fabs()
955 void x87_fchs( struct x86_function *p ) in x87_fchs() argument
957 emit_2ub(p, 0xd9, 0xe0); in x87_fchs()
960 void x87_fcos( struct x86_function *p ) in x87_fcos() argument
962 emit_2ub(p, 0xd9, 0xff); in x87_fcos()
966 void x87_fprndint( struct x86_function *p ) in x87_fprndint() argument
968 emit_2ub(p, 0xd9, 0xfc); in x87_fprndint()
971 void x87_fscale( struct x86_function *p ) in x87_fscale() argument
973 emit_2ub(p, 0xd9, 0xfd); in x87_fscale()
976 void x87_fsin( struct x86_function *p ) in x87_fsin() argument
978 emit_2ub(p, 0xd9, 0xfe); in x87_fsin()
981 void x87_fsincos( struct x86_function *p ) in x87_fsincos() argument
983 emit_2ub(p, 0xd9, 0xfb); in x87_fsincos()
986 void x87_fsqrt( struct x86_function *p ) in x87_fsqrt() argument
988 emit_2ub(p, 0xd9, 0xfa); in x87_fsqrt()
991 void x87_fxtract( struct x86_function *p ) in x87_fxtract() argument
993 emit_2ub(p, 0xd9, 0xf4); in x87_fxtract()
1000 void x87_f2xm1( struct x86_function *p ) in x87_f2xm1() argument
1002 emit_2ub(p, 0xd9, 0xf0); in x87_f2xm1()
1008 void x87_fyl2x( struct x86_function *p ) in x87_fyl2x() argument
1010 emit_2ub(p, 0xd9, 0xf1); in x87_fyl2x()
1018 void x87_fyl2xp1( struct x86_function *p ) in x87_fyl2xp1() argument
1020 emit_2ub(p, 0xd9, 0xf9); in x87_fyl2xp1()
1024 void x87_fld( struct x86_function *p, struct x86_reg arg ) in x87_fld() argument
1027 emit_2ub(p, 0xd9, 0xc0 + arg.idx); in x87_fld()
1029 emit_1ub(p, 0xd9); in x87_fld()
1030 emit_modrm_noreg(p, 0, arg); in x87_fld()
1034 void x87_fst( struct x86_function *p, struct x86_reg dst ) in x87_fst() argument
1037 emit_2ub(p, 0xdd, 0xd0 + dst.idx); in x87_fst()
1039 emit_1ub(p, 0xd9); in x87_fst()
1040 emit_modrm_noreg(p, 2, dst); in x87_fst()
1044 void x87_fstp( struct x86_function *p, struct x86_reg dst ) in x87_fstp() argument
1047 emit_2ub(p, 0xdd, 0xd8 + dst.idx); in x87_fstp()
1049 emit_1ub(p, 0xd9); in x87_fstp()
1050 emit_modrm_noreg(p, 3, dst); in x87_fstp()
1054 void x87_fcom( struct x86_function *p, struct x86_reg dst ) in x87_fcom() argument
1057 emit_2ub(p, 0xd8, 0xd0 + dst.idx); in x87_fcom()
1059 emit_1ub(p, 0xd8); in x87_fcom()
1060 emit_modrm_noreg(p, 2, dst); in x87_fcom()
1064 void x87_fcomp( struct x86_function *p, struct x86_reg dst ) in x87_fcomp() argument
1067 emit_2ub(p, 0xd8, 0xd8 + dst.idx); in x87_fcomp()
1069 emit_1ub(p, 0xd8); in x87_fcomp()
1070 emit_modrm_noreg(p, 3, dst); in x87_fcomp()
1075 void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) in x87_fnstsw() argument
1081 emit_2ub(p, 0xdf, 0xe0); in x87_fnstsw()
1083 emit_1ub(p, 0xdd); in x87_fnstsw()
1084 emit_modrm_noreg(p, 7, dst); in x87_fnstsw()
1095 void mmx_emms( struct x86_function *p ) in mmx_emms() argument
1097 assert(p->need_emms); in mmx_emms()
1098 emit_2ub(p, 0x0f, 0x77); in mmx_emms()
1099 p->need_emms = 0; in mmx_emms()
1102 void mmx_packssdw( struct x86_function *p, in mmx_packssdw() argument
1109 p->need_emms = 1; in mmx_packssdw()
1111 emit_2ub(p, X86_TWOB, 0x6b); in mmx_packssdw()
1112 emit_modrm( p, dst, src ); in mmx_packssdw()
1115 void mmx_packuswb( struct x86_function *p, in mmx_packuswb() argument
1122 p->need_emms = 1; in mmx_packuswb()
1124 emit_2ub(p, X86_TWOB, 0x67); in mmx_packuswb()
1125 emit_modrm( p, dst, src ); in mmx_packuswb()
1128 void mmx_movd( struct x86_function *p, in mmx_movd() argument
1132 p->need_emms = 1; in mmx_movd()
1133 emit_1ub(p, X86_TWOB); in mmx_movd()
1134 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in mmx_movd()
1137 void mmx_movq( struct x86_function *p, in mmx_movq() argument
1141 p->need_emms = 1; in mmx_movq()
1142 emit_1ub(p, X86_TWOB); in mmx_movq()
1143 emit_op_modrm( p, 0x6f, 0x7f, dst, src ); in mmx_movq()
1155 struct x86_reg x86_fn_arg( struct x86_function *p, in x86_fn_arg() argument
1159 p->stack_offset + arg * 4); /* ??? */ in x86_fn_arg()
1163 void x86_init_func( struct x86_function *p ) in x86_init_func() argument
1165 p->size = 0; in x86_init_func()
1166 p->store = NULL; in x86_init_func()
1167 p->csr = p->store; in x86_init_func()
1170 int x86_init_func_size( struct x86_function *p, unsigned code_size ) in x86_init_func_size() argument
1172 p->size = code_size; in x86_init_func_size()
1173 p->store = _mesa_exec_malloc(code_size); in x86_init_func_size()
1174 p->csr = p->store; in x86_init_func_size()
1175 return p->store != NULL; in x86_init_func_size()
1178 void x86_release_func( struct x86_function *p ) in x86_release_func() argument
1180 _mesa_exec_free(p->store); in x86_release_func()
1181 p->store = NULL; in x86_release_func()
1182 p->csr = NULL; in x86_release_func()
1183 p->size = 0; in x86_release_func()
1187 void (*x86_get_func( struct x86_function *p ))(void) in x86_get_func() argument
1189 if (DISASSEM && p->store) in x86_get_func()
1190 printf("disassemble %p %p\n", p->store, p->csr); in x86_get_func()
1191 return (void (*)(void)) (unsigned long) p->store; in x86_get_func()