X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fm32c-ibld.c;h=228fa0d9c8c019d581f508c8d497241fce75a5bd;hb=ae3e98b418c6f31cc1999d67fc2422429d88de6f;hp=29c9411a279f1e515e5bec4170d6d686a366dcd9;hpb=827041555ac443bd57340060f3e034fd7b199dd8;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/m32c-ibld.c b/opcodes/m32c-ibld.c index 29c9411a27..228fa0d9c8 100644 --- a/opcodes/m32c-ibld.c +++ b/opcodes/m32c-ibld.c @@ -4,7 +4,7 @@ THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator. - the resultant file is machine generated, cgen-ibld.in isn't - Copyright (C) 1996-2019 Free Software Foundation, Inc. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of libopcodes. @@ -85,20 +85,20 @@ insert_1 (CGEN_CPU_DESC cd, int word_length, unsigned char *bufp) { - unsigned long x,mask; + unsigned long x, mask; int shift; - x = cgen_get_insn_value (cd, bufp, word_length); + x = cgen_get_insn_value (cd, bufp, word_length, cd->endian); /* Written this way to avoid undefined behaviour. */ - mask = (((1L << (length - 1)) - 1) << 1) | 1; + mask = (1UL << (length - 1) << 1) - 1; if (CGEN_INSN_LSB0_P) shift = (start + 1) - length; else shift = (word_length - (start + length)); x = (x & ~(mask << shift)) | ((value & mask) << shift); - cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x); + cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x, cd->endian); } #endif /* ! CGEN_INT_INSN_P */ @@ -131,13 +131,15 @@ insert_normal (CGEN_CPU_DESC cd, CGEN_INSN_BYTES_PTR buffer) { static char errbuf[100]; - /* Written this way to avoid undefined behaviour. */ - unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1; + unsigned long mask; /* If LENGTH is zero, this operand doesn't contribute to the value. */ if (length == 0) return NULL; + /* Written this way to avoid undefined behaviour. */ + mask = (1UL << (length - 1) << 1) - 1; + if (word_length > 8 * sizeof (CGEN_INSN_INT)) abort (); @@ -153,7 +155,7 @@ insert_normal (CGEN_CPU_DESC cd, /* Ensure VALUE will fit. */ if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) { - long minval = - (1L << (length - 1)); + long minval = - (1UL << (length - 1)); unsigned long maxval = mask; if ((value > 0 && (unsigned long) value > maxval) @@ -191,8 +193,8 @@ insert_normal (CGEN_CPU_DESC cd, { if (! cgen_signed_overflow_ok_p (cd)) { - long minval = - (1L << (length - 1)); - long maxval = (1L << (length - 1)) - 1; + long minval = - (1UL << (length - 1)); + long maxval = (1UL << (length - 1)) - 1; if (value < minval || value > maxval) { @@ -269,8 +271,8 @@ insert_insn_normal (CGEN_CPU_DESC cd, #else cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize, - (unsigned) CGEN_FIELDS_BITSIZE (fields)), - value); + (unsigned) CGEN_FIELDS_BITSIZE (fields)), + value, cd->insn_endian); #endif /* ! CGEN_INT_INSN_P */ @@ -314,7 +316,7 @@ put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, { int shift = insn_length - length; /* Written this way to avoid undefined behaviour. */ - CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1; + CGEN_INSN_INT mask = length == 0 ? 0 : (1UL << (length - 1) << 1) - 1; *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift); } @@ -387,7 +389,7 @@ extract_1 (CGEN_CPU_DESC cd, unsigned long x; int shift; - x = cgen_get_insn_value (cd, bufp, word_length); + x = cgen_get_insn_value (cd, bufp, word_length, cd->endian); if (CGEN_INSN_LSB0_P) shift = (start + 1) - length; @@ -480,7 +482,10 @@ extract_normal (CGEN_CPU_DESC cd, abort (); if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0) - return 0; + { + *valuep = 0; + return 0; + } value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc); } @@ -488,12 +493,12 @@ extract_normal (CGEN_CPU_DESC cd, #endif /* ! CGEN_INT_INSN_P */ /* Written this way to avoid undefined behaviour. */ - mask = (((1L << (length - 1)) - 1) << 1) | 1; + mask = (1UL << (length - 1) << 1) - 1; value &= mask; /* sign extend? */ if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED) - && (value & (1L << (length - 1)))) + && (value & (1UL << (length - 1)))) value |= ~mask; *valuep = value; @@ -609,14 +614,14 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_BIT32RNPREFIXED : { long value = fields->f_dst32_rn_prefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer); } break; case M32C_OPERAND_BIT32RNUNPREFIXED : { long value = fields->f_dst32_rn_unprefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer); } break; @@ -626,7 +631,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; @@ -672,7 +677,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) @@ -723,7 +728,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) @@ -812,7 +817,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) @@ -834,7 +839,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; @@ -856,7 +861,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) @@ -874,7 +879,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) @@ -929,7 +934,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) @@ -947,7 +952,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) @@ -960,7 +965,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; @@ -994,7 +999,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; @@ -1028,7 +1033,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; @@ -1050,7 +1055,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) @@ -1068,7 +1073,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) @@ -1084,7 +1089,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; @@ -1191,7 +1196,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DST32RNPREFIXEDQI : { long value = fields->f_dst32_rn_prefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer); } break; @@ -1212,7 +1217,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_DST32RNUNPREFIXEDQI : { long value = fields->f_dst32_rn_unprefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer); } break; @@ -1237,7 +1242,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) @@ -1307,7 +1312,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_32_s32; - value = EXTSISI (((((((((UINT) (value) >> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) << (8))) & (16711680))) | (((((value) << (24))) & (0xff000000))))))); + value = EXTSISI (((((((((UINT) (value) >> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) & (65280))) << (8))) | (((((value) & (255))) << (24))))))); 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) @@ -1401,14 +1406,14 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_IMM_64_HI : { long value = fields->f_dsp_64_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_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<f_src32_rn_prefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 18, 2, 32, total_length, buffer); } break; @@ -1624,7 +1629,7 @@ m32c_cgen_insert_operand (CGEN_CPU_DESC cd, case M32C_OPERAND_SRC32RNUNPREFIXEDQI : { long value = fields->f_src32_rn_unprefixed_QI; - value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1)))); + value = (((((~ (((value) << (1))))) & (2))) | (((((USI) (value) >> (1))) & (1)))); errmsg = insert_normal (cd, value, 0, 0, 10, 2, 32, total_length, buffer); } break; @@ -1826,7 +1831,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; @@ -1851,7 +1856,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, length = extract_normal (cd, ex_info, insn_value, 0|(1<f_dsp_16_s8); if (length <= 0) break; { - FLD (f_bitbase32_16_s11_unprefixed) = ((((FLD (f_dsp_16_s8)) << (3))) | (FLD (f_bitno32_unprefixed))); + FLD (f_bitbase32_16_s11_unprefixed) = ((((FLD (f_dsp_16_s8)) * (8))) | (FLD (f_bitno32_unprefixed))); } } break; @@ -1862,12 +1867,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; @@ -1889,7 +1894,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; @@ -1905,7 +1910,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; @@ -1923,7 +1928,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, length = extract_normal (cd, ex_info, insn_value, 0|(1<f_dsp_24_s8); if (length <= 0) break; { - FLD (f_bitbase32_24_s11_prefixed) = ((((FLD (f_dsp_24_s8)) << (3))) | (FLD (f_bitno32_prefixed))); + FLD (f_bitbase32_24_s11_prefixed) = ((((FLD (f_dsp_24_s8)) * (8))) | (FLD (f_bitno32_prefixed))); } } break; @@ -1936,7 +1941,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, length = extract_normal (cd, ex_info, insn_value, 0|(1<f_dsp_32_s8); if (length <= 0) break; { - FLD (f_bitbase32_24_s19_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (((((FLD (f_dsp_32_s8)) << (11))) | (FLD (f_bitno32_prefixed))))); + FLD (f_bitbase32_24_s19_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (((((FLD (f_dsp_32_s8)) * (2048))) | (FLD (f_bitno32_prefixed))))); } } break; @@ -1973,7 +1978,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; @@ -1998,7 +2003,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; @@ -2009,7 +2014,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; @@ -2018,7 +2023,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; @@ -2034,7 +2039,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; @@ -2080,7 +2085,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; @@ -2096,7 +2101,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; @@ -2112,7 +2117,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; @@ -2123,7 +2128,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; @@ -2150,7 +2155,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; @@ -2161,7 +2166,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; @@ -2188,7 +2193,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; @@ -2199,7 +2204,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; @@ -2208,7 +2213,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; @@ -2224,7 +2229,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; @@ -2242,7 +2247,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; @@ -2253,7 +2258,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; @@ -2404,7 +2409,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; @@ -2416,14 +2421,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; @@ -2469,7 +2474,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; @@ -2480,7 +2485,7 @@ m32c_cgen_extract_operand (CGEN_CPU_DESC cd, { long value; length = extract_normal (cd, ex_info, insn_value, 0|(1<> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) << (8))) & (16711680))) | (((((value) << (24))) & (0xff000000))))))); + value = EXTSISI (((((((((UINT) (value) >> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) & (65280))) << (8))) | (((((value) & (255))) << (24))))))); fields->f_dsp_32_s32 = value; } break; @@ -2488,7 +2493,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; @@ -2515,7 +2520,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; @@ -2527,19 +2532,19 @@ 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; { - FLD (f_dsp_48_s32) = ((((FLD (f_dsp_48_u16)) & (65535))) | (((((FLD (f_dsp_64_u16)) << (16))) & (0xffff0000)))); + FLD (f_dsp_48_s32) = ((((FLD (f_dsp_48_u16)) & (65535))) | (((((FLD (f_dsp_64_u16)) & (65535))) << (16)))); } } break; @@ -2561,7 +2566,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_64_s16 = value; } break; @@ -2569,7 +2574,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; @@ -2654,7 +2659,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;