好的,你会认为Microchip能做到这一点,并把它称为“DISSsC装配窗口”,所以我把它简化成几个这样的测试:程序看起来像这样,我猜这是正确的吗?它使用浮动寄存器和Mull指令。结果我花了半天的时间才得出这个结论。
以上来自于百度翻译
以下为原文
Well that's fancy, you would think Microchip could do that and call it something like "Dissassembly Window"
So I simplified it to just a couple of tests like this:
int main ( void )
{
volatile float f=3.333;
volatile float j=88.383;
volatile float result = f*j;
volatile int i=303;
volatile float intFloatResult = i*result;
return ( 0);
}
And the assembly looks like this
int main ( void )
{
9d000834: 27bdffe0 addiu sp,sp,-32
9d000838: afbe001c sw s8,28(sp)
9d00083c: 03a0f021 move s8,sp
volatile float f=3.333;
9d000840: 3c029d00 lui v0,0x9d00
9d000844: 8c4200ec lw v0,236(v0)
9d000848: afc20000 sw v0,0(s8)
volatile float j=88.383;
9d00084c: 3c029d00 lui v0,0x9d00
9d000850: 8c4200f0 lw v0,240(v0)
9d000854: afc20004 sw v0,4(s8)
volatile float result = f*j;
9d000858: 8fc30000 lw v1,0(s8)
9d00085c: 8fc20004 lw v0,4(s8)
9d000860: 44830000 mtc1 v1,$f0
9d000864: 44820800 mtc1 v0,$f1
9d000868: 46010002 mul.s $f0,$f0,$f1
9d00086c: 44020000 mfc1 v0,$f0
9d000870: afc20008 sw v0,8(s8)
volatile int i=303;
9d000874: 2402012f li v0,303
9d000878: afc2000c sw v0,12(s8)
volatile float intFloatResult = i*result;
9d00087c: 8fc2000c lw v0,12(s8)
9d000880: 44820000 mtc1 v0,$f0
9d000884: 46800020 cvt.s.w $f0,$f0
9d000888: 44030000 mfc1 v1,$f0
9d00088c: 8fc20008 lw v0,8(s8)
9d000890: 44830800 mtc1 v1,$f1
9d000894: 44820000 mtc1 v0,$f0
9d000898: 46000842 mul.s $f1,$f1,$f0
9d00089c: 44020800 mfc1 v0,$f1
9d0008a0: afc20010 sw v0,16(s8)
return ( 0);
9d0008a4: 00001021 move v0,zero
}
9d0008a8: 03c0e821 move sp,s8
9d0008ac: 8fbe001c lw s8,28(sp)
9d0008b0: 27bd0020 addiu sp,sp,32
9d0008b4: 03e00008 jr ra
9d0008b8: 00000000 nop
I guess this is correct? It is using the float registers and the mul.s instruction. To bad it took me half a day to come to this conclusion.
好的,你会认为Microchip能做到这一点,并把它称为“DISSsC装配窗口”,所以我把它简化成几个这样的测试:程序看起来像这样,我猜这是正确的吗?它使用浮动寄存器和Mull指令。结果我花了半天的时间才得出这个结论。
以上来自于百度翻译
以下为原文
Well that's fancy, you would think Microchip could do that and call it something like "Dissassembly Window"
So I simplified it to just a couple of tests like this:
int main ( void )
{
volatile float f=3.333;
volatile float j=88.383;
volatile float result = f*j;
volatile int i=303;
volatile float intFloatResult = i*result;
return ( 0);
}
And the assembly looks like this
int main ( void )
{
9d000834: 27bdffe0 addiu sp,sp,-32
9d000838: afbe001c sw s8,28(sp)
9d00083c: 03a0f021 move s8,sp
volatile float f=3.333;
9d000840: 3c029d00 lui v0,0x9d00
9d000844: 8c4200ec lw v0,236(v0)
9d000848: afc20000 sw v0,0(s8)
volatile float j=88.383;
9d00084c: 3c029d00 lui v0,0x9d00
9d000850: 8c4200f0 lw v0,240(v0)
9d000854: afc20004 sw v0,4(s8)
volatile float result = f*j;
9d000858: 8fc30000 lw v1,0(s8)
9d00085c: 8fc20004 lw v0,4(s8)
9d000860: 44830000 mtc1 v1,$f0
9d000864: 44820800 mtc1 v0,$f1
9d000868: 46010002 mul.s $f0,$f0,$f1
9d00086c: 44020000 mfc1 v0,$f0
9d000870: afc20008 sw v0,8(s8)
volatile int i=303;
9d000874: 2402012f li v0,303
9d000878: afc2000c sw v0,12(s8)
volatile float intFloatResult = i*result;
9d00087c: 8fc2000c lw v0,12(s8)
9d000880: 44820000 mtc1 v0,$f0
9d000884: 46800020 cvt.s.w $f0,$f0
9d000888: 44030000 mfc1 v1,$f0
9d00088c: 8fc20008 lw v0,8(s8)
9d000890: 44830800 mtc1 v1,$f1
9d000894: 44820000 mtc1 v0,$f0
9d000898: 46000842 mul.s $f1,$f1,$f0
9d00089c: 44020800 mfc1 v0,$f1
9d0008a0: afc20010 sw v0,16(s8)
return ( 0);
9d0008a4: 00001021 move v0,zero
}
9d0008a8: 03c0e821 move sp,s8
9d0008ac: 8fbe001c lw s8,28(sp)
9d0008b0: 27bd0020 addiu sp,sp,32
9d0008b4: 03e00008 jr ra
9d0008b8: 00000000 nop
I guess this is correct? It is using the float registers and the mul.s instruction. To bad it took me half a day to come to this conclusion.
举报