如何比较MIPS中的double值?

时间:2016-11-10 01:13:23

标签: assembly mips precision cpu-registers

我有一个以此

结尾的循环
bne $f2, $zero, loop

如果$ f2等于零,它应该返回到循环的开头,但是我收到了这个错误。

“$ f2”:操作数的类型不正确

如何将double值与零进行比较?

1 个答案:

答案 0 :(得分:2)

你必须使用像

这样的东西
li.d $f0, 0        # store the value 0 in register $f0
c.ne.d $f0, $f2    # $f0 != $f2?
bc1t loop          # if true, branch to the label called "loop"