Issues using the in-line assembler

solidstate1991 laszloszeremi at outlook.com
Wed Apr 4 21:00:44 UTC 2018


I have this code:
asm @nogc{
	movq		XMM0, xy;
	paddd		XMM0, sXY;	// xy + sXY
	movq		XMM3, xy0;
	psubd		XMM0, XMM3;	// xy + sXY - x0y0
	movq		XMM1, ac;
	movq		XMM2, bd;
	pmuludq		XMM1, XMM0;	// (ac * (xy + sXY - x0y0))
	psrlq		XMM1, 16;	// (ac * (xy + sXY - x0y0))>>16
	pmuludq		XMM2, XMM0; // (bd * (xy + sXY - x0y0))
	psrlq		XMM2, 16;	// (bd * (xy + sXY - x0y0))>>16
	paddq		XMM1, XMM2; // (bd * (xy + sXY - x0y0))>>16 * (ac * (xy + 
sXY - x0y0))>>16
	punpckldq	XMM3, XMM7;
	paddq		XMM1, XMM3;	// (bd * (xy + sXY - x0y0))>>16 * (ac * (xy + 
sXY - x0y0))>>16 + x0y0
	movups		XMM2, XMM1;	// Convert 64 bit vectors into 32 bit ones
	psrldq		XMM2, 4;
	por			XMM2, XMM1;	
	movq		result, XMM2;
}
I'm getting "bad type/size of operand 'movq'" error on xy0, ac, 
and bd when I try to compile it. All of the values are the type 
of int[2], xy is function parameter, sXY is created locally. How 
can I fix it?


More information about the Digitalmars-d-learn mailing list