浮点寄存器到通用寄存器上的Mov值

问题描述

所以我正在使用指令“ fmov x0,d3”将值从d3移到x0,但是由于某种原因,x0上的值保持不变。 有人可以告诉我如何正确地将值从浮点寄存器移到通用寄存器吗?

这是我的代码

  mov    x0,#6         //Moves the decimal 0 value to the x0 register,which is the return register 
Fadd_test_64:
  fmov   d1,#7.0      //Moves floating point value to the d1 register
  fmov   d2,#2.0
  fmov   d4,#14.0     //Moves the expected result to d4
  fadd   d3,d1,d2      //d3=d1+d2
  fcmp   d3,d4        //Compares w3 to w4
  b.ne   Fadd_error_64 //if they are different,go to Fadd_error_64
  b      Fadd_end_64   //if not,go to Fadd_end_64 
Fadd_error_64: 
  fmov   x0,d3         //Moves the value on the floating point register to the return register
Fadd_end_64:
  ret   


//Functions declaration
void mathTest_64bits(void);
UINT16 FAddition_64();
 
//Main function
 
int main(void)
{
        mathTest_64bits();
   
    return 0;
}
 
 
//Functino in C to run the assembly code
void mathTest_64bits(void)
{
  int ret;
 
  ret = FAddition_64();
  if(ret!=0)
  {
    Print(L"64-bits Floating Point  Addition test:       Failed: %d",ret);
  }
  else
  {
    Print(L"64-bits Floating Point  Addition test:       Success ");
  }
  Print(L"\n");
 }

 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)