MegEngine / MegEngine/mperf

armv7 cpu 编译错误

Open
#10 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
197
Forks
32
PR merge metrics
No merged PRs in 30d

Description

使用./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=]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/cpu_pmu_analysis/prefetch.cpp, especially the inline assembly around lines 27-65, and reproduce the failure with ./android_build.sh -m armeabi-v7a. Compare the ARMv7 assembler diagnostics with the instructions and operands used there. Done means the armeabi-v7a build completes without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, embedded-iot, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.