.text
//  =======================================================================
//  void v_fsincos_f(float *s,float *c,float radians);
.align 4
.globl v_fsincos_f
v_fsincos_f:
	flds	12(%esp)
	fsincos
	movl	8(%esp), %eax
	movl	4(%esp), %edx
	fstps	(%eax)
	fstps	(%edx)
	ret
//	=======================================================================
//  void v_fsincos_d(double *s,double *c,double radians);
.align	4
.globl	v_fsincos_d
v_fsincos_d:
	fldl	12(%esp)
	fsincos
	movl	8(%esp), %eax
	movl	4(%esp), %edx
	fstpl	(%eax)
	fstpl	(%edx)
	ret
//	=======================================================================
//	float v_abs_f(float x)
.align	4
.globl	v_abs_f
v_abs_f:
	andl	$0x07fffffff, 4(%esp)
	flds	4(%esp)
	ret
// =======================================================================
#ifndef	NO_MEMOPS
// =======================================================================
// void memFill(void *dest, unsigned char value, unsigned int _length);
.align 4
.globl memFill
memFill:
	pushl   %edi
	movl    8(%esp), %edi
	movb    12(%esp), %al
	movl    16(%esp), %edx
	movb    %al, %ah
	movl    %eax, %ecx
    bswap	%eax
	movw    %cx, %ax
	movl    %edx, %ecx
	shrl    $2, %ecx
	rep     stosl
	movb    %dl, %cl
	andb    $3, %cl
	rep     stosb
	popl    %edi
	ret
// =======================================================================
// void memZero(void *dest, unsigned int _length);
.align 4
.globl memZero
memZero:
	pushl   %edi
	movl    8(%esp), %edi
	movl    12(%esp), %edx
	xorl    %eax, %eax
	movl    %edx, %ecx
	shrl    $2, %ecx
	rep     stosl
	movb    %dl, %cl
	andb    $3, %cl
	rep     stosb
	popl    %edi
	ret
// =======================================================================
// void memCopy(void *dest, void *src, unsigned int _length);
.align 4
.globl memCopy
memCopy:
	pushl   %edi
	pushl   %esi
	movl    12(%esp), %edi
	movl    16(%esp), %esi
	movl    20(%esp), %eax
	movl    %eax, %ecx
	shrl    $2, %ecx
	rep     movsl
	movb    %al, %cl
	andb    $3, %cl
	rep     movsb
	popl    %esi
	popl    %edi
	ret
// =======================================================================
// void memFill32(void *dest,unsigned char value, unsigned int _dwords);
.align 4
.globl memFill32
memFill32:
	pushl   %edi
	movl    8(%esp), %edi
	movb    12(%esp), %al
	movb    %al, %ah
	movl    %eax, %ecx
    bswap	%eax
	movw    %cx, %ax
	movl    16(%esp), %ecx
	rep     stosl
	popl    %edi
	ret
// =======================================================================
// void memZero32(void *dest, unsigned int _dwords);
.align 4
.globl memZero32
memZero32:
	pushl   %edi
	xorl    %eax, %eax
	movl    8(%esp), %edi
	movl    12(%esp), %ecx
	rep     stosl
	popl    %edi
	ret
// =======================================================================
// void memCopy32(void *dest, void *src, unsigned int _dwords);
.align 4
.globl memCopy32
memCopy32:
	pushl   %edi
	pushl   %esi
	movl    20(%esp), %ecx
	movl    12(%esp), %edi
	movl    16(%esp), %esi
	rep     movsl
	popl    %esi
	popl    %edi
	ret
// =======================================================================
#endif	// NO_MEMOPS
// =======================================================================
