1.4K Star 7.6K Fork 1.4K

GVP方舟编译器 / OpenArkCompiler

 / 详情

【inline asm】Inline asm clobber list not handled

已完成
成员
创建于  
2021-07-14 10:51

for example:
asm volatile { ".arch_extension lse\ncasl\t$1, $4, [$3]\ncmp\t\t$1, $2\ncset\t\t${0:w}, eq\n.arch_extension nolse\n"
: "=r" dassign %res_231_2 0,
"+&r" dassign %tmp_132_1 0
: "r" (dread u64 %_cmpval_132_1),
"r" (dread ptr %p),
"r" (dread u64 %newval)
: "cc", "memory"
: }

the "cc" is not supported.

c code
ATOMIC_CMPSET(rel, ,l)

#define _ATOMIC_CMPSET(bar, a, l)
_ATOMIC_CMPSET_IMPL(8, w, b, bar, a, l)
_ATOMIC_CMPSET_IMPL(16, w, h, bar, a, l)
_ATOMIC_CMPSET_IMPL(32, w, , bar, a, l)
_ATOMIC_CMPSET_IMPL(64, , , bar, a, l)

#define _ATOMIC_CMPSET_IMPL(t, w, s, bar, a, l)
_ATOMIC_CMPSET_PROTO(t, bar, _llsc)
{
uint##t##_t tmp;
int res;

__asm __volatile(
"1: mov %w1, #1:编译报错: ninja: error: manifest 'build.ninja' still dirty after 100 tries\n"
" ld"#a"xr"#s" %"#w"0, [%2]\n"
" cmp %"#w"0, %"#w"3\n"
" b.ne 2f\n"
" st"#l"xr"#s" %w1, %"#w"4, [%2]\n"
" cbnz %w1, 1b\n"
"2:"
: "=&r"(tmp), "=&r"(res)
: "r" (p), "r" (cmpval), "r" (newval)
: "cc", "memory"
);

return (!res);
} \

评论 (0)

jinzhu 创建了任务
jinzhu 修改了描述
jinzhu 任务状态待办的 修改为已完成
展开全部操作日志

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
C++
1
https://gitee.com/openarkcompiler/OpenArkCompiler.git
git@gitee.com:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

搜索帮助