I think i've found a bug, should / how do i report it.

Daniel Keep daniel.keep.lists at gmail.com
Sun Mar 11 18:16:55 PDT 2007



Chris Warwick wrote:
> MMX assembler doesnt like const.
> 
> -------------------
> const int foo = 1;
> asm mov EAX,foo;
> 
> compiles ok.
> 
> ----------------------
> ulong foo = 1;
> asm movd MM0,foo;
> 
> compiles ok.

Really?  That's odd...

> -----------------------
> const ulong foo = 1;
> asm movd MM0,foo;
> 
> complains "bad type/size of operands 'movd'"

Yup, yup.

> So simply changing the variable to const, breaks mmx's ability to use it. 
> but the same thing is not true when using normal int registers.
> 
> cw 

I can't be sure, since I haven't written any MMX code in a while, but...

movd.  As in DWORD.  As in 32-bits.  ulong is 64.  Have you tried movq? :P

Maybe the reason this is happening is because it's only taking the first
32-bits of your non-cost ulong foo, whereas if you try to use a 64-bit
immediate, it actually throws up an error saying "are you sure you mean
that, because that don't fit".

That said, I don't think I ever tried to load a ulong const... there's a
few static ones in there, but no consts.

Anyway, give movq a shot.  Never know :)

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


More information about the Digitalmars-d-learn mailing list