X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Flm32-ibld.c;h=0a5e54a5c8d9456b8ca81f53d490a20a0b0fea1c;hb=cc6aa1a6e0a8f2b3eda496aef0b3579a8c2b5951;hp=853024c279871869299f4d2f1be387b510e9f324;hpb=43e65147c07b1400ae0dbb6694882eceb2363713;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/lm32-ibld.c b/opcodes/lm32-ibld.c index 853024c279..0a5e54a5c8 100644 --- a/opcodes/lm32-ibld.c +++ b/opcodes/lm32-ibld.c @@ -1,9 +1,10 @@ +/* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */ /* Instruction building/extraction support for lm32. -*- C -*- THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator. - the resultant file is machine generated, cgen-ibld.in isn't - Copyright (C) 1996-2015 Free Software Foundation, Inc. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of libopcodes. @@ -207,12 +208,19 @@ insert_normal (CGEN_CPU_DESC cd, #if CGEN_INT_INSN_P { - int shift; + int shift_within_word, shift_to_word, shift; + /* How to shift the value to BIT0 of the word. */ + shift_to_word = total_length - (word_offset + word_length); + + /* How to shift the value to the field within the word. */ if (CGEN_INSN_LSB0_P) - shift = (word_offset + start + 1) - length; + shift_within_word = start + 1 - length; else - shift = total_length - (word_offset + start + length); + shift_within_word = word_length - start - length; + + /* The total SHIFT, then mask in the value. */ + shift = shift_to_word + shift_within_word; *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift); } @@ -627,8 +635,9 @@ lm32_cgen_insert_operand (CGEN_CPU_DESC cd, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while building insn.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while building insn"), + opindex); abort (); } @@ -671,7 +680,7 @@ lm32_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (14)))); + value = ((pc) + (((((((((value) & (65535))) << (2))) ^ (131072))) - (131072)))); fields->f_branch = value; } break; @@ -679,7 +688,7 @@ lm32_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (4)))); + value = ((pc) + (((((((((value) & (67108863))) << (2))) ^ (134217728))) - (134217728)))); fields->f_call = value; } break; @@ -731,8 +740,9 @@ lm32_cgen_extract_operand (CGEN_CPU_DESC cd, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while decoding insn"), + opindex); abort (); } @@ -820,8 +830,9 @@ lm32_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while getting int operand"), + opindex); abort (); } @@ -891,8 +902,9 @@ lm32_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while getting vma operand"), + opindex); abort (); } @@ -969,8 +981,9 @@ lm32_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while setting int operand"), + opindex); abort (); } } @@ -1037,8 +1050,9 @@ lm32_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, default : /* xgettext:c-format */ - fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"), - opindex); + opcodes_error_handler + (_("internal error: unrecognized field %d while setting vma operand"), + opindex); abort (); } }