提交 5c3a227c 编写于 作者: W William Wang

engine,rv64: add amomax, amominu, amomin

上级 cf22d848
......@@ -79,6 +79,33 @@ static inline make_EHelper(amomaxu) {
print_asm_template3(amomaxu);
}
static inline make_EHelper(amomax) {
amo_load(s);
return_on_mem_ex();
*s1 = (((sword_t)*s0) > ((sword_t)*dsrc2) ? *s0 : *dsrc2);
amo_update(s);
return_on_mem_ex();
print_asm_template3(amomax);
}
static inline make_EHelper(amominu) {
amo_load(s);
return_on_mem_ex();
*s1 = (*s0 < *dsrc2 ? *s0 : *dsrc2);
amo_update(s);
return_on_mem_ex();
print_asm_template3(amominu);
}
static inline make_EHelper(amomin) {
amo_load(s);
return_on_mem_ex();
*s1 = (((sword_t)*s0) < ((sword_t)*dsrc2) ? *s0 : *dsrc2);
amo_update(s);
return_on_mem_ex();
print_asm_template3(amomin);
}
static inline make_EHelper(amoxor) {
amo_load(s);
return_on_mem_ex();
......
......@@ -102,6 +102,9 @@ static inline make_EHelper(atomic) {
EX(0x04, amoxor)
EX(0x0c, amoand)
EX(0x08, amoor)
EX(0x10, amomin)
EX(0x14, amomax)
EX(0x18, amominu)
EX(0x1c, amomaxu)
}
cpu.amo = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册