在 ULP 中使用 SUB 指令进行一个正数减去一个负数的操作,会产生 ALU overflow,按理 SUB 指令进行的是有符号的运算,应该不会产生
ALU overflow.
在 ULP 中添加如下代码即可复现:
Code: Select all
move r2, 1
sub r2, r2, -1
jump wake_up, ov
[EN]
When I use the ULP, I found a problem as below:
When I use `SUB` instruction to do the caculation that a positive number minus a negtive number, it seems that ALU will set overflow flag. And the `SUB` instruction can do sighed value caculation, so I think the ALU will not set overflow.
Add the code below can reproduce the issue:
Code: Select all
move r2, 1
sub r2, r2, -1
jump wake_up, ov