All pastes #937355 Raw Edit

Someone

public text v1 · immutable
·published 2008-03-10 23:35 UTC
rendered paste body
	__asm
	{
		movd      mm0, x     // mm0 = (x, ?)
		pfrsqrt   mm1, mm0   // mm1 = (~1 / sqrt(x), ?)
		movq      mm2, mm1   // mm2 = mm1
		pfmul     mm1, mm1   // mm1 = mm1 * mm1
		pfrsqit1  mm1, mm0   // first iteration of Newton-Rhapson
		pfrcpit2  mm1, mm2   // second iteration
		punpckldq mm1, mm1   // mm1 = (1 / sqrt(x), ?)
		pfmul     mm0, mm1   // mm0 = (sqrt(x), ?)
		movd      y, mm0     // store result
		femms                // clear MMX state
	}