[NDS32] Fix clip signed comparison

This commit is contained in:
Timothée COCAULT 2020-04-18 18:23:24 +02:00
parent 75048cc19b
commit 6c45eb95c2

View File

@ -675,11 +675,11 @@ GpWordAddress: [+ off] is Imm17s [ off = Imm17s << 2; ] { addr:4 = gp + off; exp
:clip Rt, Ra, Imm5u is $(I32) & $(ALU_2) & Rt & Ra & Imm5u & $(ALU2Z) & Sub6=0b000101 :clip Rt, Ra, Imm5u is $(I32) & $(ALU_2) & Rt & Ra & Imm5u & $(ALU2Z) & Sub6=0b000101
{ {
local upper:4 = (1 << Imm5u) - 1; local upper:4 = (1 << Imm5u) - 1;
if(Ra <= upper) goto <elif>; if(Ra s<= upper) goto <elif>;
Rt = upper; Rt = upper;
goto <end>; goto <end>;
<elif> <elif>
if(Ra >= 0) goto <else>; if(Ra s>= 0) goto <else>;
Rt = 0; Rt = 0;
goto <end>; goto <end>;
<else> <else>