在Windows Phone 8的ARM NEON装配不工作 [英] ARM NEON assembly on Windows Phone 8 not working
问题描述
我试图调用一个函数是ARM NEON汇编codeD在.s文件看起来像这样:
I'm trying to call a function that is coded in ARM NEON assembly in an .s file that looks like this:
AREA myfunction, code, readonly, ARM
global fun
align 4
fun
push {r4, r5, r6, r7, lr}
add r7, sp, #12
push {r8, r10, r11}
sub r4, sp, #64
bic r4, r4, #15
mov sp, r4
vst1.64 {d8, d9, d10, d11}, [r4]!
vst1.64 {d12, d13, d14, d15}, [r4]
[....]
和我组装这样的:
armasm.exe -32 func.s func.obj
不幸的是,这并不工作,我得到非法指令异常当我尝试并调用该函数。当我用DUMPBIN.EXE拆卸OBJ,它似乎被拆卸,仿佛这是拇指code,尽管装配的ARM指令(见上code)。
Unfortunately this doesn't work, and I'm getting illegal instruction exception when I try and call the function. When I used dumpbin.exe to disassemble the .obj, it seem to be disassembling as though it was Thumb code, despite the ARM directive in the assembly (see code above).
我怀疑该功能被称为在Thumb模式下,所有的功能都假设默认情况下在Windows上是在Thumb模式。无法看到上找到这虽然任何信息。
I suspect the function is being called in Thumb mode, and that all functions are assumed to be in Thumb mode by default on Windows. Can't see to find any info on this though.
有谁知道是怎么回事呢?
Does anyone know what is going on here?
编辑:这发生在微软Surface以及
This happens on Microsoft Surface as well
推荐答案
您可以用Thumb模式BX指令开始汇编code和简单地转移到同一个源文件中的ARM一部分。
You could start your assembly code with a bx instruction in Thumb mode and simply branch to the ARM part in the same source file.
和你不必在最后切换回Thumb模式,因为你将在BX或POP {PC}完成ARM函数反正它会自动的切换。
And you don't have to switch back to Thumb mode at the end since you'll finish the ARM function in bx or pop {pc} anyway which does the switching automatically.
我的回答是WAAAAAAY晚了,但我如果它工作在WP真的很好奇。 (我没有任何)
My answer is WAAAAAAY late, but I'm really curious if it works on a WP. (I don't have any)
这篇关于在Windows Phone 8的ARM NEON装配不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!