I suspect that I have to mark result as an output, as suggested, and populate it differently in the assembly code, but I can't find any information on know to do so.推荐答案我怀疑这是由于缺乏输出约束造成的.I suspect this is due to the lack of an output constraint.试试这个,uint64_t Foo::f() { uint64_t result; asm /* volatile */ ("vldmia %1, {q0-q1} \n" // q0-1 = *this ⋮ "vstmia %0, {d0} \n" // result = d0 : "=w"(result): "r"(this) : "q0", "q1"); return result;}您必须使用输出约束,"=w"(result),告诉编译器汇编器正在设置一个值.如果您这样做,您可能不需要 volatile.至少,这是一个需要消除的好问题.You must use an output constraint, "=w"(result), to tell the compiler that the assembler is setting a value. You probably don't need the volatile if you do this. At least, this is a good issue to eliminate. 这篇关于误报:未定义或垃圾值返回给调用者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-28 00:26