/**********************************************************************/

	.data
	.align	4
EightFloats:
	.float	1.1, 2.2, 3.3, 4.4
	.float	5.1, 6.2, 7.3, 8.4

OutputSpec:	
	.string	"Sum: %4.2f %4.2f %4.2f %4.2f\n"
	
/**********************************************************************/

	.text
	.align	4	
	.globl	main
main:
	pushl	%ebp
	movl	%esp, %ebp

	# SSE2 add of 4 floats in parallel
	movaps	(EightFloats),		%xmm0
	movaps	(EightFloats + 16),	%xmm1
	addps	%xmm0,			%xmm1
	movaps	%xmm1,			(EightFloats)

	movl	$EightFloats, %eax	

	# Move to FP stack
	flds	0(%eax)
	flds	4(%eax)
	flds	8(%eax)
	flds	12(%eax)

	# Allocate stack space and store as args to printf
	subl	$32, %esp
	fstpl	24(%esp)
	fstpl	16(%esp)
	fstpl	8(%esp)
	fstpl	0(%esp)

	pushl	$OutputSpec
	call	printf
	
	# Return 0 from main
	movl	$0, %eax

	# Restore stack
	movl	%ebp, %esp
	popl	%ebp

	ret

/**********************************************************************/
	
