• Home
  • Raw
  • Download

Lines Matching refs:p

22 static void do_realloc( struct x86_function *p )  in do_realloc()  argument
24 if (p->size == 0) { in do_realloc()
25 p->size = 1024; in do_realloc()
26 p->store = _mesa_exec_malloc(p->size); in do_realloc()
27 p->csr = p->store; in do_realloc()
30 unsigned used = p->csr - p->store; in do_realloc()
31 unsigned char *tmp = p->store; in do_realloc()
32 p->size *= 2; in do_realloc()
33 p->store = _mesa_exec_malloc(p->size); in do_realloc()
34 memcpy(p->store, tmp, used); in do_realloc()
35 p->csr = p->store + used; in do_realloc()
42 static unsigned char *reserve( struct x86_function *p, int bytes ) in reserve() argument
44 if (p->csr + bytes - p->store > p->size) in reserve()
45 do_realloc(p); in reserve()
48 unsigned char *csr = p->csr; in reserve()
49 p->csr += bytes; in reserve()
56 static void emit_1b( struct x86_function *p, char b0 ) in emit_1b() argument
58 char *csr = (char *)reserve(p, 1); in emit_1b()
62 static void emit_1i( struct x86_function *p, int i0 ) in emit_1i() argument
64 int *icsr = (int *)reserve(p, sizeof(i0)); in emit_1i()
68 static void emit_1ub( struct x86_function *p, unsigned char b0 ) in emit_1ub() argument
70 unsigned char *csr = reserve(p, 1); in emit_1ub()
74 static void emit_2ub( struct x86_function *p, unsigned char b0, unsigned char b1 ) in emit_2ub() argument
76 unsigned char *csr = reserve(p, 2); in emit_2ub()
81 static void emit_3ub( struct x86_function *p, unsigned char b0, unsigned char b1, unsigned char b2 ) in emit_3ub() argument
83 unsigned char *csr = reserve(p, 3); in emit_3ub()
93 static void emit_modrm( struct x86_function *p, in emit_modrm() argument
105 emit_1ub(p, val); in emit_modrm()
111 emit_1ub(p, 0x24); /* simplistic! */ in emit_modrm()
119 emit_1b(p, regmem.disp); in emit_modrm()
122 emit_1i(p, regmem.disp); in emit_modrm()
131 static void emit_modrm_noreg( struct x86_function *p, in emit_modrm_noreg() argument
136 emit_modrm(p, dummy, regmem); in emit_modrm_noreg()
144 static void emit_op_modrm( struct x86_function *p, in emit_op_modrm() argument
152 emit_1ub(p, op_dst_is_reg); in emit_op_modrm()
153 emit_modrm(p, dst, src); in emit_op_modrm()
159 emit_1ub(p, op_dst_is_mem); in emit_op_modrm()
160 emit_modrm(p, src, dst); in emit_op_modrm()
219 unsigned char *x86_get_label( struct x86_function *p ) in x86_get_label() argument
221 return p->csr; in x86_get_label()
231 void x86_jcc( struct x86_function *p, in x86_jcc() argument
235 int offset = label - (x86_get_label(p) + 2); in x86_jcc()
238 emit_1ub(p, 0x70 + cc); in x86_jcc()
239 emit_1b(p, (char) offset); in x86_jcc()
242 offset = label - (x86_get_label(p) + 6); in x86_jcc()
243 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc()
244 emit_1i(p, offset); in x86_jcc()
250 unsigned char *x86_jcc_forward( struct x86_function *p, in x86_jcc_forward() argument
253 emit_2ub(p, 0x0f, 0x80 + cc); in x86_jcc_forward()
254 emit_1i(p, 0); in x86_jcc_forward()
255 return x86_get_label(p); in x86_jcc_forward()
258 unsigned char *x86_jmp_forward( struct x86_function *p) in x86_jmp_forward() argument
260 emit_1ub(p, 0xe9); in x86_jmp_forward()
261 emit_1i(p, 0); in x86_jmp_forward()
262 return x86_get_label(p); in x86_jmp_forward()
265 unsigned char *x86_call_forward( struct x86_function *p) in x86_call_forward() argument
267 emit_1ub(p, 0xe8); in x86_call_forward()
268 emit_1i(p, 0); in x86_call_forward()
269 return x86_get_label(p); in x86_call_forward()
274 void x86_fixup_fwd_jump( struct x86_function *p, in x86_fixup_fwd_jump() argument
277 *(int *)(fixup - 4) = x86_get_label(p) - fixup; in x86_fixup_fwd_jump()
280 void x86_jmp( struct x86_function *p, unsigned char *label) in x86_jmp() argument
282 emit_1ub(p, 0xe9); in x86_jmp()
283 emit_1i(p, label - x86_get_label(p) - 4); in x86_jmp()
291 void x86_call( struct x86_function *p, void (*label)())
293 emit_1ub(p, 0xe8);
294 emit_1i(p, cptr(label) - x86_get_label(p) - 4);
297 void x86_call( struct x86_function *p, struct x86_reg reg) in x86_call() argument
299 emit_1ub(p, 0xff); in x86_call()
300 emit_modrm_noreg(p, 2, reg); in x86_call()
309 void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) in x86_mov_reg_imm() argument
312 emit_1ub(p, 0xb8 + dst.idx); in x86_mov_reg_imm()
313 emit_1i(p, imm); in x86_mov_reg_imm()
316 void x86_push( struct x86_function *p, in x86_push() argument
320 emit_1ub(p, 0x50 + reg.idx); in x86_push()
321 p->stack_offset += 4; in x86_push()
324 void x86_pop( struct x86_function *p, in x86_pop() argument
328 emit_1ub(p, 0x58 + reg.idx); in x86_pop()
329 p->stack_offset -= 4; in x86_pop()
332 void x86_inc( struct x86_function *p, in x86_inc() argument
336 emit_1ub(p, 0x40 + reg.idx); in x86_inc()
339 void x86_dec( struct x86_function *p, in x86_dec() argument
343 emit_1ub(p, 0x48 + reg.idx); in x86_dec()
346 void x86_ret( struct x86_function *p ) in x86_ret() argument
348 emit_1ub(p, 0xc3); in x86_ret()
351 void x86_sahf( struct x86_function *p ) in x86_sahf() argument
353 emit_1ub(p, 0x9e); in x86_sahf()
356 void x86_mov( struct x86_function *p, in x86_mov() argument
360 emit_op_modrm( p, 0x8b, 0x89, dst, src ); in x86_mov()
363 void x86_xor( struct x86_function *p, in x86_xor() argument
367 emit_op_modrm( p, 0x33, 0x31, dst, src ); in x86_xor()
370 void x86_cmp( struct x86_function *p, in x86_cmp() argument
374 emit_op_modrm( p, 0x3b, 0x39, dst, src ); in x86_cmp()
377 void x86_lea( struct x86_function *p, in x86_lea() argument
381 emit_1ub(p, 0x8d); in x86_lea()
382 emit_modrm( p, dst, src ); in x86_lea()
385 void x86_test( struct x86_function *p, in x86_test() argument
389 emit_1ub(p, 0x85); in x86_test()
390 emit_modrm( p, dst, src ); in x86_test()
393 void x86_add( struct x86_function *p, in x86_add() argument
397 emit_op_modrm(p, 0x03, 0x01, dst, src ); in x86_add()
400 void x86_mul( struct x86_function *p, in x86_mul() argument
404 emit_op_modrm(p, 0xf7, 0, x86_make_reg (file_REG32, reg_SP), src ); in x86_mul()
407 void x86_sub( struct x86_function *p, in x86_sub() argument
411 emit_op_modrm(p, 0x2b, 0x29, dst, src ); in x86_sub()
414 void x86_or( struct x86_function *p, in x86_or() argument
418 emit_op_modrm( p, 0x0b, 0x09, dst, src ); in x86_or()
421 void x86_and( struct x86_function *p, in x86_and() argument
425 emit_op_modrm( p, 0x23, 0x21, dst, src ); in x86_and()
435 void sse_movss( struct x86_function *p, in sse_movss() argument
439 emit_2ub(p, 0xF3, X86_TWOB); in sse_movss()
440 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movss()
443 void sse_movaps( struct x86_function *p, in sse_movaps() argument
447 emit_1ub(p, X86_TWOB); in sse_movaps()
448 emit_op_modrm( p, 0x28, 0x29, dst, src ); in sse_movaps()
451 void sse_movups( struct x86_function *p, in sse_movups() argument
455 emit_1ub(p, X86_TWOB); in sse_movups()
456 emit_op_modrm( p, 0x10, 0x11, dst, src ); in sse_movups()
459 void sse_movhps( struct x86_function *p, in sse_movhps() argument
464 emit_1ub(p, X86_TWOB); in sse_movhps()
465 emit_op_modrm( p, 0x16, 0x17, dst, src ); /* cf movlhps */ in sse_movhps()
468 void sse_movlps( struct x86_function *p, in sse_movlps() argument
473 emit_1ub(p, X86_TWOB); in sse_movlps()
474 emit_op_modrm( p, 0x12, 0x13, dst, src ); /* cf movhlps */ in sse_movlps()
477 void sse_maxps( struct x86_function *p, in sse_maxps() argument
481 emit_2ub(p, X86_TWOB, 0x5F); in sse_maxps()
482 emit_modrm( p, dst, src ); in sse_maxps()
485 void sse_maxss( struct x86_function *p, in sse_maxss() argument
489 emit_3ub(p, 0xF3, X86_TWOB, 0x5F); in sse_maxss()
490 emit_modrm( p, dst, src ); in sse_maxss()
493 void sse_divss( struct x86_function *p, in sse_divss() argument
497 emit_3ub(p, 0xF3, X86_TWOB, 0x5E); in sse_divss()
498 emit_modrm( p, dst, src ); in sse_divss()
501 void sse_minps( struct x86_function *p, in sse_minps() argument
505 emit_2ub(p, X86_TWOB, 0x5D); in sse_minps()
506 emit_modrm( p, dst, src ); in sse_minps()
509 void sse_subps( struct x86_function *p, in sse_subps() argument
513 emit_2ub(p, X86_TWOB, 0x5C); in sse_subps()
514 emit_modrm( p, dst, src ); in sse_subps()
517 void sse_mulps( struct x86_function *p, in sse_mulps() argument
521 emit_2ub(p, X86_TWOB, 0x59); in sse_mulps()
522 emit_modrm( p, dst, src ); in sse_mulps()
525 void sse_mulss( struct x86_function *p, in sse_mulss() argument
529 emit_3ub(p, 0xF3, X86_TWOB, 0x59); in sse_mulss()
530 emit_modrm( p, dst, src ); in sse_mulss()
533 void sse_addps( struct x86_function *p, in sse_addps() argument
537 emit_2ub(p, X86_TWOB, 0x58); in sse_addps()
538 emit_modrm( p, dst, src ); in sse_addps()
541 void sse_addss( struct x86_function *p, in sse_addss() argument
545 emit_3ub(p, 0xF3, X86_TWOB, 0x58); in sse_addss()
546 emit_modrm( p, dst, src ); in sse_addss()
549 void sse_andnps( struct x86_function *p, in sse_andnps() argument
553 emit_2ub(p, X86_TWOB, 0x55); in sse_andnps()
554 emit_modrm( p, dst, src ); in sse_andnps()
557 void sse_andps( struct x86_function *p, in sse_andps() argument
561 emit_2ub(p, X86_TWOB, 0x54); in sse_andps()
562 emit_modrm( p, dst, src ); in sse_andps()
565 void sse_rsqrtps( struct x86_function *p, in sse_rsqrtps() argument
569 emit_2ub(p, X86_TWOB, 0x52); in sse_rsqrtps()
570 emit_modrm( p, dst, src ); in sse_rsqrtps()
573 void sse_rsqrtss( struct x86_function *p, in sse_rsqrtss() argument
577 emit_3ub(p, 0xF3, X86_TWOB, 0x52); in sse_rsqrtss()
578 emit_modrm( p, dst, src ); in sse_rsqrtss()
582 void sse_movhlps( struct x86_function *p, in sse_movhlps() argument
587 emit_2ub(p, X86_TWOB, 0x12); in sse_movhlps()
588 emit_modrm( p, dst, src ); in sse_movhlps()
591 void sse_movlhps( struct x86_function *p, in sse_movlhps() argument
596 emit_2ub(p, X86_TWOB, 0x16); in sse_movlhps()
597 emit_modrm( p, dst, src ); in sse_movlhps()
600 void sse_orps( struct x86_function *p, in sse_orps() argument
604 emit_2ub(p, X86_TWOB, 0x56); in sse_orps()
605 emit_modrm( p, dst, src ); in sse_orps()
608 void sse_xorps( struct x86_function *p, in sse_xorps() argument
612 emit_2ub(p, X86_TWOB, 0x57); in sse_xorps()
613 emit_modrm( p, dst, src ); in sse_xorps()
616 void sse_cvtps2pi( struct x86_function *p, in sse_cvtps2pi() argument
623 p->need_emms = 1; in sse_cvtps2pi()
625 emit_2ub(p, X86_TWOB, 0x2d); in sse_cvtps2pi()
626 emit_modrm( p, dst, src ); in sse_cvtps2pi()
633 void sse_shufps( struct x86_function *p, in sse_shufps() argument
638 emit_2ub(p, X86_TWOB, 0xC6); in sse_shufps()
639 emit_modrm(p, dest, arg0); in sse_shufps()
640 emit_1ub(p, shuf); in sse_shufps()
643 void sse_cmpps( struct x86_function *p, in sse_cmpps() argument
648 emit_2ub(p, X86_TWOB, 0xC2); in sse_cmpps()
649 emit_modrm(p, dest, arg0); in sse_cmpps()
650 emit_1ub(p, cc); in sse_cmpps()
653 void sse_pmovmskb( struct x86_function *p, in sse_pmovmskb() argument
657 emit_3ub(p, 0x66, X86_TWOB, 0xD7); in sse_pmovmskb()
658 emit_modrm(p, dest, src); in sse_pmovmskb()
668 void sse2_pshufd( struct x86_function *p, in sse2_pshufd() argument
673 emit_3ub(p, 0x66, X86_TWOB, 0x70); in sse2_pshufd()
674 emit_modrm(p, dest, arg0); in sse2_pshufd()
675 emit_1ub(p, shuf); in sse2_pshufd()
678 void sse2_cvttps2dq( struct x86_function *p, in sse2_cvttps2dq() argument
682 emit_3ub( p, 0xF3, X86_TWOB, 0x5B ); in sse2_cvttps2dq()
683 emit_modrm( p, dst, src ); in sse2_cvttps2dq()
686 void sse2_cvtps2dq( struct x86_function *p, in sse2_cvtps2dq() argument
690 emit_3ub(p, 0x66, X86_TWOB, 0x5B); in sse2_cvtps2dq()
691 emit_modrm( p, dst, src ); in sse2_cvtps2dq()
694 void sse2_packssdw( struct x86_function *p, in sse2_packssdw() argument
698 emit_3ub(p, 0x66, X86_TWOB, 0x6B); in sse2_packssdw()
699 emit_modrm( p, dst, src ); in sse2_packssdw()
702 void sse2_packsswb( struct x86_function *p, in sse2_packsswb() argument
706 emit_3ub(p, 0x66, X86_TWOB, 0x63); in sse2_packsswb()
707 emit_modrm( p, dst, src ); in sse2_packsswb()
710 void sse2_packuswb( struct x86_function *p, in sse2_packuswb() argument
714 emit_3ub(p, 0x66, X86_TWOB, 0x67); in sse2_packuswb()
715 emit_modrm( p, dst, src ); in sse2_packuswb()
718 void sse2_rcpps( struct x86_function *p, in sse2_rcpps() argument
722 emit_2ub(p, X86_TWOB, 0x53); in sse2_rcpps()
723 emit_modrm( p, dst, src ); in sse2_rcpps()
726 void sse2_rcpss( struct x86_function *p, in sse2_rcpss() argument
730 emit_3ub(p, 0xF3, X86_TWOB, 0x53); in sse2_rcpss()
731 emit_modrm( p, dst, src ); in sse2_rcpss()
734 void sse2_movd( struct x86_function *p, in sse2_movd() argument
738 emit_2ub(p, 0x66, X86_TWOB); in sse2_movd()
739 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in sse2_movd()
748 void x87_fist( struct x86_function *p, struct x86_reg dst ) in x87_fist() argument
750 emit_1ub(p, 0xdb); in x87_fist()
751 emit_modrm_noreg(p, 2, dst); in x87_fist()
754 void x87_fistp( struct x86_function *p, struct x86_reg dst ) in x87_fistp() argument
756 emit_1ub(p, 0xdb); in x87_fistp()
757 emit_modrm_noreg(p, 3, dst); in x87_fistp()
760 void x87_fild( struct x86_function *p, struct x86_reg arg ) in x87_fild() argument
762 emit_1ub(p, 0xdf); in x87_fild()
763 emit_modrm_noreg(p, 0, arg); in x87_fild()
766 void x87_fldz( struct x86_function *p ) in x87_fldz() argument
768 emit_2ub(p, 0xd9, 0xee); in x87_fldz()
772 void x87_fldcw( struct x86_function *p, struct x86_reg arg ) in x87_fldcw() argument
776 emit_1ub(p, 0xd9); in x87_fldcw()
777 emit_modrm_noreg(p, 5, arg); in x87_fldcw()
780 void x87_fld1( struct x86_function *p ) in x87_fld1() argument
782 emit_2ub(p, 0xd9, 0xe8); in x87_fld1()
785 void x87_fldl2e( struct x86_function *p ) in x87_fldl2e() argument
787 emit_2ub(p, 0xd9, 0xea); in x87_fldl2e()
790 void x87_fldln2( struct x86_function *p ) in x87_fldln2() argument
792 emit_2ub(p, 0xd9, 0xed); in x87_fldln2()
795 void x87_fwait( struct x86_function *p ) in x87_fwait() argument
797 emit_1ub(p, 0x9b); in x87_fwait()
800 void x87_fnclex( struct x86_function *p ) in x87_fnclex() argument
802 emit_2ub(p, 0xdb, 0xe2); in x87_fnclex()
805 void x87_fclex( struct x86_function *p ) in x87_fclex() argument
807 x87_fwait(p); in x87_fclex()
808 x87_fnclex(p); in x87_fclex()
812 static void x87_arith_op( struct x86_function *p, struct x86_reg dst, struct x86_reg arg, in x87_arith_op() argument
823 emit_2ub(p, dst0ub0, dst0ub1+arg.idx); in x87_arith_op()
825 emit_2ub(p, arg0ub0, arg0ub1+arg.idx); in x87_arith_op()
831 emit_1ub(p, 0xd8); in x87_arith_op()
832 emit_modrm_noreg(p, argmem_noreg, arg); in x87_arith_op()
838 void x87_fmul( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fmul() argument
840 x87_arith_op(p, dst, arg, in x87_fmul()
846 void x87_fsub( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsub() argument
848 x87_arith_op(p, dst, arg, in x87_fsub()
854 void x87_fsubr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fsubr() argument
856 x87_arith_op(p, dst, arg, in x87_fsubr()
862 void x87_fadd( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fadd() argument
864 x87_arith_op(p, dst, arg, in x87_fadd()
870 void x87_fdiv( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdiv() argument
872 x87_arith_op(p, dst, arg, in x87_fdiv()
878 void x87_fdivr( struct x86_function *p, struct x86_reg dst, struct x86_reg arg ) in x87_fdivr() argument
880 x87_arith_op(p, dst, arg, in x87_fdivr()
886 void x87_fmulp( struct x86_function *p, struct x86_reg dst ) in x87_fmulp() argument
890 emit_2ub(p, 0xde, 0xc8+dst.idx); in x87_fmulp()
893 void x87_fsubp( struct x86_function *p, struct x86_reg dst ) in x87_fsubp() argument
897 emit_2ub(p, 0xde, 0xe8+dst.idx); in x87_fsubp()
900 void x87_fsubrp( struct x86_function *p, struct x86_reg dst ) in x87_fsubrp() argument
904 emit_2ub(p, 0xde, 0xe0+dst.idx); in x87_fsubrp()
907 void x87_faddp( struct x86_function *p, struct x86_reg dst ) in x87_faddp() argument
911 emit_2ub(p, 0xde, 0xc0+dst.idx); in x87_faddp()
914 void x87_fdivp( struct x86_function *p, struct x86_reg dst ) in x87_fdivp() argument
918 emit_2ub(p, 0xde, 0xf8+dst.idx); in x87_fdivp()
921 void x87_fdivrp( struct x86_function *p, struct x86_reg dst ) in x87_fdivrp() argument
925 emit_2ub(p, 0xde, 0xf0+dst.idx); in x87_fdivrp()
928 void x87_fucom( struct x86_function *p, struct x86_reg arg ) in x87_fucom() argument
931 emit_2ub(p, 0xdd, 0xe0+arg.idx); in x87_fucom()
934 void x87_fucomp( struct x86_function *p, struct x86_reg arg ) in x87_fucomp() argument
937 emit_2ub(p, 0xdd, 0xe8+arg.idx); in x87_fucomp()
940 void x87_fucompp( struct x86_function *p ) in x87_fucompp() argument
942 emit_2ub(p, 0xda, 0xe9); in x87_fucompp()
945 void x87_fxch( struct x86_function *p, struct x86_reg arg ) in x87_fxch() argument
948 emit_2ub(p, 0xd9, 0xc8+arg.idx); in x87_fxch()
951 void x87_fabs( struct x86_function *p ) in x87_fabs() argument
953 emit_2ub(p, 0xd9, 0xe1); in x87_fabs()
956 void x87_fchs( struct x86_function *p ) in x87_fchs() argument
958 emit_2ub(p, 0xd9, 0xe0); in x87_fchs()
961 void x87_fcos( struct x86_function *p ) in x87_fcos() argument
963 emit_2ub(p, 0xd9, 0xff); in x87_fcos()
967 void x87_fprndint( struct x86_function *p ) in x87_fprndint() argument
969 emit_2ub(p, 0xd9, 0xfc); in x87_fprndint()
972 void x87_fscale( struct x86_function *p ) in x87_fscale() argument
974 emit_2ub(p, 0xd9, 0xfd); in x87_fscale()
977 void x87_fsin( struct x86_function *p ) in x87_fsin() argument
979 emit_2ub(p, 0xd9, 0xfe); in x87_fsin()
982 void x87_fsincos( struct x86_function *p ) in x87_fsincos() argument
984 emit_2ub(p, 0xd9, 0xfb); in x87_fsincos()
987 void x87_fsqrt( struct x86_function *p ) in x87_fsqrt() argument
989 emit_2ub(p, 0xd9, 0xfa); in x87_fsqrt()
992 void x87_fxtract( struct x86_function *p ) in x87_fxtract() argument
994 emit_2ub(p, 0xd9, 0xf4); in x87_fxtract()
1001 void x87_f2xm1( struct x86_function *p ) in x87_f2xm1() argument
1003 emit_2ub(p, 0xd9, 0xf0); in x87_f2xm1()
1009 void x87_fyl2x( struct x86_function *p ) in x87_fyl2x() argument
1011 emit_2ub(p, 0xd9, 0xf1); in x87_fyl2x()
1019 void x87_fyl2xp1( struct x86_function *p ) in x87_fyl2xp1() argument
1021 emit_2ub(p, 0xd9, 0xf9); in x87_fyl2xp1()
1025 void x87_fld( struct x86_function *p, struct x86_reg arg ) in x87_fld() argument
1028 emit_2ub(p, 0xd9, 0xc0 + arg.idx); in x87_fld()
1030 emit_1ub(p, 0xd9); in x87_fld()
1031 emit_modrm_noreg(p, 0, arg); in x87_fld()
1035 void x87_fst( struct x86_function *p, struct x86_reg dst ) in x87_fst() argument
1038 emit_2ub(p, 0xdd, 0xd0 + dst.idx); in x87_fst()
1040 emit_1ub(p, 0xd9); in x87_fst()
1041 emit_modrm_noreg(p, 2, dst); in x87_fst()
1045 void x87_fstp( struct x86_function *p, struct x86_reg dst ) in x87_fstp() argument
1048 emit_2ub(p, 0xdd, 0xd8 + dst.idx); in x87_fstp()
1050 emit_1ub(p, 0xd9); in x87_fstp()
1051 emit_modrm_noreg(p, 3, dst); in x87_fstp()
1055 void x87_fcom( struct x86_function *p, struct x86_reg dst ) in x87_fcom() argument
1058 emit_2ub(p, 0xd8, 0xd0 + dst.idx); in x87_fcom()
1060 emit_1ub(p, 0xd8); in x87_fcom()
1061 emit_modrm_noreg(p, 2, dst); in x87_fcom()
1065 void x87_fcomp( struct x86_function *p, struct x86_reg dst ) in x87_fcomp() argument
1068 emit_2ub(p, 0xd8, 0xd8 + dst.idx); in x87_fcomp()
1070 emit_1ub(p, 0xd8); in x87_fcomp()
1071 emit_modrm_noreg(p, 3, dst); in x87_fcomp()
1076 void x87_fnstsw( struct x86_function *p, struct x86_reg dst ) in x87_fnstsw() argument
1082 emit_2ub(p, 0xdf, 0xe0); in x87_fnstsw()
1084 emit_1ub(p, 0xdd); in x87_fnstsw()
1085 emit_modrm_noreg(p, 7, dst); in x87_fnstsw()
1096 void mmx_emms( struct x86_function *p ) in mmx_emms() argument
1098 assert(p->need_emms); in mmx_emms()
1099 emit_2ub(p, 0x0f, 0x77); in mmx_emms()
1100 p->need_emms = 0; in mmx_emms()
1103 void mmx_packssdw( struct x86_function *p, in mmx_packssdw() argument
1110 p->need_emms = 1; in mmx_packssdw()
1112 emit_2ub(p, X86_TWOB, 0x6b); in mmx_packssdw()
1113 emit_modrm( p, dst, src ); in mmx_packssdw()
1116 void mmx_packuswb( struct x86_function *p, in mmx_packuswb() argument
1123 p->need_emms = 1; in mmx_packuswb()
1125 emit_2ub(p, X86_TWOB, 0x67); in mmx_packuswb()
1126 emit_modrm( p, dst, src ); in mmx_packuswb()
1129 void mmx_movd( struct x86_function *p, in mmx_movd() argument
1133 p->need_emms = 1; in mmx_movd()
1134 emit_1ub(p, X86_TWOB); in mmx_movd()
1135 emit_op_modrm( p, 0x6e, 0x7e, dst, src ); in mmx_movd()
1138 void mmx_movq( struct x86_function *p, in mmx_movq() argument
1142 p->need_emms = 1; in mmx_movq()
1143 emit_1ub(p, X86_TWOB); in mmx_movq()
1144 emit_op_modrm( p, 0x6f, 0x7f, dst, src ); in mmx_movq()
1156 struct x86_reg x86_fn_arg( struct x86_function *p, in x86_fn_arg() argument
1160 p->stack_offset + arg * 4); /* ??? */ in x86_fn_arg()
1164 void x86_init_func( struct x86_function *p ) in x86_init_func() argument
1166 p->size = 0; in x86_init_func()
1167 p->store = NULL; in x86_init_func()
1168 p->csr = p->store; in x86_init_func()
1171 int x86_init_func_size( struct x86_function *p, unsigned code_size ) in x86_init_func_size() argument
1173 p->size = code_size; in x86_init_func_size()
1174 p->store = _mesa_exec_malloc(code_size); in x86_init_func_size()
1175 p->csr = p->store; in x86_init_func_size()
1176 return p->store != NULL; in x86_init_func_size()
1179 void x86_release_func( struct x86_function *p ) in x86_release_func() argument
1181 _mesa_exec_free(p->store); in x86_release_func()
1182 p->store = NULL; in x86_release_func()
1183 p->csr = NULL; in x86_release_func()
1184 p->size = 0; in x86_release_func()
1188 void (*x86_get_func( struct x86_function *p ))(void) in x86_get_func() argument
1190 if (DISASSEM && p->store) in x86_get_func()
1191 printf("disassemble %p %p\n", p->store, p->csr); in x86_get_func()
1192 return (void (*)(void)) (unsigned long) p->store; in x86_get_func()