arm: fix conversion from integer to float/double with VFP
authorDaniel Glöckner <daniel-gl@gmx.net>
Sun, 3 Feb 2013 16:51:33 +0000 (3 17:51 +0100)
committerDaniel Glöckner <daniel-gl@gmx.net>
Sun, 3 Feb 2013 16:51:33 +0000 (3 17:51 +0100)
The source register was not encoded in the instruction.

arm-gen.c

index e9b8309..37cd304 100644 (file)
--- a/arm-gen.c
+++ b/arm-gen.c
@@ -1847,7 +1847,7 @@ ST_FUNC void gen_cvt_itof1(int t)
 #ifdef TCC_ARM_VFP
     r2=vfpr(vtop->r=get_reg(RC_FLOAT));
     o(0xEE000A10|(r<<12)|(r2<<16)); /* fmsr */
-    r2<<=12;
+    r2|=r2<<12;
     if(!(vtop->type.t & VT_UNSIGNED))
       r2|=0x80;                /* fuitoX -> fsituX */
     o(0xEEB80A40|r2|T2CPR(t)); /* fYitoX*/