X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Fm32c-ibld.c;h=976b70b7a9b8aeafc399b808a72c94ee5211af07;hb=36231dfc188426d9b887af2d1c6c2cbb1c746cb3;hp=b8ae67b6f046e96a863d047d9de172a75845a822;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/m32c-ibld.c b/opcodes/m32c-ibld.c index b8ae67b6f0..976b70b7a9 100644 --- a/opcodes/m32c-ibld.c +++ b/opcodes/m32c-ibld.c @@ -1,9 +1,10 @@ +/* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */ /* Instruction building/extraction support for m32c. -*- 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. @@ -154,7 +155,7 @@ insert_normal (CGEN_CPU_DESC cd, { long minval = - (1L << (length - 1)); unsigned long maxval = mask; - + if ((value > 0 && (unsigned long) value > maxval) || value < minval) { @@ -192,7 +193,7 @@ insert_normal (CGEN_CPU_DESC cd, { long minval = - (1L << (length - 1)); long maxval = (1L << (length - 1)) - 1; - + if (value < minval || value > maxval) { sprintf @@ -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); } @@ -618,7 +626,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_BITBASE16_16_U16 : { long value = fields->f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } break; @@ -664,7 +672,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, break; { long value = fields->f_dsp_16_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -715,7 +723,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, break; { long value = fields->f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -804,7 +812,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, break; { long value = fields->f_dsp_32_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer); } if (errmsg) @@ -826,7 +834,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DSP_16_S16 : { long value = fields->f_dsp_16_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } break; @@ -848,7 +856,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, } { long value = fields->f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -866,7 +874,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, } { long value = fields->f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -921,7 +929,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, break; { long value = fields->f_dsp_32_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer); } if (errmsg) @@ -939,7 +947,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, break; { long value = fields->f_dsp_32_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer); } if (errmsg) @@ -952,7 +960,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DSP_32_S16 : { long value = fields->f_dsp_32_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_32_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer); } break; @@ -986,7 +994,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DSP_40_S16 : { long value = fields->f_dsp_40_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_40_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 8, 16, 32, total_length, buffer); } break; @@ -1020,7 +1028,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DSP_48_S16 : { long value = fields->f_dsp_48_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_48_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer); } break; @@ -1042,7 +1050,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, } { long value = fields->f_dsp_48_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -1060,7 +1068,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, } { long value = fields->f_dsp_48_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer); } if (errmsg) @@ -1076,7 +1084,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DSP_8_S24 : { long value = fields->f_dsp_8_s24; - value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((EXTQISI (TRUNCSIQI (((value) & (255))))) << (16)))); + value = ((((((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608)); errmsg = insert_normal (cd, value, 0|(1<f_dsp_8_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 8, 16, 32, total_length, buffer); } break; @@ -1229,7 +1237,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_IMM_16_HI : { long value = fields->f_dsp_16_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_16_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer); } if (errmsg) break; { long value = fields->f_dsp_32_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer); } if (errmsg) @@ -1299,7 +1307,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_IMM_32_HI : { long value = fields->f_dsp_32_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_40_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_48_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_dsp_48_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer); } if (errmsg) break; { long value = fields->f_dsp_64_u16; - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); errmsg = insert_normal (cd, value, 0, 64, 0, 16, 32, total_length, buffer); } if (errmsg) @@ -1400,7 +1408,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_IMM_8_HI : { long value = fields->f_dsp_8_s16; - value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); errmsg = insert_normal (cd, value, 0|(1<f_lab_8_16; - value = ((((((((value) - (((pc) + (1))))) & (255))) << (8))) | (((USI) (((((value) - (((pc) + (1))))) & (65535))) >> (8)))); + value = ((((((((value) - (((pc) + (1))))) & (255))) << (8))) | (((USI) (((((value) - (((pc) + (1))))) & (65280))) >> (8)))); errmsg = insert_normal (cd, value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } break; @@ -1853,12 +1862,12 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_16_s16 = value; } if (length <= 0) break; { - FLD (f_bitbase32_16_s19_unprefixed) = ((((FLD (f_dsp_16_s16)) << (3))) | (FLD (f_bitno32_unprefixed))); + FLD (f_bitbase32_16_s19_unprefixed) = ((((FLD (f_dsp_16_s16)) * (8))) | (FLD (f_bitno32_unprefixed))); } } break; @@ -1880,7 +1889,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } if (length <= 0) break; @@ -1896,7 +1905,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } if (length <= 0) break; @@ -1964,7 +1973,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_32_u16 = value; } if (length <= 0) break; @@ -1989,7 +1998,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_16_s16 = value; } break; @@ -2000,7 +2009,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } break; @@ -2009,7 +2018,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } if (length <= 0) break; @@ -2025,7 +2034,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } if (length <= 0) break; @@ -2071,7 +2080,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_32_u16 = value; } if (length <= 0) break; @@ -2087,7 +2096,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_32_u16 = value; } if (length <= 0) break; @@ -2103,7 +2112,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_32_s16 = value; } break; @@ -2114,7 +2123,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_32_u16 = value; } break; @@ -2141,7 +2150,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_40_s16 = value; } break; @@ -2152,7 +2161,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_40_u16 = value; } break; @@ -2179,7 +2188,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_48_s16 = value; } break; @@ -2190,7 +2199,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_48_u16 = value; } break; @@ -2199,7 +2208,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_48_u16 = value; } if (length <= 0) break; @@ -2215,7 +2224,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_48_u16 = value; } if (length <= 0) break; @@ -2233,7 +2242,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (16))) & (255))) | (((value) & (65280))))) | (((EXTQISI (TRUNCSIQI (((value) & (255))))) << (16)))); + value = ((((((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) & (255))) << (16))))) ^ (8388608))) - (8388608)); fields->f_dsp_8_s24 = value; } break; @@ -2244,7 +2253,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_8_u16 = value; } break; @@ -2395,7 +2404,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_16_s16 = value; } break; @@ -2407,14 +2416,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_16_u16 = value; } if (length <= 0) break; { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_32_u16 = value; } if (length <= 0) break; @@ -2460,7 +2469,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_32_s16 = value; } break; @@ -2479,7 +2488,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_40_s16 = value; } break; @@ -2506,7 +2515,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_48_s16 = value; } break; @@ -2518,14 +2527,14 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_48_u16 = value; } if (length <= 0) break; { long value; length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value); - value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))); + value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) & (255))) << (8)))); fields->f_dsp_64_u16 = value; } if (length <= 0) break; @@ -2560,7 +2569,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) & (255))) | (((((value) << (8))) & (65280))))))); + value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) & (255))) << (8))))))); fields->f_dsp_8_s16 = value; } break; @@ -2645,7 +2654,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (8))) | (((SI) (((((value) & (255))) << (24))) >> (16))))) + (((pc) + (1)))); + value = ((((((((((USI) (((value) & (65280))) >> (8))) | (((((value) & (255))) << (8))))) ^ (32768))) - (32768))) + (((pc) + (1)))); fields->f_lab_8_16 = value; } break; @@ -2885,20 +2894,21 @@ m32c_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 (); } return length; } -cgen_insert_fn * const m32c_cgen_insert_handlers[] = +cgen_insert_fn * const m32c_cgen_insert_handlers[] = { insert_insn_normal, }; -cgen_extract_fn * const m32c_cgen_extract_handlers[] = +cgen_extract_fn * const m32c_cgen_extract_handlers[] = { extract_insn_normal, }; @@ -3502,8 +3512,9 @@ m32c_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 (); } @@ -4101,8 +4112,9 @@ m32c_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 (); } @@ -4688,8 +4700,9 @@ m32c_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 (); } } @@ -5265,8 +5278,9 @@ m32c_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 (); } }