diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 1729efd266..3e6a8d8c4d 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,7 @@ +2019-12-23 Alan Modra + + * iq2000.cpu (f-offset): Avoid left shift of negative values. + 2019-12-20 Alan Modra * or1korbis.cpu (f-disp26, f-disp21): Don't left shift negative values. diff --git a/cpu/iq2000.cpu b/cpu/iq2000.cpu index e25ba69392..cb9cfae1d4 100644 --- a/cpu/iq2000.cpu +++ b/cpu/iq2000.cpu @@ -207,7 +207,7 @@ (df f-offset "pc offset field" (PCREL-ADDR) 15 16 INT ; Actually, this is relative to the address of the delay slot. ((value pc) (sra SI (sub SI value pc) 2)) - ((value pc) (add SI (sll SI value 2) (add pc 4)))) + ((value pc) (add SI (mul SI value 4) (add pc 4)))) ; Instruction fields that scarcely appear in instructions. diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1c5592ae26..c3a97523bc 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2019-12-23 Alan Modra + + * iq2000-ibld.c: Regenerate. + 2019-12-23 Alan Modra * d30v-dis.c (extract_value): Make num param a uint64_t, constify diff --git a/opcodes/iq2000-ibld.c b/opcodes/iq2000-ibld.c index 34482b366a..3059fe167a 100644 --- a/opcodes/iq2000-ibld.c +++ b/opcodes/iq2000-ibld.c @@ -838,7 +838,7 @@ iq2000_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<f_offset = value; } break;