MegEngine / mperf

mperf是一个面向移动/嵌入式平台的算子性能调优工具箱
Apache License 2.0
170 stars 27 forks source link

armv7 cpu 编译错误 #10

Open nicheng0019 opened 1 year ago

nicheng0019 commented 1 year ago

使用./android_build.sh -m armeabi-v7a 命令编译,报错如下:

/workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:27:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #64]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #64]subs ${1:w}, ${1:w}, #1bne 3b' "prfm pldl1keep, [%[b_ptr], #64]\n" ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:27:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #64]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #64]subs ${1:w}, ${1:w}, #1bne 3b' /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:27:13: error: invalid instruction

:1:2: note: instantiated into assembly here prfm pldl1keep, [r0, #64] ^~~~ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:29:14: error: operand must be a register in range [r0, r15] "ldr d2, [%[b_ptr]]\n" ^ :3:5: note: instantiated into assembly here ldr d2, [r0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:30:14: error: unexpected token in argument list "fmla v3.4s, v2.4s, v1.s[0]\n" ^ :4:24: note: instantiated into assembly here fmla v3.4s, v2.4s, v1.s[0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:32:14: error: invalid instruction "prfm pldl1keep, [%[b_ptr], #64]\n" ^ :6:1: note: instantiated into assembly here prfm pldl1keep, [r0, #64] ^~~~ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:33:14: error: unexpected token in operand "subs %w[K], %w[K], #1\n" ^ :7:6: note: instantiated into assembly here subs , , #1 ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:41:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #512]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #512]subs ${1:w}, ${1:w}, #1bne 3b' "prfm pldl1keep, [%[b_ptr], #512]\n" ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:41:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #512]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #512]subs ${1:w}, ${1:w}, #1bne 3b' /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:41:13: error: invalid instruction :1:2: note: instantiated into assembly here prfm pldl1keep, [r0, #512] ^~~~ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:43:14: error: operand must be a register in range [r0, r15] "ldr d2, [%[b_ptr]]\n" ^ :3:5: note: instantiated into assembly here ldr d2, [r0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:44:14: error: unexpected token in argument list "fmla v3.4s, v2.4s, v1.s[0]\n" ^ :4:24: note: instantiated into assembly here fmla v3.4s, v2.4s, v1.s[0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:46:14: error: invalid instruction "prfm pldl1keep, [%[b_ptr], #512]\n" ^ :6:1: note: instantiated into assembly here prfm pldl1keep, [r0, #512] ^~~~ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:47:14: error: unexpected token in operand "subs %w[K], %w[K], #1\n" ^ :7:6: note: instantiated into assembly here subs , , #1 ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:63:13: error: register expected "ld1 {v1.4s}, [%[a_ptr]]\n" ^ :1:7: note: instantiated into assembly here ld1 {v1.4s}, [r0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:64:14: error: register expected "ld1 {v2.4s}, [%[a_ptr]]\n" ^ :2:6: note: instantiated into assembly here ld1 {v2.4s}, [r0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:65:14: error: register expected "ld1 {v3.4s}, [%[a_ptr]]\n" ^ :3:6: note: instantiated into assembly here ld1 {v3.4s}, [r0] ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:41:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #512]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #512]subs ${1:w}, ${1:w}, #1bne 3b' "prfm pldl1keep, [%[b_ptr], #512]\n" ^ /workspace/mperf/apps/cpu_pmu_analysis/prefetch.cpp:41:13: error: invalid operand in inline asm: 'prfm pldl1keep, [$0, #512]3:ldr d2, [$0]fmla v3.4s, v2.4s, v1.s[0]add $0, $0, #64prfm pldl1keep, [$0, #512]subs ${1:w}, ${1:w}, #1bne 3b' fatal error: too many errors emitted, stopping now [-ferror-limit=]
waterdropw commented 1 year ago

报错的都是内联汇编代码,目前只有A64的,A32/v7的汇编基本上需要重新实现,不确定官方还会不会支持,一些IoT设备的优化会用到吧。

nicheng0019 commented 1 year ago

报错的都是内联汇编代码,目前只有A64的,A32/v7的汇编基本上需要重新实现,不确定官方还会不会支持,一些IoT设备的优化会用到吧。

好的,多谢