1 /* Instruction building/extraction support for m32c. -*- C -*-
3 THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
4 - the resultant file is machine generated, cgen-ibld.in isn't
6 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006, 2007,
7 2008, 2010 Free Software Foundation, Inc.
9 This file is part of libopcodes.
11 This library is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
16 It is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
25 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
34 #include "m32c-desc.h"
36 #include "cgen/basic-modes.h"
38 #include "safe-ctype.h"
41 #define min(a,b) ((a) < (b) ? (a) : (b))
43 #define max(a,b) ((a) > (b) ? (a) : (b))
45 /* Used by the ifield rtx function. */
46 #define FLD(f) (fields->f)
48 static const char * insert_normal
49 (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
50 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
51 static const char * insert_insn_normal
52 (CGEN_CPU_DESC, const CGEN_INSN *,
53 CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
54 static int extract_normal
55 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
56 unsigned int, unsigned int, unsigned int, unsigned int,
57 unsigned int, unsigned int, bfd_vma, long *);
58 static int extract_insn_normal
59 (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
60 CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
62 static void put_insn_int_value
63 (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
66 static CGEN_INLINE void insert_1
67 (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
68 static CGEN_INLINE int fill_cache
69 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
70 static CGEN_INLINE long extract_1
71 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
74 /* Operand insertion. */
78 /* Subroutine of insert_normal. */
80 static CGEN_INLINE void
81 insert_1 (CGEN_CPU_DESC cd,
91 x = cgen_get_insn_value (cd, bufp, word_length);
93 /* Written this way to avoid undefined behaviour. */
94 mask = (((1L << (length - 1)) - 1) << 1) | 1;
96 shift = (start + 1) - length;
98 shift = (word_length - (start + length));
99 x = (x & ~(mask << shift)) | ((value & mask) << shift);
101 cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
104 #endif /* ! CGEN_INT_INSN_P */
106 /* Default insertion routine.
108 ATTRS is a mask of the boolean attributes.
109 WORD_OFFSET is the offset in bits from the start of the insn of the value.
110 WORD_LENGTH is the length of the word in bits in which the value resides.
111 START is the starting bit number in the word, architecture origin.
112 LENGTH is the length of VALUE in bits.
113 TOTAL_LENGTH is the total length of the insn in bits.
115 The result is an error message or NULL if success. */
117 /* ??? This duplicates functionality with bfd's howto table and
118 bfd_install_relocation. */
119 /* ??? This doesn't handle bfd_vma's. Create another function when
123 insert_normal (CGEN_CPU_DESC cd,
126 unsigned int word_offset,
129 unsigned int word_length,
130 unsigned int total_length,
131 CGEN_INSN_BYTES_PTR buffer)
133 static char errbuf[100];
134 /* Written this way to avoid undefined behaviour. */
135 unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1;
137 /* If LENGTH is zero, this operand doesn't contribute to the value. */
141 if (word_length > 8 * sizeof (CGEN_INSN_INT))
144 /* For architectures with insns smaller than the base-insn-bitsize,
145 word_length may be too big. */
146 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
149 && word_length > total_length)
150 word_length = total_length;
153 /* Ensure VALUE will fit. */
154 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
156 long minval = - (1L << (length - 1));
157 unsigned long maxval = mask;
159 if ((value > 0 && (unsigned long) value > maxval)
162 /* xgettext:c-format */
164 _("operand out of range (%ld not between %ld and %lu)"),
165 value, minval, maxval);
169 else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
171 unsigned long maxval = mask;
172 unsigned long val = (unsigned long) value;
174 /* For hosts with a word size > 32 check to see if value has been sign
175 extended beyond 32 bits. If so then ignore these higher sign bits
176 as the user is attempting to store a 32-bit signed value into an
177 unsigned 32-bit field which is allowed. */
178 if (sizeof (unsigned long) > 4 && ((value >> 32) == -1))
183 /* xgettext:c-format */
185 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
192 if (! cgen_signed_overflow_ok_p (cd))
194 long minval = - (1L << (length - 1));
195 long maxval = (1L << (length - 1)) - 1;
197 if (value < minval || value > maxval)
200 /* xgettext:c-format */
201 (errbuf, _("operand out of range (%ld not between %ld and %ld)"),
202 value, minval, maxval);
213 if (CGEN_INSN_LSB0_P)
214 shift = (word_offset + start + 1) - length;
216 shift = total_length - (word_offset + start + length);
217 *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift);
220 #else /* ! CGEN_INT_INSN_P */
223 unsigned char *bufp = (unsigned char *) buffer + word_offset / 8;
225 insert_1 (cd, value, start, length, word_length, bufp);
228 #endif /* ! CGEN_INT_INSN_P */
233 /* Default insn builder (insert handler).
234 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
235 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
236 recorded in host byte order, otherwise BUFFER is an array of bytes
237 and the value is recorded in target byte order).
238 The result is an error message or NULL if success. */
241 insert_insn_normal (CGEN_CPU_DESC cd,
242 const CGEN_INSN * insn,
243 CGEN_FIELDS * fields,
244 CGEN_INSN_BYTES_PTR buffer,
247 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
249 const CGEN_SYNTAX_CHAR_TYPE * syn;
251 CGEN_INIT_INSERT (cd);
252 value = CGEN_INSN_BASE_VALUE (insn);
254 /* If we're recording insns as numbers (rather than a string of bytes),
255 target byte order handling is deferred until later. */
259 put_insn_int_value (cd, buffer, cd->base_insn_bitsize,
260 CGEN_FIELDS_BITSIZE (fields), value);
264 cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
265 (unsigned) CGEN_FIELDS_BITSIZE (fields)),
268 #endif /* ! CGEN_INT_INSN_P */
270 /* ??? It would be better to scan the format's fields.
271 Still need to be able to insert a value based on the operand though;
272 e.g. storing a branch displacement that got resolved later.
273 Needs more thought first. */
275 for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn)
279 if (CGEN_SYNTAX_CHAR_P (* syn))
282 errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
292 /* Cover function to store an insn value into an integral insn. Must go here
293 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
296 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
297 CGEN_INSN_BYTES_PTR buf,
302 /* For architectures with insns smaller than the base-insn-bitsize,
303 length may be too big. */
304 if (length > insn_length)
308 int shift = insn_length - length;
309 /* Written this way to avoid undefined behaviour. */
310 CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1;
312 *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
317 /* Operand extraction. */
319 #if ! CGEN_INT_INSN_P
321 /* Subroutine of extract_normal.
322 Ensure sufficient bytes are cached in EX_INFO.
323 OFFSET is the offset in bytes from the start of the insn of the value.
324 BYTES is the length of the needed value.
325 Returns 1 for success, 0 for failure. */
327 static CGEN_INLINE int
328 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
329 CGEN_EXTRACT_INFO *ex_info,
334 /* It's doubtful that the middle part has already been fetched so
335 we don't optimize that case. kiss. */
337 disassemble_info *info = (disassemble_info *) ex_info->dis_info;
339 /* First do a quick check. */
340 mask = (1 << bytes) - 1;
341 if (((ex_info->valid >> offset) & mask) == mask)
344 /* Search for the first byte we need to read. */
345 for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1)
346 if (! (mask & ex_info->valid))
354 status = (*info->read_memory_func)
355 (pc, ex_info->insn_bytes + offset, bytes, info);
359 (*info->memory_error_func) (status, pc, info);
363 ex_info->valid |= ((1 << bytes) - 1) << offset;
369 /* Subroutine of extract_normal. */
371 static CGEN_INLINE long
372 extract_1 (CGEN_CPU_DESC cd,
373 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
378 bfd_vma pc ATTRIBUTE_UNUSED)
383 x = cgen_get_insn_value (cd, bufp, word_length);
385 if (CGEN_INSN_LSB0_P)
386 shift = (start + 1) - length;
388 shift = (word_length - (start + length));
392 #endif /* ! CGEN_INT_INSN_P */
394 /* Default extraction routine.
396 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
397 or sometimes less for cases like the m32r where the base insn size is 32
398 but some insns are 16 bits.
399 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
400 but for generality we take a bitmask of all of them.
401 WORD_OFFSET is the offset in bits from the start of the insn of the value.
402 WORD_LENGTH is the length of the word in bits in which the value resides.
403 START is the starting bit number in the word, architecture origin.
404 LENGTH is the length of VALUE in bits.
405 TOTAL_LENGTH is the total length of the insn in bits.
407 Returns 1 for success, 0 for failure. */
409 /* ??? The return code isn't properly used. wip. */
411 /* ??? This doesn't handle bfd_vma's. Create another function when
415 extract_normal (CGEN_CPU_DESC cd,
416 #if ! CGEN_INT_INSN_P
417 CGEN_EXTRACT_INFO *ex_info,
419 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
421 CGEN_INSN_INT insn_value,
423 unsigned int word_offset,
426 unsigned int word_length,
427 unsigned int total_length,
428 #if ! CGEN_INT_INSN_P
431 bfd_vma pc ATTRIBUTE_UNUSED,
437 /* If LENGTH is zero, this operand doesn't contribute to the value
438 so give it a standard value of zero. */
445 if (word_length > 8 * sizeof (CGEN_INSN_INT))
448 /* For architectures with insns smaller than the insn-base-bitsize,
449 word_length may be too big. */
450 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
452 if (word_offset + word_length > total_length)
453 word_length = total_length - word_offset;
456 /* Does the value reside in INSN_VALUE, and at the right alignment? */
458 if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length))
460 if (CGEN_INSN_LSB0_P)
461 value = insn_value >> ((word_offset + start + 1) - length);
463 value = insn_value >> (total_length - ( word_offset + start + length));
466 #if ! CGEN_INT_INSN_P
470 unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
472 if (word_length > 8 * sizeof (CGEN_INSN_INT))
475 if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
478 value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc);
481 #endif /* ! CGEN_INT_INSN_P */
483 /* Written this way to avoid undefined behaviour. */
484 mask = (((1L << (length - 1)) - 1) << 1) | 1;
488 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
489 && (value & (1L << (length - 1))))
497 /* Default insn extractor.
499 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
500 The extracted fields are stored in FIELDS.
501 EX_INFO is used to handle reading variable length insns.
502 Return the length of the insn in bits, or 0 if no match,
503 or -1 if an error occurs fetching data (memory_error_func will have
507 extract_insn_normal (CGEN_CPU_DESC cd,
508 const CGEN_INSN *insn,
509 CGEN_EXTRACT_INFO *ex_info,
510 CGEN_INSN_INT insn_value,
514 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
515 const CGEN_SYNTAX_CHAR_TYPE *syn;
517 CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn);
519 CGEN_INIT_EXTRACT (cd);
521 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
525 if (CGEN_SYNTAX_CHAR_P (*syn))
528 length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
529 ex_info, insn_value, fields, pc);
534 /* We recognized and successfully extracted this insn. */
535 return CGEN_INSN_BITSIZE (insn);
538 /* Machine generated code added here. */
540 const char * m32c_cgen_insert_operand
541 (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
543 /* Main entry point for operand insertion.
545 This function is basically just a big switch statement. Earlier versions
546 used tables to look up the function to use, but
547 - if the table contains both assembler and disassembler functions then
548 the disassembler contains much of the assembler and vice-versa,
549 - there's a lot of inlining possibilities as things grow,
550 - using a switch statement avoids the function call overhead.
552 This function could be moved into `parse_insn_normal', but keeping it
553 separate makes clear the interface between `parse_insn_normal' and each of
554 the handlers. It's also needed by GAS to insert operands that couldn't be
555 resolved during parsing. */
558 m32c_cgen_insert_operand (CGEN_CPU_DESC cd,
560 CGEN_FIELDS * fields,
561 CGEN_INSN_BYTES_PTR buffer,
562 bfd_vma pc ATTRIBUTE_UNUSED)
564 const char * errmsg = NULL;
565 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
569 case M32C_OPERAND_A0 :
571 case M32C_OPERAND_A1 :
573 case M32C_OPERAND_AN16_PUSH_S :
574 errmsg = insert_normal (cd, fields->f_4_1, 0, 0, 4, 1, 32, total_length, buffer);
576 case M32C_OPERAND_BIT16AN :
577 errmsg = insert_normal (cd, fields->f_dst16_an, 0, 0, 15, 1, 32, total_length, buffer);
579 case M32C_OPERAND_BIT16RN :
580 errmsg = insert_normal (cd, fields->f_dst16_rn, 0, 0, 14, 2, 32, total_length, buffer);
582 case M32C_OPERAND_BIT3_S :
585 FLD (f_7_1) = ((((FLD (f_imm3_S)) - (1))) & (1));
586 FLD (f_2_2) = ((((UINT) (((FLD (f_imm3_S)) - (1))) >> (1))) & (3));
588 errmsg = insert_normal (cd, fields->f_2_2, 0, 0, 2, 2, 32, total_length, buffer);
591 errmsg = insert_normal (cd, fields->f_7_1, 0, 0, 7, 1, 32, total_length, buffer);
596 case M32C_OPERAND_BIT32ANPREFIXED :
597 errmsg = insert_normal (cd, fields->f_dst32_an_prefixed, 0, 0, 17, 1, 32, total_length, buffer);
599 case M32C_OPERAND_BIT32ANUNPREFIXED :
600 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
602 case M32C_OPERAND_BIT32RNPREFIXED :
604 long value = fields->f_dst32_rn_prefixed_QI;
605 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
606 errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer);
609 case M32C_OPERAND_BIT32RNUNPREFIXED :
611 long value = fields->f_dst32_rn_unprefixed_QI;
612 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
613 errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer);
616 case M32C_OPERAND_BITBASE16_16_S8 :
617 errmsg = insert_normal (cd, fields->f_dsp_16_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, buffer);
619 case M32C_OPERAND_BITBASE16_16_U16 :
621 long value = fields->f_dsp_16_u16;
622 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
623 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
626 case M32C_OPERAND_BITBASE16_16_U8 :
627 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
629 case M32C_OPERAND_BITBASE16_8_U11_S :
632 FLD (f_bitno16_S) = ((FLD (f_bitbase16_u11_S)) & (7));
633 FLD (f_dsp_8_u8) = ((((UINT) (FLD (f_bitbase16_u11_S)) >> (3))) & (255));
635 errmsg = insert_normal (cd, fields->f_bitno16_S, 0, 0, 5, 3, 32, total_length, buffer);
638 errmsg = insert_normal (cd, fields->f_dsp_8_u8, 0, 0, 8, 8, 32, total_length, buffer);
643 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
646 FLD (f_bitno32_unprefixed) = ((FLD (f_bitbase32_16_s11_unprefixed)) & (7));
647 FLD (f_dsp_16_s8) = ((INT) (FLD (f_bitbase32_16_s11_unprefixed)) >> (3));
649 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
652 errmsg = insert_normal (cd, fields->f_dsp_16_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, buffer);
657 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
660 FLD (f_bitno32_unprefixed) = ((FLD (f_bitbase32_16_s19_unprefixed)) & (7));
661 FLD (f_dsp_16_s16) = ((INT) (FLD (f_bitbase32_16_s19_unprefixed)) >> (3));
663 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
667 long value = fields->f_dsp_16_s16;
668 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
669 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
675 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
678 FLD (f_bitno32_unprefixed) = ((FLD (f_bitbase32_16_u11_unprefixed)) & (7));
679 FLD (f_dsp_16_u8) = ((((UINT) (FLD (f_bitbase32_16_u11_unprefixed)) >> (3))) & (255));
681 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
684 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
689 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
692 FLD (f_bitno32_unprefixed) = ((FLD (f_bitbase32_16_u19_unprefixed)) & (7));
693 FLD (f_dsp_16_u16) = ((((UINT) (FLD (f_bitbase32_16_u19_unprefixed)) >> (3))) & (65535));
695 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
699 long value = fields->f_dsp_16_u16;
700 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
701 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
707 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
710 FLD (f_bitno32_unprefixed) = ((FLD (f_bitbase32_16_u27_unprefixed)) & (7));
711 FLD (f_dsp_16_u16) = ((((UINT) (FLD (f_bitbase32_16_u27_unprefixed)) >> (3))) & (65535));
712 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_bitbase32_16_u27_unprefixed)) >> (19))) & (255));
714 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
718 long value = fields->f_dsp_16_u16;
719 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
720 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
724 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
729 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
732 FLD (f_bitno32_prefixed) = ((FLD (f_bitbase32_24_s11_prefixed)) & (7));
733 FLD (f_dsp_24_s8) = ((INT) (FLD (f_bitbase32_24_s11_prefixed)) >> (3));
735 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
738 errmsg = insert_normal (cd, fields->f_dsp_24_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, buffer);
743 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
746 FLD (f_bitno32_prefixed) = ((FLD (f_bitbase32_24_s19_prefixed)) & (7));
747 FLD (f_dsp_24_u8) = ((((UINT) (FLD (f_bitbase32_24_s19_prefixed)) >> (3))) & (255));
748 FLD (f_dsp_32_s8) = ((INT) (FLD (f_bitbase32_24_s19_prefixed)) >> (11));
750 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
753 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
756 errmsg = insert_normal (cd, fields->f_dsp_32_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, buffer);
761 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
764 FLD (f_bitno32_prefixed) = ((FLD (f_bitbase32_24_u11_prefixed)) & (7));
765 FLD (f_dsp_24_u8) = ((((UINT) (FLD (f_bitbase32_24_u11_prefixed)) >> (3))) & (255));
767 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
770 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
775 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
778 FLD (f_bitno32_prefixed) = ((FLD (f_bitbase32_24_u19_prefixed)) & (7));
779 FLD (f_dsp_24_u8) = ((((UINT) (FLD (f_bitbase32_24_u19_prefixed)) >> (3))) & (255));
780 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_bitbase32_24_u19_prefixed)) >> (11))) & (255));
782 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
785 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
788 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
793 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
796 FLD (f_bitno32_prefixed) = ((FLD (f_bitbase32_24_u27_prefixed)) & (7));
797 FLD (f_dsp_24_u8) = ((((UINT) (FLD (f_bitbase32_24_u27_prefixed)) >> (3))) & (255));
798 FLD (f_dsp_32_u16) = ((((UINT) (FLD (f_bitbase32_24_u27_prefixed)) >> (11))) & (65535));
800 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
803 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
807 long value = fields->f_dsp_32_u16;
808 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
809 errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer);
815 case M32C_OPERAND_BITNO16R :
816 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
818 case M32C_OPERAND_BITNO32PREFIXED :
819 errmsg = insert_normal (cd, fields->f_bitno32_prefixed, 0, 0, 21, 3, 32, total_length, buffer);
821 case M32C_OPERAND_BITNO32UNPREFIXED :
822 errmsg = insert_normal (cd, fields->f_bitno32_unprefixed, 0, 0, 13, 3, 32, total_length, buffer);
824 case M32C_OPERAND_DSP_10_U6 :
825 errmsg = insert_normal (cd, fields->f_dsp_10_u6, 0, 0, 10, 6, 32, total_length, buffer);
827 case M32C_OPERAND_DSP_16_S16 :
829 long value = fields->f_dsp_16_s16;
830 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
831 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
834 case M32C_OPERAND_DSP_16_S8 :
835 errmsg = insert_normal (cd, fields->f_dsp_16_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, buffer);
837 case M32C_OPERAND_DSP_16_U16 :
839 long value = fields->f_dsp_16_u16;
840 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
841 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
844 case M32C_OPERAND_DSP_16_U20 :
847 FLD (f_dsp_16_u16) = ((FLD (f_dsp_16_u24)) & (65535));
848 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_dsp_16_u24)) >> (16))) & (255));
851 long value = fields->f_dsp_16_u16;
852 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
853 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
857 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
862 case M32C_OPERAND_DSP_16_U24 :
865 FLD (f_dsp_16_u16) = ((FLD (f_dsp_16_u24)) & (65535));
866 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_dsp_16_u24)) >> (16))) & (255));
869 long value = fields->f_dsp_16_u16;
870 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
871 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
875 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
880 case M32C_OPERAND_DSP_16_U8 :
881 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
883 case M32C_OPERAND_DSP_24_S16 :
886 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_s16)) & (255));
887 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_dsp_24_s16)) >> (8))) & (255));
889 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
892 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
897 case M32C_OPERAND_DSP_24_S8 :
898 errmsg = insert_normal (cd, fields->f_dsp_24_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, buffer);
900 case M32C_OPERAND_DSP_24_U16 :
903 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_u16)) & (255));
904 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_dsp_24_u16)) >> (8))) & (255));
906 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
909 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
914 case M32C_OPERAND_DSP_24_U20 :
917 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_u24)) & (255));
918 FLD (f_dsp_32_u16) = ((((UINT) (FLD (f_dsp_24_u24)) >> (8))) & (65535));
920 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
924 long value = fields->f_dsp_32_u16;
925 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
926 errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer);
932 case M32C_OPERAND_DSP_24_U24 :
935 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_u24)) & (255));
936 FLD (f_dsp_32_u16) = ((((UINT) (FLD (f_dsp_24_u24)) >> (8))) & (65535));
938 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
942 long value = fields->f_dsp_32_u16;
943 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
944 errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer);
950 case M32C_OPERAND_DSP_24_U8 :
951 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
953 case M32C_OPERAND_DSP_32_S16 :
955 long value = fields->f_dsp_32_s16;
956 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
957 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, buffer);
960 case M32C_OPERAND_DSP_32_S8 :
961 errmsg = insert_normal (cd, fields->f_dsp_32_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, buffer);
963 case M32C_OPERAND_DSP_32_U16 :
965 long value = fields->f_dsp_32_u16;
966 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
967 errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer);
970 case M32C_OPERAND_DSP_32_U20 :
972 long value = fields->f_dsp_32_u24;
973 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
974 errmsg = insert_normal (cd, value, 0, 32, 0, 24, 32, total_length, buffer);
977 case M32C_OPERAND_DSP_32_U24 :
979 long value = fields->f_dsp_32_u24;
980 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
981 errmsg = insert_normal (cd, value, 0, 32, 0, 24, 32, total_length, buffer);
984 case M32C_OPERAND_DSP_32_U8 :
985 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
987 case M32C_OPERAND_DSP_40_S16 :
989 long value = fields->f_dsp_40_s16;
990 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
991 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, buffer);
994 case M32C_OPERAND_DSP_40_S8 :
995 errmsg = insert_normal (cd, fields->f_dsp_40_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 8, 32, total_length, buffer);
997 case M32C_OPERAND_DSP_40_U16 :
999 long value = fields->f_dsp_40_u16;
1000 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1001 errmsg = insert_normal (cd, value, 0, 32, 8, 16, 32, total_length, buffer);
1004 case M32C_OPERAND_DSP_40_U20 :
1006 long value = fields->f_dsp_40_u20;
1007 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040))));
1008 errmsg = insert_normal (cd, value, 0, 32, 8, 20, 32, total_length, buffer);
1011 case M32C_OPERAND_DSP_40_U24 :
1013 long value = fields->f_dsp_40_u24;
1014 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
1015 errmsg = insert_normal (cd, value, 0, 32, 8, 24, 32, total_length, buffer);
1018 case M32C_OPERAND_DSP_40_U8 :
1019 errmsg = insert_normal (cd, fields->f_dsp_40_u8, 0, 32, 8, 8, 32, total_length, buffer);
1021 case M32C_OPERAND_DSP_48_S16 :
1023 long value = fields->f_dsp_48_s16;
1024 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1025 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, buffer);
1028 case M32C_OPERAND_DSP_48_S8 :
1029 errmsg = insert_normal (cd, fields->f_dsp_48_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 8, 32, total_length, buffer);
1031 case M32C_OPERAND_DSP_48_U16 :
1033 long value = fields->f_dsp_48_u16;
1034 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1035 errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer);
1038 case M32C_OPERAND_DSP_48_U20 :
1041 FLD (f_dsp_64_u8) = ((((UINT) (FLD (f_dsp_48_u20)) >> (16))) & (15));
1042 FLD (f_dsp_48_u16) = ((FLD (f_dsp_48_u20)) & (65535));
1045 long value = fields->f_dsp_48_u16;
1046 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1047 errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer);
1051 errmsg = insert_normal (cd, fields->f_dsp_64_u8, 0, 64, 0, 8, 32, total_length, buffer);
1056 case M32C_OPERAND_DSP_48_U24 :
1059 FLD (f_dsp_64_u8) = ((((UINT) (FLD (f_dsp_48_u24)) >> (16))) & (255));
1060 FLD (f_dsp_48_u16) = ((FLD (f_dsp_48_u24)) & (65535));
1063 long value = fields->f_dsp_48_u16;
1064 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1065 errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer);
1069 errmsg = insert_normal (cd, fields->f_dsp_64_u8, 0, 64, 0, 8, 32, total_length, buffer);
1074 case M32C_OPERAND_DSP_48_U8 :
1075 errmsg = insert_normal (cd, fields->f_dsp_48_u8, 0, 32, 16, 8, 32, total_length, buffer);
1077 case M32C_OPERAND_DSP_8_S24 :
1079 long value = fields->f_dsp_8_s24;
1080 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((EXTQISI (TRUNCSIQI (((value) & (255))))) << (16))));
1081 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 24, 32, total_length, buffer);
1084 case M32C_OPERAND_DSP_8_S8 :
1085 errmsg = insert_normal (cd, fields->f_dsp_8_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, buffer);
1087 case M32C_OPERAND_DSP_8_U16 :
1089 long value = fields->f_dsp_8_u16;
1090 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1091 errmsg = insert_normal (cd, value, 0, 0, 8, 16, 32, total_length, buffer);
1094 case M32C_OPERAND_DSP_8_U24 :
1096 long value = fields->f_dsp_8_u24;
1097 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
1098 errmsg = insert_normal (cd, value, 0, 0, 8, 24, 32, total_length, buffer);
1101 case M32C_OPERAND_DSP_8_U6 :
1102 errmsg = insert_normal (cd, fields->f_dsp_8_u6, 0, 0, 8, 6, 32, total_length, buffer);
1104 case M32C_OPERAND_DSP_8_U8 :
1105 errmsg = insert_normal (cd, fields->f_dsp_8_u8, 0, 0, 8, 8, 32, total_length, buffer);
1107 case M32C_OPERAND_DST16AN :
1108 errmsg = insert_normal (cd, fields->f_dst16_an, 0, 0, 15, 1, 32, total_length, buffer);
1110 case M32C_OPERAND_DST16AN_S :
1111 errmsg = insert_normal (cd, fields->f_dst16_an_s, 0, 0, 4, 1, 32, total_length, buffer);
1113 case M32C_OPERAND_DST16ANHI :
1114 errmsg = insert_normal (cd, fields->f_dst16_an, 0, 0, 15, 1, 32, total_length, buffer);
1116 case M32C_OPERAND_DST16ANQI :
1117 errmsg = insert_normal (cd, fields->f_dst16_an, 0, 0, 15, 1, 32, total_length, buffer);
1119 case M32C_OPERAND_DST16ANQI_S :
1120 errmsg = insert_normal (cd, fields->f_dst16_rn_QI_s, 0, 0, 5, 1, 32, total_length, buffer);
1122 case M32C_OPERAND_DST16ANSI :
1123 errmsg = insert_normal (cd, fields->f_dst16_an, 0, 0, 15, 1, 32, total_length, buffer);
1125 case M32C_OPERAND_DST16RNEXTQI :
1126 errmsg = insert_normal (cd, fields->f_dst16_rn_ext, 0, 0, 14, 1, 32, total_length, buffer);
1128 case M32C_OPERAND_DST16RNHI :
1129 errmsg = insert_normal (cd, fields->f_dst16_rn, 0, 0, 14, 2, 32, total_length, buffer);
1131 case M32C_OPERAND_DST16RNQI :
1132 errmsg = insert_normal (cd, fields->f_dst16_rn, 0, 0, 14, 2, 32, total_length, buffer);
1134 case M32C_OPERAND_DST16RNQI_S :
1135 errmsg = insert_normal (cd, fields->f_dst16_rn_QI_s, 0, 0, 5, 1, 32, total_length, buffer);
1137 case M32C_OPERAND_DST16RNSI :
1138 errmsg = insert_normal (cd, fields->f_dst16_rn, 0, 0, 14, 2, 32, total_length, buffer);
1140 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
1141 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1143 case M32C_OPERAND_DST32ANPREFIXED :
1144 errmsg = insert_normal (cd, fields->f_dst32_an_prefixed, 0, 0, 17, 1, 32, total_length, buffer);
1146 case M32C_OPERAND_DST32ANPREFIXEDHI :
1147 errmsg = insert_normal (cd, fields->f_dst32_an_prefixed, 0, 0, 17, 1, 32, total_length, buffer);
1149 case M32C_OPERAND_DST32ANPREFIXEDQI :
1150 errmsg = insert_normal (cd, fields->f_dst32_an_prefixed, 0, 0, 17, 1, 32, total_length, buffer);
1152 case M32C_OPERAND_DST32ANPREFIXEDSI :
1153 errmsg = insert_normal (cd, fields->f_dst32_an_prefixed, 0, 0, 17, 1, 32, total_length, buffer);
1155 case M32C_OPERAND_DST32ANUNPREFIXED :
1156 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1158 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
1159 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1161 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
1162 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1164 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
1165 errmsg = insert_normal (cd, fields->f_dst32_an_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1167 case M32C_OPERAND_DST32R0HI_S :
1169 case M32C_OPERAND_DST32R0QI_S :
1171 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
1172 errmsg = insert_normal (cd, fields->f_dst32_rn_ext_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1174 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
1175 errmsg = insert_normal (cd, fields->f_dst32_rn_ext_unprefixed, 0, 0, 9, 1, 32, total_length, buffer);
1177 case M32C_OPERAND_DST32RNPREFIXEDHI :
1179 long value = fields->f_dst32_rn_prefixed_HI;
1180 value = ((((value) + (2))) % (4));
1181 errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer);
1184 case M32C_OPERAND_DST32RNPREFIXEDQI :
1186 long value = fields->f_dst32_rn_prefixed_QI;
1187 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
1188 errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer);
1191 case M32C_OPERAND_DST32RNPREFIXEDSI :
1193 long value = fields->f_dst32_rn_prefixed_SI;
1194 value = ((value) + (2));
1195 errmsg = insert_normal (cd, value, 0, 0, 16, 2, 32, total_length, buffer);
1198 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
1200 long value = fields->f_dst32_rn_unprefixed_HI;
1201 value = ((((value) + (2))) % (4));
1202 errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer);
1205 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
1207 long value = fields->f_dst32_rn_unprefixed_QI;
1208 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
1209 errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer);
1212 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
1214 long value = fields->f_dst32_rn_unprefixed_SI;
1215 value = ((value) + (2));
1216 errmsg = insert_normal (cd, value, 0, 0, 8, 2, 32, total_length, buffer);
1219 case M32C_OPERAND_G :
1221 case M32C_OPERAND_IMM_12_S4 :
1222 errmsg = insert_normal (cd, fields->f_imm_12_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, buffer);
1224 case M32C_OPERAND_IMM_12_S4N :
1225 errmsg = insert_normal (cd, fields->f_imm_12_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, buffer);
1227 case M32C_OPERAND_IMM_13_U3 :
1228 errmsg = insert_normal (cd, fields->f_imm_13_u3, 0, 0, 13, 3, 32, total_length, buffer);
1230 case M32C_OPERAND_IMM_16_HI :
1232 long value = fields->f_dsp_16_s16;
1233 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1234 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
1237 case M32C_OPERAND_IMM_16_QI :
1238 errmsg = insert_normal (cd, fields->f_dsp_16_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, buffer);
1240 case M32C_OPERAND_IMM_16_SI :
1243 FLD (f_dsp_32_u16) = ((((UINT) (FLD (f_dsp_16_s32)) >> (16))) & (65535));
1244 FLD (f_dsp_16_u16) = ((FLD (f_dsp_16_s32)) & (65535));
1247 long value = fields->f_dsp_16_u16;
1248 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1249 errmsg = insert_normal (cd, value, 0, 0, 16, 16, 32, total_length, buffer);
1254 long value = fields->f_dsp_32_u16;
1255 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1256 errmsg = insert_normal (cd, value, 0, 32, 0, 16, 32, total_length, buffer);
1262 case M32C_OPERAND_IMM_20_S4 :
1263 errmsg = insert_normal (cd, fields->f_imm_20_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 4, 32, total_length, buffer);
1265 case M32C_OPERAND_IMM_24_HI :
1268 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_s16)) & (255));
1269 FLD (f_dsp_32_u8) = ((((UINT) (FLD (f_dsp_24_s16)) >> (8))) & (255));
1271 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
1274 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
1279 case M32C_OPERAND_IMM_24_QI :
1280 errmsg = insert_normal (cd, fields->f_dsp_24_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, buffer);
1282 case M32C_OPERAND_IMM_24_SI :
1285 FLD (f_dsp_32_u24) = ((((UINT) (FLD (f_dsp_24_s32)) >> (8))) & (16777215));
1286 FLD (f_dsp_24_u8) = ((FLD (f_dsp_24_s32)) & (255));
1288 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
1292 long value = fields->f_dsp_32_u24;
1293 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
1294 errmsg = insert_normal (cd, value, 0, 32, 0, 24, 32, total_length, buffer);
1300 case M32C_OPERAND_IMM_32_HI :
1302 long value = fields->f_dsp_32_s16;
1303 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1304 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, buffer);
1307 case M32C_OPERAND_IMM_32_QI :
1308 errmsg = insert_normal (cd, fields->f_dsp_32_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, buffer);
1310 case M32C_OPERAND_IMM_32_SI :
1312 long value = fields->f_dsp_32_s32;
1313 value = EXTSISI (((((((((UINT) (value) >> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) << (8))) & (16711680))) | (((((value) << (24))) & (0xff000000)))))));
1314 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 32, 32, total_length, buffer);
1317 case M32C_OPERAND_IMM_40_HI :
1319 long value = fields->f_dsp_40_s16;
1320 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1321 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, buffer);
1324 case M32C_OPERAND_IMM_40_QI :
1325 errmsg = insert_normal (cd, fields->f_dsp_40_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 8, 32, total_length, buffer);
1327 case M32C_OPERAND_IMM_40_SI :
1330 FLD (f_dsp_64_u8) = ((((UINT) (FLD (f_dsp_40_s32)) >> (24))) & (255));
1331 FLD (f_dsp_40_u24) = ((FLD (f_dsp_40_s32)) & (16777215));
1334 long value = fields->f_dsp_40_u24;
1335 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
1336 errmsg = insert_normal (cd, value, 0, 32, 8, 24, 32, total_length, buffer);
1340 errmsg = insert_normal (cd, fields->f_dsp_64_u8, 0, 64, 0, 8, 32, total_length, buffer);
1345 case M32C_OPERAND_IMM_48_HI :
1347 long value = fields->f_dsp_48_s16;
1348 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1349 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, buffer);
1352 case M32C_OPERAND_IMM_48_QI :
1353 errmsg = insert_normal (cd, fields->f_dsp_48_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 8, 32, total_length, buffer);
1355 case M32C_OPERAND_IMM_48_SI :
1358 FLD (f_dsp_64_u16) = ((((UINT) (FLD (f_dsp_48_s32)) >> (16))) & (65535));
1359 FLD (f_dsp_48_u16) = ((FLD (f_dsp_48_s32)) & (65535));
1362 long value = fields->f_dsp_48_u16;
1363 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1364 errmsg = insert_normal (cd, value, 0, 32, 16, 16, 32, total_length, buffer);
1369 long value = fields->f_dsp_64_u16;
1370 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1371 errmsg = insert_normal (cd, value, 0, 64, 0, 16, 32, total_length, buffer);
1377 case M32C_OPERAND_IMM_56_HI :
1380 FLD (f_dsp_56_u8) = ((FLD (f_dsp_56_s16)) & (255));
1381 FLD (f_dsp_64_u8) = ((((UINT) (FLD (f_dsp_56_s16)) >> (8))) & (255));
1383 errmsg = insert_normal (cd, fields->f_dsp_56_u8, 0, 32, 24, 8, 32, total_length, buffer);
1386 errmsg = insert_normal (cd, fields->f_dsp_64_u8, 0, 64, 0, 8, 32, total_length, buffer);
1391 case M32C_OPERAND_IMM_56_QI :
1392 errmsg = insert_normal (cd, fields->f_dsp_56_s8, 0|(1<<CGEN_IFLD_SIGNED), 32, 24, 8, 32, total_length, buffer);
1394 case M32C_OPERAND_IMM_64_HI :
1396 long value = fields->f_dsp_64_s16;
1397 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1398 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 64, 0, 16, 32, total_length, buffer);
1401 case M32C_OPERAND_IMM_8_HI :
1403 long value = fields->f_dsp_8_s16;
1404 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1405 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 16, 32, total_length, buffer);
1408 case M32C_OPERAND_IMM_8_QI :
1409 errmsg = insert_normal (cd, fields->f_dsp_8_s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, buffer);
1411 case M32C_OPERAND_IMM_8_S4 :
1412 errmsg = insert_normal (cd, fields->f_imm_8_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, buffer);
1414 case M32C_OPERAND_IMM_8_S4N :
1415 errmsg = insert_normal (cd, fields->f_imm_8_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, buffer);
1417 case M32C_OPERAND_IMM_SH_12_S4 :
1418 errmsg = insert_normal (cd, fields->f_imm_12_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, buffer);
1420 case M32C_OPERAND_IMM_SH_20_S4 :
1421 errmsg = insert_normal (cd, fields->f_imm_20_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 4, 32, total_length, buffer);
1423 case M32C_OPERAND_IMM_SH_8_S4 :
1424 errmsg = insert_normal (cd, fields->f_imm_8_s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, buffer);
1426 case M32C_OPERAND_IMM1_S :
1428 long value = fields->f_imm1_S;
1429 value = ((value) - (1));
1430 errmsg = insert_normal (cd, value, 0, 0, 2, 1, 32, total_length, buffer);
1433 case M32C_OPERAND_IMM3_S :
1436 FLD (f_7_1) = ((((FLD (f_imm3_S)) - (1))) & (1));
1437 FLD (f_2_2) = ((((UINT) (((FLD (f_imm3_S)) - (1))) >> (1))) & (3));
1439 errmsg = insert_normal (cd, fields->f_2_2, 0, 0, 2, 2, 32, total_length, buffer);
1442 errmsg = insert_normal (cd, fields->f_7_1, 0, 0, 7, 1, 32, total_length, buffer);
1447 case M32C_OPERAND_LAB_16_8 :
1449 long value = fields->f_lab_16_8;
1450 value = ((value) - (((pc) + (2))));
1451 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 8, 32, total_length, buffer);
1454 case M32C_OPERAND_LAB_24_8 :
1456 long value = fields->f_lab_24_8;
1457 value = ((value) - (((pc) + (2))));
1458 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 24, 8, 32, total_length, buffer);
1461 case M32C_OPERAND_LAB_32_8 :
1463 long value = fields->f_lab_32_8;
1464 value = ((value) - (((pc) + (2))));
1465 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 0, 8, 32, total_length, buffer);
1468 case M32C_OPERAND_LAB_40_8 :
1470 long value = fields->f_lab_40_8;
1471 value = ((value) - (((pc) + (2))));
1472 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 8, 8, 32, total_length, buffer);
1475 case M32C_OPERAND_LAB_5_3 :
1477 long value = fields->f_lab_5_3;
1478 value = ((value) - (((pc) + (2))));
1479 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 3, 32, total_length, buffer);
1482 case M32C_OPERAND_LAB_8_16 :
1484 long value = fields->f_lab_8_16;
1485 value = ((((((((value) - (((pc) + (1))))) & (255))) << (8))) | (((USI) (((((value) - (((pc) + (1))))) & (65535))) >> (8))));
1486 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGN_OPT)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 16, 32, total_length, buffer);
1489 case M32C_OPERAND_LAB_8_24 :
1491 long value = fields->f_lab_8_24;
1492 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
1493 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 8, 24, 32, total_length, buffer);
1496 case M32C_OPERAND_LAB_8_8 :
1498 long value = fields->f_lab_8_8;
1499 value = ((value) - (((pc) + (1))));
1500 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 32, total_length, buffer);
1503 case M32C_OPERAND_LAB32_JMP_S :
1507 tmp_val = ((((FLD (f_lab32_jmp_s)) - (pc))) - (2));
1508 FLD (f_7_1) = ((tmp_val) & (1));
1509 FLD (f_2_2) = ((USI) (tmp_val) >> (1));
1511 errmsg = insert_normal (cd, fields->f_2_2, 0, 0, 2, 2, 32, total_length, buffer);
1514 errmsg = insert_normal (cd, fields->f_7_1, 0, 0, 7, 1, 32, total_length, buffer);
1519 case M32C_OPERAND_Q :
1521 case M32C_OPERAND_R0 :
1523 case M32C_OPERAND_R0H :
1525 case M32C_OPERAND_R0L :
1527 case M32C_OPERAND_R1 :
1529 case M32C_OPERAND_R1R2R0 :
1531 case M32C_OPERAND_R2 :
1533 case M32C_OPERAND_R2R0 :
1535 case M32C_OPERAND_R3 :
1537 case M32C_OPERAND_R3R1 :
1539 case M32C_OPERAND_REGSETPOP :
1540 errmsg = insert_normal (cd, fields->f_8_8, 0, 0, 8, 8, 32, total_length, buffer);
1542 case M32C_OPERAND_REGSETPUSH :
1543 errmsg = insert_normal (cd, fields->f_8_8, 0, 0, 8, 8, 32, total_length, buffer);
1545 case M32C_OPERAND_RN16_PUSH_S :
1546 errmsg = insert_normal (cd, fields->f_4_1, 0, 0, 4, 1, 32, total_length, buffer);
1548 case M32C_OPERAND_S :
1550 case M32C_OPERAND_SRC16AN :
1551 errmsg = insert_normal (cd, fields->f_src16_an, 0, 0, 11, 1, 32, total_length, buffer);
1553 case M32C_OPERAND_SRC16ANHI :
1554 errmsg = insert_normal (cd, fields->f_src16_an, 0, 0, 11, 1, 32, total_length, buffer);
1556 case M32C_OPERAND_SRC16ANQI :
1557 errmsg = insert_normal (cd, fields->f_src16_an, 0, 0, 11, 1, 32, total_length, buffer);
1559 case M32C_OPERAND_SRC16RNHI :
1560 errmsg = insert_normal (cd, fields->f_src16_rn, 0, 0, 10, 2, 32, total_length, buffer);
1562 case M32C_OPERAND_SRC16RNQI :
1563 errmsg = insert_normal (cd, fields->f_src16_rn, 0, 0, 10, 2, 32, total_length, buffer);
1565 case M32C_OPERAND_SRC32ANPREFIXED :
1566 errmsg = insert_normal (cd, fields->f_src32_an_prefixed, 0, 0, 19, 1, 32, total_length, buffer);
1568 case M32C_OPERAND_SRC32ANPREFIXEDHI :
1569 errmsg = insert_normal (cd, fields->f_src32_an_prefixed, 0, 0, 19, 1, 32, total_length, buffer);
1571 case M32C_OPERAND_SRC32ANPREFIXEDQI :
1572 errmsg = insert_normal (cd, fields->f_src32_an_prefixed, 0, 0, 19, 1, 32, total_length, buffer);
1574 case M32C_OPERAND_SRC32ANPREFIXEDSI :
1575 errmsg = insert_normal (cd, fields->f_src32_an_prefixed, 0, 0, 19, 1, 32, total_length, buffer);
1577 case M32C_OPERAND_SRC32ANUNPREFIXED :
1578 errmsg = insert_normal (cd, fields->f_src32_an_unprefixed, 0, 0, 11, 1, 32, total_length, buffer);
1580 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
1581 errmsg = insert_normal (cd, fields->f_src32_an_unprefixed, 0, 0, 11, 1, 32, total_length, buffer);
1583 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
1584 errmsg = insert_normal (cd, fields->f_src32_an_unprefixed, 0, 0, 11, 1, 32, total_length, buffer);
1586 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
1587 errmsg = insert_normal (cd, fields->f_src32_an_unprefixed, 0, 0, 11, 1, 32, total_length, buffer);
1589 case M32C_OPERAND_SRC32RNPREFIXEDHI :
1591 long value = fields->f_src32_rn_prefixed_HI;
1592 value = ((((value) + (2))) % (4));
1593 errmsg = insert_normal (cd, value, 0, 0, 18, 2, 32, total_length, buffer);
1596 case M32C_OPERAND_SRC32RNPREFIXEDQI :
1598 long value = fields->f_src32_rn_prefixed_QI;
1599 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
1600 errmsg = insert_normal (cd, value, 0, 0, 18, 2, 32, total_length, buffer);
1603 case M32C_OPERAND_SRC32RNPREFIXEDSI :
1605 long value = fields->f_src32_rn_prefixed_SI;
1606 value = ((value) + (2));
1607 errmsg = insert_normal (cd, value, 0, 0, 18, 2, 32, total_length, buffer);
1610 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
1612 long value = fields->f_src32_rn_unprefixed_HI;
1613 value = ((((value) + (2))) % (4));
1614 errmsg = insert_normal (cd, value, 0, 0, 10, 2, 32, total_length, buffer);
1617 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
1619 long value = fields->f_src32_rn_unprefixed_QI;
1620 value = (((((((~ (value))) << (1))) & (2))) | (((((USI) (value) >> (1))) & (1))));
1621 errmsg = insert_normal (cd, value, 0, 0, 10, 2, 32, total_length, buffer);
1624 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
1626 long value = fields->f_src32_rn_unprefixed_SI;
1627 value = ((value) + (2));
1628 errmsg = insert_normal (cd, value, 0, 0, 10, 2, 32, total_length, buffer);
1631 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
1632 errmsg = insert_normal (cd, fields->f_5_1, 0, 0, 5, 1, 32, total_length, buffer);
1634 case M32C_OPERAND_X :
1636 case M32C_OPERAND_Z :
1638 case M32C_OPERAND_COND16_16 :
1639 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
1641 case M32C_OPERAND_COND16_24 :
1642 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
1644 case M32C_OPERAND_COND16_32 :
1645 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
1647 case M32C_OPERAND_COND16C :
1648 errmsg = insert_normal (cd, fields->f_cond16, 0, 0, 12, 4, 32, total_length, buffer);
1650 case M32C_OPERAND_COND16J :
1651 errmsg = insert_normal (cd, fields->f_cond16, 0, 0, 12, 4, 32, total_length, buffer);
1653 case M32C_OPERAND_COND16J5 :
1654 errmsg = insert_normal (cd, fields->f_cond16j_5, 0, 0, 5, 3, 32, total_length, buffer);
1656 case M32C_OPERAND_COND32 :
1659 FLD (f_9_1) = ((((UINT) (FLD (f_cond32)) >> (3))) & (1));
1660 FLD (f_13_3) = ((FLD (f_cond32)) & (7));
1662 errmsg = insert_normal (cd, fields->f_9_1, 0, 0, 9, 1, 32, total_length, buffer);
1665 errmsg = insert_normal (cd, fields->f_13_3, 0, 0, 13, 3, 32, total_length, buffer);
1670 case M32C_OPERAND_COND32_16 :
1671 errmsg = insert_normal (cd, fields->f_dsp_16_u8, 0, 0, 16, 8, 32, total_length, buffer);
1673 case M32C_OPERAND_COND32_24 :
1674 errmsg = insert_normal (cd, fields->f_dsp_24_u8, 0, 0, 24, 8, 32, total_length, buffer);
1676 case M32C_OPERAND_COND32_32 :
1677 errmsg = insert_normal (cd, fields->f_dsp_32_u8, 0, 32, 0, 8, 32, total_length, buffer);
1679 case M32C_OPERAND_COND32_40 :
1680 errmsg = insert_normal (cd, fields->f_dsp_40_u8, 0, 32, 8, 8, 32, total_length, buffer);
1682 case M32C_OPERAND_COND32J :
1685 FLD (f_1_3) = ((((UINT) (FLD (f_cond32j)) >> (1))) & (7));
1686 FLD (f_7_1) = ((FLD (f_cond32j)) & (1));
1688 errmsg = insert_normal (cd, fields->f_1_3, 0, 0, 1, 3, 32, total_length, buffer);
1691 errmsg = insert_normal (cd, fields->f_7_1, 0, 0, 7, 1, 32, total_length, buffer);
1696 case M32C_OPERAND_CR1_PREFIXED_32 :
1697 errmsg = insert_normal (cd, fields->f_21_3, 0, 0, 21, 3, 32, total_length, buffer);
1699 case M32C_OPERAND_CR1_UNPREFIXED_32 :
1700 errmsg = insert_normal (cd, fields->f_13_3, 0, 0, 13, 3, 32, total_length, buffer);
1702 case M32C_OPERAND_CR16 :
1703 errmsg = insert_normal (cd, fields->f_9_3, 0, 0, 9, 3, 32, total_length, buffer);
1705 case M32C_OPERAND_CR2_32 :
1706 errmsg = insert_normal (cd, fields->f_13_3, 0, 0, 13, 3, 32, total_length, buffer);
1708 case M32C_OPERAND_CR3_PREFIXED_32 :
1709 errmsg = insert_normal (cd, fields->f_21_3, 0, 0, 21, 3, 32, total_length, buffer);
1711 case M32C_OPERAND_CR3_UNPREFIXED_32 :
1712 errmsg = insert_normal (cd, fields->f_13_3, 0, 0, 13, 3, 32, total_length, buffer);
1714 case M32C_OPERAND_FLAGS16 :
1715 errmsg = insert_normal (cd, fields->f_9_3, 0, 0, 9, 3, 32, total_length, buffer);
1717 case M32C_OPERAND_FLAGS32 :
1718 errmsg = insert_normal (cd, fields->f_13_3, 0, 0, 13, 3, 32, total_length, buffer);
1720 case M32C_OPERAND_SCCOND32 :
1721 errmsg = insert_normal (cd, fields->f_cond16, 0, 0, 12, 4, 32, total_length, buffer);
1723 case M32C_OPERAND_SIZE :
1727 /* xgettext:c-format */
1728 fprintf (stderr, _("Unrecognized field %d while building insn.\n"),
1736 int m32c_cgen_extract_operand
1737 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
1739 /* Main entry point for operand extraction.
1740 The result is <= 0 for error, >0 for success.
1741 ??? Actual values aren't well defined right now.
1743 This function is basically just a big switch statement. Earlier versions
1744 used tables to look up the function to use, but
1745 - if the table contains both assembler and disassembler functions then
1746 the disassembler contains much of the assembler and vice-versa,
1747 - there's a lot of inlining possibilities as things grow,
1748 - using a switch statement avoids the function call overhead.
1750 This function could be moved into `print_insn_normal', but keeping it
1751 separate makes clear the interface between `print_insn_normal' and each of
1755 m32c_cgen_extract_operand (CGEN_CPU_DESC cd,
1757 CGEN_EXTRACT_INFO *ex_info,
1758 CGEN_INSN_INT insn_value,
1759 CGEN_FIELDS * fields,
1762 /* Assume success (for those operands that are nops). */
1764 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
1768 case M32C_OPERAND_A0 :
1770 case M32C_OPERAND_A1 :
1772 case M32C_OPERAND_AN16_PUSH_S :
1773 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 1, 32, total_length, pc, & fields->f_4_1);
1775 case M32C_OPERAND_BIT16AN :
1776 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_dst16_an);
1778 case M32C_OPERAND_BIT16RN :
1779 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 2, 32, total_length, pc, & fields->f_dst16_rn);
1781 case M32C_OPERAND_BIT3_S :
1783 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 2, 32, total_length, pc, & fields->f_2_2);
1784 if (length <= 0) break;
1785 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7_1);
1786 if (length <= 0) break;
1788 FLD (f_imm3_S) = ((((((FLD (f_2_2)) << (1))) | (FLD (f_7_1)))) + (1));
1792 case M32C_OPERAND_BIT32ANPREFIXED :
1793 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_dst32_an_prefixed);
1795 case M32C_OPERAND_BIT32ANUNPREFIXED :
1796 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
1798 case M32C_OPERAND_BIT32RNPREFIXED :
1801 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
1802 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
1803 fields->f_dst32_rn_prefixed_QI = value;
1806 case M32C_OPERAND_BIT32RNUNPREFIXED :
1809 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
1810 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
1811 fields->f_dst32_rn_unprefixed_QI = value;
1814 case M32C_OPERAND_BITBASE16_16_S8 :
1815 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_s8);
1817 case M32C_OPERAND_BITBASE16_16_U16 :
1820 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
1821 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1822 fields->f_dsp_16_u16 = value;
1825 case M32C_OPERAND_BITBASE16_16_U8 :
1826 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
1828 case M32C_OPERAND_BITBASE16_8_U11_S :
1830 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_bitno16_S);
1831 if (length <= 0) break;
1832 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_dsp_8_u8);
1833 if (length <= 0) break;
1835 FLD (f_bitbase16_u11_S) = ((((FLD (f_dsp_8_u8)) << (3))) | (FLD (f_bitno16_S)));
1839 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
1841 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1842 if (length <= 0) break;
1843 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_s8);
1844 if (length <= 0) break;
1846 FLD (f_bitbase32_16_s11_unprefixed) = ((((FLD (f_dsp_16_s8)) << (3))) | (FLD (f_bitno32_unprefixed)));
1850 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
1852 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1853 if (length <= 0) break;
1856 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
1857 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1858 fields->f_dsp_16_s16 = value;
1860 if (length <= 0) break;
1862 FLD (f_bitbase32_16_s19_unprefixed) = ((((FLD (f_dsp_16_s16)) << (3))) | (FLD (f_bitno32_unprefixed)));
1866 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
1868 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1869 if (length <= 0) break;
1870 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
1871 if (length <= 0) break;
1873 FLD (f_bitbase32_16_u11_unprefixed) = ((((FLD (f_dsp_16_u8)) << (3))) | (FLD (f_bitno32_unprefixed)));
1877 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
1879 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1880 if (length <= 0) break;
1883 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
1884 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1885 fields->f_dsp_16_u16 = value;
1887 if (length <= 0) break;
1889 FLD (f_bitbase32_16_u19_unprefixed) = ((((FLD (f_dsp_16_u16)) << (3))) | (FLD (f_bitno32_unprefixed)));
1893 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
1895 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1896 if (length <= 0) break;
1899 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
1900 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1901 fields->f_dsp_16_u16 = value;
1903 if (length <= 0) break;
1904 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
1905 if (length <= 0) break;
1907 FLD (f_bitbase32_16_u27_unprefixed) = ((((FLD (f_dsp_16_u16)) << (3))) | (((((FLD (f_dsp_32_u8)) << (19))) | (FLD (f_bitno32_unprefixed)))));
1911 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
1913 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1914 if (length <= 0) break;
1915 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_s8);
1916 if (length <= 0) break;
1918 FLD (f_bitbase32_24_s11_prefixed) = ((((FLD (f_dsp_24_s8)) << (3))) | (FLD (f_bitno32_prefixed)));
1922 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
1924 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1925 if (length <= 0) break;
1926 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
1927 if (length <= 0) break;
1928 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_s8);
1929 if (length <= 0) break;
1931 FLD (f_bitbase32_24_s19_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (((((FLD (f_dsp_32_s8)) << (11))) | (FLD (f_bitno32_prefixed)))));
1935 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
1937 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1938 if (length <= 0) break;
1939 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
1940 if (length <= 0) break;
1942 FLD (f_bitbase32_24_u11_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (FLD (f_bitno32_prefixed)));
1946 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
1948 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1949 if (length <= 0) break;
1950 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
1951 if (length <= 0) break;
1952 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
1953 if (length <= 0) break;
1955 FLD (f_bitbase32_24_u19_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (((((FLD (f_dsp_32_u8)) << (11))) | (FLD (f_bitno32_prefixed)))));
1959 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
1961 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1962 if (length <= 0) break;
1963 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
1964 if (length <= 0) break;
1967 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
1968 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
1969 fields->f_dsp_32_u16 = value;
1971 if (length <= 0) break;
1973 FLD (f_bitbase32_24_u27_prefixed) = ((((FLD (f_dsp_24_u8)) << (3))) | (((((FLD (f_dsp_32_u16)) << (11))) | (FLD (f_bitno32_prefixed)))));
1977 case M32C_OPERAND_BITNO16R :
1978 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
1980 case M32C_OPERAND_BITNO32PREFIXED :
1981 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_bitno32_prefixed);
1983 case M32C_OPERAND_BITNO32UNPREFIXED :
1984 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_bitno32_unprefixed);
1986 case M32C_OPERAND_DSP_10_U6 :
1987 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 6, 32, total_length, pc, & fields->f_dsp_10_u6);
1989 case M32C_OPERAND_DSP_16_S16 :
1992 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
1993 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
1994 fields->f_dsp_16_s16 = value;
1997 case M32C_OPERAND_DSP_16_S8 :
1998 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_s8);
2000 case M32C_OPERAND_DSP_16_U16 :
2003 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
2004 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2005 fields->f_dsp_16_u16 = value;
2008 case M32C_OPERAND_DSP_16_U20 :
2012 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
2013 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2014 fields->f_dsp_16_u16 = value;
2016 if (length <= 0) break;
2017 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2018 if (length <= 0) break;
2020 FLD (f_dsp_16_u24) = ((((FLD (f_dsp_32_u8)) << (16))) | (FLD (f_dsp_16_u16)));
2024 case M32C_OPERAND_DSP_16_U24 :
2028 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
2029 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2030 fields->f_dsp_16_u16 = value;
2032 if (length <= 0) break;
2033 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2034 if (length <= 0) break;
2036 FLD (f_dsp_16_u24) = ((((FLD (f_dsp_32_u8)) << (16))) | (FLD (f_dsp_16_u16)));
2040 case M32C_OPERAND_DSP_16_U8 :
2041 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
2043 case M32C_OPERAND_DSP_24_S16 :
2045 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2046 if (length <= 0) break;
2047 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2048 if (length <= 0) break;
2050 FLD (f_dsp_24_s16) = EXTHISI (((HI) (UINT) (((((FLD (f_dsp_32_u8)) << (8))) | (FLD (f_dsp_24_u8))))));
2054 case M32C_OPERAND_DSP_24_S8 :
2055 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_s8);
2057 case M32C_OPERAND_DSP_24_U16 :
2059 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2060 if (length <= 0) break;
2061 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2062 if (length <= 0) break;
2064 FLD (f_dsp_24_u16) = ((((FLD (f_dsp_32_u8)) << (8))) | (FLD (f_dsp_24_u8)));
2068 case M32C_OPERAND_DSP_24_U20 :
2070 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2071 if (length <= 0) break;
2074 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
2075 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2076 fields->f_dsp_32_u16 = value;
2078 if (length <= 0) break;
2080 FLD (f_dsp_24_u24) = ((((FLD (f_dsp_32_u16)) << (8))) | (FLD (f_dsp_24_u8)));
2084 case M32C_OPERAND_DSP_24_U24 :
2086 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2087 if (length <= 0) break;
2090 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
2091 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2092 fields->f_dsp_32_u16 = value;
2094 if (length <= 0) break;
2096 FLD (f_dsp_24_u24) = ((((FLD (f_dsp_32_u16)) << (8))) | (FLD (f_dsp_24_u8)));
2100 case M32C_OPERAND_DSP_24_U8 :
2101 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2103 case M32C_OPERAND_DSP_32_S16 :
2106 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
2107 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2108 fields->f_dsp_32_s16 = value;
2111 case M32C_OPERAND_DSP_32_S8 :
2112 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_s8);
2114 case M32C_OPERAND_DSP_32_U16 :
2117 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
2118 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2119 fields->f_dsp_32_u16 = value;
2122 case M32C_OPERAND_DSP_32_U20 :
2125 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
2126 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
2127 fields->f_dsp_32_u24 = value;
2130 case M32C_OPERAND_DSP_32_U24 :
2133 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
2134 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
2135 fields->f_dsp_32_u24 = value;
2138 case M32C_OPERAND_DSP_32_U8 :
2139 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2141 case M32C_OPERAND_DSP_40_S16 :
2144 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
2145 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2146 fields->f_dsp_40_s16 = value;
2149 case M32C_OPERAND_DSP_40_S8 :
2150 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 8, 32, total_length, pc, & fields->f_dsp_40_s8);
2152 case M32C_OPERAND_DSP_40_U16 :
2155 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 16, 32, total_length, pc, & value);
2156 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2157 fields->f_dsp_40_u16 = value;
2160 case M32C_OPERAND_DSP_40_U20 :
2163 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 20, 32, total_length, pc, & value);
2164 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (983040))));
2165 fields->f_dsp_40_u20 = value;
2168 case M32C_OPERAND_DSP_40_U24 :
2171 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
2172 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
2173 fields->f_dsp_40_u24 = value;
2176 case M32C_OPERAND_DSP_40_U8 :
2177 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 8, 32, total_length, pc, & fields->f_dsp_40_u8);
2179 case M32C_OPERAND_DSP_48_S16 :
2182 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
2183 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2184 fields->f_dsp_48_s16 = value;
2187 case M32C_OPERAND_DSP_48_S8 :
2188 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 8, 32, total_length, pc, & fields->f_dsp_48_s8);
2190 case M32C_OPERAND_DSP_48_U16 :
2193 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
2194 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2195 fields->f_dsp_48_u16 = value;
2198 case M32C_OPERAND_DSP_48_U20 :
2202 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
2203 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2204 fields->f_dsp_48_u16 = value;
2206 if (length <= 0) break;
2207 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 8, 32, total_length, pc, & fields->f_dsp_64_u8);
2208 if (length <= 0) break;
2210 FLD (f_dsp_48_u20) = ((((FLD (f_dsp_48_u16)) & (65535))) | (((((FLD (f_dsp_64_u8)) << (16))) & (983040))));
2214 case M32C_OPERAND_DSP_48_U24 :
2218 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
2219 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2220 fields->f_dsp_48_u16 = value;
2222 if (length <= 0) break;
2223 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 8, 32, total_length, pc, & fields->f_dsp_64_u8);
2224 if (length <= 0) break;
2226 FLD (f_dsp_48_u24) = ((((FLD (f_dsp_48_u16)) & (65535))) | (((((FLD (f_dsp_64_u8)) << (16))) & (16711680))));
2230 case M32C_OPERAND_DSP_48_U8 :
2231 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 8, 32, total_length, pc, & fields->f_dsp_48_u8);
2233 case M32C_OPERAND_DSP_8_S24 :
2236 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 24, 32, total_length, pc, & value);
2237 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((EXTQISI (TRUNCSIQI (((value) & (255))))) << (16))));
2238 fields->f_dsp_8_s24 = value;
2241 case M32C_OPERAND_DSP_8_S8 :
2242 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, pc, & fields->f_dsp_8_s8);
2244 case M32C_OPERAND_DSP_8_U16 :
2247 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 16, 32, total_length, pc, & value);
2248 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2249 fields->f_dsp_8_u16 = value;
2252 case M32C_OPERAND_DSP_8_U24 :
2255 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 24, 32, total_length, pc, & value);
2256 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
2257 fields->f_dsp_8_u24 = value;
2260 case M32C_OPERAND_DSP_8_U6 :
2261 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 6, 32, total_length, pc, & fields->f_dsp_8_u6);
2263 case M32C_OPERAND_DSP_8_U8 :
2264 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_dsp_8_u8);
2266 case M32C_OPERAND_DST16AN :
2267 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_dst16_an);
2269 case M32C_OPERAND_DST16AN_S :
2270 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 1, 32, total_length, pc, & fields->f_dst16_an_s);
2272 case M32C_OPERAND_DST16ANHI :
2273 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_dst16_an);
2275 case M32C_OPERAND_DST16ANQI :
2276 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_dst16_an);
2278 case M32C_OPERAND_DST16ANQI_S :
2279 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_dst16_rn_QI_s);
2281 case M32C_OPERAND_DST16ANSI :
2282 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_dst16_an);
2284 case M32C_OPERAND_DST16RNEXTQI :
2285 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 1, 32, total_length, pc, & fields->f_dst16_rn_ext);
2287 case M32C_OPERAND_DST16RNHI :
2288 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 2, 32, total_length, pc, & fields->f_dst16_rn);
2290 case M32C_OPERAND_DST16RNQI :
2291 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 2, 32, total_length, pc, & fields->f_dst16_rn);
2293 case M32C_OPERAND_DST16RNQI_S :
2294 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_dst16_rn_QI_s);
2296 case M32C_OPERAND_DST16RNSI :
2297 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 2, 32, total_length, pc, & fields->f_dst16_rn);
2299 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
2300 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
2302 case M32C_OPERAND_DST32ANPREFIXED :
2303 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_dst32_an_prefixed);
2305 case M32C_OPERAND_DST32ANPREFIXEDHI :
2306 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_dst32_an_prefixed);
2308 case M32C_OPERAND_DST32ANPREFIXEDQI :
2309 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_dst32_an_prefixed);
2311 case M32C_OPERAND_DST32ANPREFIXEDSI :
2312 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_dst32_an_prefixed);
2314 case M32C_OPERAND_DST32ANUNPREFIXED :
2315 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
2317 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
2318 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
2320 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
2321 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
2323 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
2324 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_an_unprefixed);
2326 case M32C_OPERAND_DST32R0HI_S :
2328 case M32C_OPERAND_DST32R0QI_S :
2330 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
2331 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_rn_ext_unprefixed);
2333 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
2334 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_dst32_rn_ext_unprefixed);
2336 case M32C_OPERAND_DST32RNPREFIXEDHI :
2339 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
2340 value = ((((value) + (2))) % (4));
2341 fields->f_dst32_rn_prefixed_HI = value;
2344 case M32C_OPERAND_DST32RNPREFIXEDQI :
2347 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
2348 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
2349 fields->f_dst32_rn_prefixed_QI = value;
2352 case M32C_OPERAND_DST32RNPREFIXEDSI :
2355 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 2, 32, total_length, pc, & value);
2356 value = ((value) - (2));
2357 fields->f_dst32_rn_prefixed_SI = value;
2360 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
2363 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
2364 value = ((((value) + (2))) % (4));
2365 fields->f_dst32_rn_unprefixed_HI = value;
2368 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
2371 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
2372 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
2373 fields->f_dst32_rn_unprefixed_QI = value;
2376 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
2379 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 2, 32, total_length, pc, & value);
2380 value = ((value) - (2));
2381 fields->f_dst32_rn_unprefixed_SI = value;
2384 case M32C_OPERAND_G :
2386 case M32C_OPERAND_IMM_12_S4 :
2387 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, pc, & fields->f_imm_12_s4);
2389 case M32C_OPERAND_IMM_12_S4N :
2390 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, pc, & fields->f_imm_12_s4);
2392 case M32C_OPERAND_IMM_13_U3 :
2393 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_imm_13_u3);
2395 case M32C_OPERAND_IMM_16_HI :
2398 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & value);
2399 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2400 fields->f_dsp_16_s16 = value;
2403 case M32C_OPERAND_IMM_16_QI :
2404 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_s8);
2406 case M32C_OPERAND_IMM_16_SI :
2410 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & value);
2411 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2412 fields->f_dsp_16_u16 = value;
2414 if (length <= 0) break;
2417 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 16, 32, total_length, pc, & value);
2418 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2419 fields->f_dsp_32_u16 = value;
2421 if (length <= 0) break;
2423 FLD (f_dsp_16_s32) = ((((FLD (f_dsp_16_u16)) & (65535))) | (((((FLD (f_dsp_32_u16)) << (16))) & (0xffff0000))));
2427 case M32C_OPERAND_IMM_20_S4 :
2428 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 4, 32, total_length, pc, & fields->f_imm_20_s4);
2430 case M32C_OPERAND_IMM_24_HI :
2432 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2433 if (length <= 0) break;
2434 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2435 if (length <= 0) break;
2437 FLD (f_dsp_24_s16) = EXTHISI (((HI) (UINT) (((((FLD (f_dsp_32_u8)) << (8))) | (FLD (f_dsp_24_u8))))));
2441 case M32C_OPERAND_IMM_24_QI :
2442 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_s8);
2444 case M32C_OPERAND_IMM_24_SI :
2446 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2447 if (length <= 0) break;
2450 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 24, 32, total_length, pc, & value);
2451 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
2452 fields->f_dsp_32_u24 = value;
2454 if (length <= 0) break;
2456 FLD (f_dsp_24_s32) = ((((FLD (f_dsp_24_u8)) & (255))) | (((((FLD (f_dsp_32_u24)) << (8))) & (0xffffff00))));
2460 case M32C_OPERAND_IMM_32_HI :
2463 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 16, 32, total_length, pc, & value);
2464 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2465 fields->f_dsp_32_s16 = value;
2468 case M32C_OPERAND_IMM_32_QI :
2469 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_s8);
2471 case M32C_OPERAND_IMM_32_SI :
2474 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 0, 32, 32, total_length, pc, & value);
2475 value = EXTSISI (((((((((UINT) (value) >> (24))) & (255))) | (((((UINT) (value) >> (8))) & (65280))))) | (((((((value) << (8))) & (16711680))) | (((((value) << (24))) & (0xff000000)))))));
2476 fields->f_dsp_32_s32 = value;
2479 case M32C_OPERAND_IMM_40_HI :
2482 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 16, 32, total_length, pc, & value);
2483 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2484 fields->f_dsp_40_s16 = value;
2487 case M32C_OPERAND_IMM_40_QI :
2488 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 8, 8, 32, total_length, pc, & fields->f_dsp_40_s8);
2490 case M32C_OPERAND_IMM_40_SI :
2494 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 24, 32, total_length, pc, & value);
2495 value = ((((((((USI) (value) >> (16))) & (255))) | (((value) & (65280))))) | (((((value) << (16))) & (16711680))));
2496 fields->f_dsp_40_u24 = value;
2498 if (length <= 0) break;
2499 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 8, 32, total_length, pc, & fields->f_dsp_64_u8);
2500 if (length <= 0) break;
2502 FLD (f_dsp_40_s32) = ((((FLD (f_dsp_40_u24)) & (16777215))) | (((((FLD (f_dsp_64_u8)) << (24))) & (0xff000000))));
2506 case M32C_OPERAND_IMM_48_HI :
2509 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 16, 32, total_length, pc, & value);
2510 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2511 fields->f_dsp_48_s16 = value;
2514 case M32C_OPERAND_IMM_48_QI :
2515 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 16, 8, 32, total_length, pc, & fields->f_dsp_48_s8);
2517 case M32C_OPERAND_IMM_48_SI :
2521 length = extract_normal (cd, ex_info, insn_value, 0, 32, 16, 16, 32, total_length, pc, & value);
2522 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2523 fields->f_dsp_48_u16 = value;
2525 if (length <= 0) break;
2528 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 16, 32, total_length, pc, & value);
2529 value = ((((((UHI) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280))));
2530 fields->f_dsp_64_u16 = value;
2532 if (length <= 0) break;
2534 FLD (f_dsp_48_s32) = ((((FLD (f_dsp_48_u16)) & (65535))) | (((((FLD (f_dsp_64_u16)) << (16))) & (0xffff0000))));
2538 case M32C_OPERAND_IMM_56_HI :
2540 length = extract_normal (cd, ex_info, insn_value, 0, 32, 24, 8, 32, total_length, pc, & fields->f_dsp_56_u8);
2541 if (length <= 0) break;
2542 length = extract_normal (cd, ex_info, insn_value, 0, 64, 0, 8, 32, total_length, pc, & fields->f_dsp_64_u8);
2543 if (length <= 0) break;
2545 FLD (f_dsp_56_s16) = EXTHISI (((HI) (UINT) (((((FLD (f_dsp_64_u8)) << (8))) | (FLD (f_dsp_56_u8))))));
2549 case M32C_OPERAND_IMM_56_QI :
2550 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 32, 24, 8, 32, total_length, pc, & fields->f_dsp_56_s8);
2552 case M32C_OPERAND_IMM_64_HI :
2555 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 64, 0, 16, 32, total_length, pc, & value);
2556 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2557 fields->f_dsp_64_s16 = value;
2560 case M32C_OPERAND_IMM_8_HI :
2563 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 16, 32, total_length, pc, & value);
2564 value = EXTHISI (((HI) (INT) (((((((UINT) (value) >> (8))) & (255))) | (((((value) << (8))) & (65280)))))));
2565 fields->f_dsp_8_s16 = value;
2568 case M32C_OPERAND_IMM_8_QI :
2569 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, pc, & fields->f_dsp_8_s8);
2571 case M32C_OPERAND_IMM_8_S4 :
2572 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, pc, & fields->f_imm_8_s4);
2574 case M32C_OPERAND_IMM_8_S4N :
2575 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, pc, & fields->f_imm_8_s4);
2577 case M32C_OPERAND_IMM_SH_12_S4 :
2578 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 12, 4, 32, total_length, pc, & fields->f_imm_12_s4);
2580 case M32C_OPERAND_IMM_SH_20_S4 :
2581 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 4, 32, total_length, pc, & fields->f_imm_20_s4);
2583 case M32C_OPERAND_IMM_SH_8_S4 :
2584 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 4, 32, total_length, pc, & fields->f_imm_8_s4);
2586 case M32C_OPERAND_IMM1_S :
2589 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 1, 32, total_length, pc, & value);
2590 value = ((value) + (1));
2591 fields->f_imm1_S = value;
2594 case M32C_OPERAND_IMM3_S :
2596 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 2, 32, total_length, pc, & fields->f_2_2);
2597 if (length <= 0) break;
2598 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7_1);
2599 if (length <= 0) break;
2601 FLD (f_imm3_S) = ((((((FLD (f_2_2)) << (1))) | (FLD (f_7_1)))) + (1));
2605 case M32C_OPERAND_LAB_16_8 :
2608 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 8, 32, total_length, pc, & value);
2609 value = ((value) + (((pc) + (2))));
2610 fields->f_lab_16_8 = value;
2613 case M32C_OPERAND_LAB_24_8 :
2616 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 24, 8, 32, total_length, pc, & value);
2617 value = ((value) + (((pc) + (2))));
2618 fields->f_lab_24_8 = value;
2621 case M32C_OPERAND_LAB_32_8 :
2624 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 0, 8, 32, total_length, pc, & value);
2625 value = ((value) + (((pc) + (2))));
2626 fields->f_lab_32_8 = value;
2629 case M32C_OPERAND_LAB_40_8 :
2632 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 32, 8, 8, 32, total_length, pc, & value);
2633 value = ((value) + (((pc) + (2))));
2634 fields->f_lab_40_8 = value;
2637 case M32C_OPERAND_LAB_5_3 :
2640 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 3, 32, total_length, pc, & value);
2641 value = ((value) + (((pc) + (2))));
2642 fields->f_lab_5_3 = value;
2645 case M32C_OPERAND_LAB_8_16 :
2648 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGN_OPT)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 16, 32, total_length, pc, & value);
2649 value = ((((((USI) (((value) & (65535))) >> (8))) | (((SI) (((((value) & (255))) << (24))) >> (16))))) + (((pc) + (1))));
2650 fields->f_lab_8_16 = value;
2653 case M32C_OPERAND_LAB_8_24 :
2656 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_ABS_ADDR), 0, 8, 24, 32, total_length, pc, & value);
2657 value = ((((((USI) (value) >> (16))) | (((value) & (65280))))) | (((((value) & (255))) << (16))));
2658 fields->f_lab_8_24 = value;
2661 case M32C_OPERAND_LAB_8_8 :
2664 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 8, 32, total_length, pc, & value);
2665 value = ((value) + (((pc) + (1))));
2666 fields->f_lab_8_8 = value;
2669 case M32C_OPERAND_LAB32_JMP_S :
2671 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 2, 32, total_length, pc, & fields->f_2_2);
2672 if (length <= 0) break;
2673 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7_1);
2674 if (length <= 0) break;
2676 FLD (f_lab32_jmp_s) = ((pc) + (((((((FLD (f_2_2)) << (1))) | (FLD (f_7_1)))) + (2))));
2680 case M32C_OPERAND_Q :
2682 case M32C_OPERAND_R0 :
2684 case M32C_OPERAND_R0H :
2686 case M32C_OPERAND_R0L :
2688 case M32C_OPERAND_R1 :
2690 case M32C_OPERAND_R1R2R0 :
2692 case M32C_OPERAND_R2 :
2694 case M32C_OPERAND_R2R0 :
2696 case M32C_OPERAND_R3 :
2698 case M32C_OPERAND_R3R1 :
2700 case M32C_OPERAND_REGSETPOP :
2701 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_8_8);
2703 case M32C_OPERAND_REGSETPUSH :
2704 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_8_8);
2706 case M32C_OPERAND_RN16_PUSH_S :
2707 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 1, 32, total_length, pc, & fields->f_4_1);
2709 case M32C_OPERAND_S :
2711 case M32C_OPERAND_SRC16AN :
2712 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src16_an);
2714 case M32C_OPERAND_SRC16ANHI :
2715 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src16_an);
2717 case M32C_OPERAND_SRC16ANQI :
2718 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src16_an);
2720 case M32C_OPERAND_SRC16RNHI :
2721 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & fields->f_src16_rn);
2723 case M32C_OPERAND_SRC16RNQI :
2724 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & fields->f_src16_rn);
2726 case M32C_OPERAND_SRC32ANPREFIXED :
2727 length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 1, 32, total_length, pc, & fields->f_src32_an_prefixed);
2729 case M32C_OPERAND_SRC32ANPREFIXEDHI :
2730 length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 1, 32, total_length, pc, & fields->f_src32_an_prefixed);
2732 case M32C_OPERAND_SRC32ANPREFIXEDQI :
2733 length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 1, 32, total_length, pc, & fields->f_src32_an_prefixed);
2735 case M32C_OPERAND_SRC32ANPREFIXEDSI :
2736 length = extract_normal (cd, ex_info, insn_value, 0, 0, 19, 1, 32, total_length, pc, & fields->f_src32_an_prefixed);
2738 case M32C_OPERAND_SRC32ANUNPREFIXED :
2739 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src32_an_unprefixed);
2741 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
2742 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src32_an_unprefixed);
2744 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
2745 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src32_an_unprefixed);
2747 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
2748 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_src32_an_unprefixed);
2750 case M32C_OPERAND_SRC32RNPREFIXEDHI :
2753 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
2754 value = ((((value) + (2))) % (4));
2755 fields->f_src32_rn_prefixed_HI = value;
2758 case M32C_OPERAND_SRC32RNPREFIXEDQI :
2761 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
2762 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
2763 fields->f_src32_rn_prefixed_QI = value;
2766 case M32C_OPERAND_SRC32RNPREFIXEDSI :
2769 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 2, 32, total_length, pc, & value);
2770 value = ((value) - (2));
2771 fields->f_src32_rn_prefixed_SI = value;
2774 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
2777 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
2778 value = ((((value) + (2))) % (4));
2779 fields->f_src32_rn_unprefixed_HI = value;
2782 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
2785 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
2786 value = (((((~ (((USI) (value) >> (1))))) & (1))) | (((((value) << (1))) & (2))));
2787 fields->f_src32_rn_unprefixed_QI = value;
2790 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
2793 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & value);
2794 value = ((value) - (2));
2795 fields->f_src32_rn_unprefixed_SI = value;
2798 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
2799 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_5_1);
2801 case M32C_OPERAND_X :
2803 case M32C_OPERAND_Z :
2805 case M32C_OPERAND_COND16_16 :
2806 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
2808 case M32C_OPERAND_COND16_24 :
2809 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2811 case M32C_OPERAND_COND16_32 :
2812 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2814 case M32C_OPERAND_COND16C :
2815 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_cond16);
2817 case M32C_OPERAND_COND16J :
2818 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_cond16);
2820 case M32C_OPERAND_COND16J5 :
2821 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_cond16j_5);
2823 case M32C_OPERAND_COND32 :
2825 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 1, 32, total_length, pc, & fields->f_9_1);
2826 if (length <= 0) break;
2827 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_13_3);
2828 if (length <= 0) break;
2830 FLD (f_cond32) = ((((FLD (f_9_1)) << (3))) | (FLD (f_13_3)));
2834 case M32C_OPERAND_COND32_16 :
2835 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 8, 32, total_length, pc, & fields->f_dsp_16_u8);
2837 case M32C_OPERAND_COND32_24 :
2838 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 8, 32, total_length, pc, & fields->f_dsp_24_u8);
2840 case M32C_OPERAND_COND32_32 :
2841 length = extract_normal (cd, ex_info, insn_value, 0, 32, 0, 8, 32, total_length, pc, & fields->f_dsp_32_u8);
2843 case M32C_OPERAND_COND32_40 :
2844 length = extract_normal (cd, ex_info, insn_value, 0, 32, 8, 8, 32, total_length, pc, & fields->f_dsp_40_u8);
2846 case M32C_OPERAND_COND32J :
2848 length = extract_normal (cd, ex_info, insn_value, 0, 0, 1, 3, 32, total_length, pc, & fields->f_1_3);
2849 if (length <= 0) break;
2850 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7_1);
2851 if (length <= 0) break;
2853 FLD (f_cond32j) = ((((FLD (f_1_3)) << (1))) | (FLD (f_7_1)));
2857 case M32C_OPERAND_CR1_PREFIXED_32 :
2858 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_21_3);
2860 case M32C_OPERAND_CR1_UNPREFIXED_32 :
2861 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_13_3);
2863 case M32C_OPERAND_CR16 :
2864 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_9_3);
2866 case M32C_OPERAND_CR2_32 :
2867 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_13_3);
2869 case M32C_OPERAND_CR3_PREFIXED_32 :
2870 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 3, 32, total_length, pc, & fields->f_21_3);
2872 case M32C_OPERAND_CR3_UNPREFIXED_32 :
2873 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_13_3);
2875 case M32C_OPERAND_FLAGS16 :
2876 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_9_3);
2878 case M32C_OPERAND_FLAGS32 :
2879 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 3, 32, total_length, pc, & fields->f_13_3);
2881 case M32C_OPERAND_SCCOND32 :
2882 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_cond16);
2884 case M32C_OPERAND_SIZE :
2888 /* xgettext:c-format */
2889 fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"),
2897 cgen_insert_fn * const m32c_cgen_insert_handlers[] =
2902 cgen_extract_fn * const m32c_cgen_extract_handlers[] =
2904 extract_insn_normal,
2907 int m32c_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
2908 bfd_vma m32c_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
2910 /* Getting values from cgen_fields is handled by a collection of functions.
2911 They are distinguished by the type of the VALUE argument they return.
2912 TODO: floating point, inlining support, remove cases where result type
2916 m32c_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2918 const CGEN_FIELDS * fields)
2924 case M32C_OPERAND_A0 :
2927 case M32C_OPERAND_A1 :
2930 case M32C_OPERAND_AN16_PUSH_S :
2931 value = fields->f_4_1;
2933 case M32C_OPERAND_BIT16AN :
2934 value = fields->f_dst16_an;
2936 case M32C_OPERAND_BIT16RN :
2937 value = fields->f_dst16_rn;
2939 case M32C_OPERAND_BIT3_S :
2940 value = fields->f_imm3_S;
2942 case M32C_OPERAND_BIT32ANPREFIXED :
2943 value = fields->f_dst32_an_prefixed;
2945 case M32C_OPERAND_BIT32ANUNPREFIXED :
2946 value = fields->f_dst32_an_unprefixed;
2948 case M32C_OPERAND_BIT32RNPREFIXED :
2949 value = fields->f_dst32_rn_prefixed_QI;
2951 case M32C_OPERAND_BIT32RNUNPREFIXED :
2952 value = fields->f_dst32_rn_unprefixed_QI;
2954 case M32C_OPERAND_BITBASE16_16_S8 :
2955 value = fields->f_dsp_16_s8;
2957 case M32C_OPERAND_BITBASE16_16_U16 :
2958 value = fields->f_dsp_16_u16;
2960 case M32C_OPERAND_BITBASE16_16_U8 :
2961 value = fields->f_dsp_16_u8;
2963 case M32C_OPERAND_BITBASE16_8_U11_S :
2964 value = fields->f_bitbase16_u11_S;
2966 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
2967 value = fields->f_bitbase32_16_s11_unprefixed;
2969 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
2970 value = fields->f_bitbase32_16_s19_unprefixed;
2972 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
2973 value = fields->f_bitbase32_16_u11_unprefixed;
2975 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
2976 value = fields->f_bitbase32_16_u19_unprefixed;
2978 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
2979 value = fields->f_bitbase32_16_u27_unprefixed;
2981 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
2982 value = fields->f_bitbase32_24_s11_prefixed;
2984 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
2985 value = fields->f_bitbase32_24_s19_prefixed;
2987 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
2988 value = fields->f_bitbase32_24_u11_prefixed;
2990 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
2991 value = fields->f_bitbase32_24_u19_prefixed;
2993 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
2994 value = fields->f_bitbase32_24_u27_prefixed;
2996 case M32C_OPERAND_BITNO16R :
2997 value = fields->f_dsp_16_u8;
2999 case M32C_OPERAND_BITNO32PREFIXED :
3000 value = fields->f_bitno32_prefixed;
3002 case M32C_OPERAND_BITNO32UNPREFIXED :
3003 value = fields->f_bitno32_unprefixed;
3005 case M32C_OPERAND_DSP_10_U6 :
3006 value = fields->f_dsp_10_u6;
3008 case M32C_OPERAND_DSP_16_S16 :
3009 value = fields->f_dsp_16_s16;
3011 case M32C_OPERAND_DSP_16_S8 :
3012 value = fields->f_dsp_16_s8;
3014 case M32C_OPERAND_DSP_16_U16 :
3015 value = fields->f_dsp_16_u16;
3017 case M32C_OPERAND_DSP_16_U20 :
3018 value = fields->f_dsp_16_u24;
3020 case M32C_OPERAND_DSP_16_U24 :
3021 value = fields->f_dsp_16_u24;
3023 case M32C_OPERAND_DSP_16_U8 :
3024 value = fields->f_dsp_16_u8;
3026 case M32C_OPERAND_DSP_24_S16 :
3027 value = fields->f_dsp_24_s16;
3029 case M32C_OPERAND_DSP_24_S8 :
3030 value = fields->f_dsp_24_s8;
3032 case M32C_OPERAND_DSP_24_U16 :
3033 value = fields->f_dsp_24_u16;
3035 case M32C_OPERAND_DSP_24_U20 :
3036 value = fields->f_dsp_24_u24;
3038 case M32C_OPERAND_DSP_24_U24 :
3039 value = fields->f_dsp_24_u24;
3041 case M32C_OPERAND_DSP_24_U8 :
3042 value = fields->f_dsp_24_u8;
3044 case M32C_OPERAND_DSP_32_S16 :
3045 value = fields->f_dsp_32_s16;
3047 case M32C_OPERAND_DSP_32_S8 :
3048 value = fields->f_dsp_32_s8;
3050 case M32C_OPERAND_DSP_32_U16 :
3051 value = fields->f_dsp_32_u16;
3053 case M32C_OPERAND_DSP_32_U20 :
3054 value = fields->f_dsp_32_u24;
3056 case M32C_OPERAND_DSP_32_U24 :
3057 value = fields->f_dsp_32_u24;
3059 case M32C_OPERAND_DSP_32_U8 :
3060 value = fields->f_dsp_32_u8;
3062 case M32C_OPERAND_DSP_40_S16 :
3063 value = fields->f_dsp_40_s16;
3065 case M32C_OPERAND_DSP_40_S8 :
3066 value = fields->f_dsp_40_s8;
3068 case M32C_OPERAND_DSP_40_U16 :
3069 value = fields->f_dsp_40_u16;
3071 case M32C_OPERAND_DSP_40_U20 :
3072 value = fields->f_dsp_40_u20;
3074 case M32C_OPERAND_DSP_40_U24 :
3075 value = fields->f_dsp_40_u24;
3077 case M32C_OPERAND_DSP_40_U8 :
3078 value = fields->f_dsp_40_u8;
3080 case M32C_OPERAND_DSP_48_S16 :
3081 value = fields->f_dsp_48_s16;
3083 case M32C_OPERAND_DSP_48_S8 :
3084 value = fields->f_dsp_48_s8;
3086 case M32C_OPERAND_DSP_48_U16 :
3087 value = fields->f_dsp_48_u16;
3089 case M32C_OPERAND_DSP_48_U20 :
3090 value = fields->f_dsp_48_u20;
3092 case M32C_OPERAND_DSP_48_U24 :
3093 value = fields->f_dsp_48_u24;
3095 case M32C_OPERAND_DSP_48_U8 :
3096 value = fields->f_dsp_48_u8;
3098 case M32C_OPERAND_DSP_8_S24 :
3099 value = fields->f_dsp_8_s24;
3101 case M32C_OPERAND_DSP_8_S8 :
3102 value = fields->f_dsp_8_s8;
3104 case M32C_OPERAND_DSP_8_U16 :
3105 value = fields->f_dsp_8_u16;
3107 case M32C_OPERAND_DSP_8_U24 :
3108 value = fields->f_dsp_8_u24;
3110 case M32C_OPERAND_DSP_8_U6 :
3111 value = fields->f_dsp_8_u6;
3113 case M32C_OPERAND_DSP_8_U8 :
3114 value = fields->f_dsp_8_u8;
3116 case M32C_OPERAND_DST16AN :
3117 value = fields->f_dst16_an;
3119 case M32C_OPERAND_DST16AN_S :
3120 value = fields->f_dst16_an_s;
3122 case M32C_OPERAND_DST16ANHI :
3123 value = fields->f_dst16_an;
3125 case M32C_OPERAND_DST16ANQI :
3126 value = fields->f_dst16_an;
3128 case M32C_OPERAND_DST16ANQI_S :
3129 value = fields->f_dst16_rn_QI_s;
3131 case M32C_OPERAND_DST16ANSI :
3132 value = fields->f_dst16_an;
3134 case M32C_OPERAND_DST16RNEXTQI :
3135 value = fields->f_dst16_rn_ext;
3137 case M32C_OPERAND_DST16RNHI :
3138 value = fields->f_dst16_rn;
3140 case M32C_OPERAND_DST16RNQI :
3141 value = fields->f_dst16_rn;
3143 case M32C_OPERAND_DST16RNQI_S :
3144 value = fields->f_dst16_rn_QI_s;
3146 case M32C_OPERAND_DST16RNSI :
3147 value = fields->f_dst16_rn;
3149 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
3150 value = fields->f_dst32_an_unprefixed;
3152 case M32C_OPERAND_DST32ANPREFIXED :
3153 value = fields->f_dst32_an_prefixed;
3155 case M32C_OPERAND_DST32ANPREFIXEDHI :
3156 value = fields->f_dst32_an_prefixed;
3158 case M32C_OPERAND_DST32ANPREFIXEDQI :
3159 value = fields->f_dst32_an_prefixed;
3161 case M32C_OPERAND_DST32ANPREFIXEDSI :
3162 value = fields->f_dst32_an_prefixed;
3164 case M32C_OPERAND_DST32ANUNPREFIXED :
3165 value = fields->f_dst32_an_unprefixed;
3167 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
3168 value = fields->f_dst32_an_unprefixed;
3170 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
3171 value = fields->f_dst32_an_unprefixed;
3173 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
3174 value = fields->f_dst32_an_unprefixed;
3176 case M32C_OPERAND_DST32R0HI_S :
3179 case M32C_OPERAND_DST32R0QI_S :
3182 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
3183 value = fields->f_dst32_rn_ext_unprefixed;
3185 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
3186 value = fields->f_dst32_rn_ext_unprefixed;
3188 case M32C_OPERAND_DST32RNPREFIXEDHI :
3189 value = fields->f_dst32_rn_prefixed_HI;
3191 case M32C_OPERAND_DST32RNPREFIXEDQI :
3192 value = fields->f_dst32_rn_prefixed_QI;
3194 case M32C_OPERAND_DST32RNPREFIXEDSI :
3195 value = fields->f_dst32_rn_prefixed_SI;
3197 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
3198 value = fields->f_dst32_rn_unprefixed_HI;
3200 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
3201 value = fields->f_dst32_rn_unprefixed_QI;
3203 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
3204 value = fields->f_dst32_rn_unprefixed_SI;
3206 case M32C_OPERAND_G :
3209 case M32C_OPERAND_IMM_12_S4 :
3210 value = fields->f_imm_12_s4;
3212 case M32C_OPERAND_IMM_12_S4N :
3213 value = fields->f_imm_12_s4;
3215 case M32C_OPERAND_IMM_13_U3 :
3216 value = fields->f_imm_13_u3;
3218 case M32C_OPERAND_IMM_16_HI :
3219 value = fields->f_dsp_16_s16;
3221 case M32C_OPERAND_IMM_16_QI :
3222 value = fields->f_dsp_16_s8;
3224 case M32C_OPERAND_IMM_16_SI :
3225 value = fields->f_dsp_16_s32;
3227 case M32C_OPERAND_IMM_20_S4 :
3228 value = fields->f_imm_20_s4;
3230 case M32C_OPERAND_IMM_24_HI :
3231 value = fields->f_dsp_24_s16;
3233 case M32C_OPERAND_IMM_24_QI :
3234 value = fields->f_dsp_24_s8;
3236 case M32C_OPERAND_IMM_24_SI :
3237 value = fields->f_dsp_24_s32;
3239 case M32C_OPERAND_IMM_32_HI :
3240 value = fields->f_dsp_32_s16;
3242 case M32C_OPERAND_IMM_32_QI :
3243 value = fields->f_dsp_32_s8;
3245 case M32C_OPERAND_IMM_32_SI :
3246 value = fields->f_dsp_32_s32;
3248 case M32C_OPERAND_IMM_40_HI :
3249 value = fields->f_dsp_40_s16;
3251 case M32C_OPERAND_IMM_40_QI :
3252 value = fields->f_dsp_40_s8;
3254 case M32C_OPERAND_IMM_40_SI :
3255 value = fields->f_dsp_40_s32;
3257 case M32C_OPERAND_IMM_48_HI :
3258 value = fields->f_dsp_48_s16;
3260 case M32C_OPERAND_IMM_48_QI :
3261 value = fields->f_dsp_48_s8;
3263 case M32C_OPERAND_IMM_48_SI :
3264 value = fields->f_dsp_48_s32;
3266 case M32C_OPERAND_IMM_56_HI :
3267 value = fields->f_dsp_56_s16;
3269 case M32C_OPERAND_IMM_56_QI :
3270 value = fields->f_dsp_56_s8;
3272 case M32C_OPERAND_IMM_64_HI :
3273 value = fields->f_dsp_64_s16;
3275 case M32C_OPERAND_IMM_8_HI :
3276 value = fields->f_dsp_8_s16;
3278 case M32C_OPERAND_IMM_8_QI :
3279 value = fields->f_dsp_8_s8;
3281 case M32C_OPERAND_IMM_8_S4 :
3282 value = fields->f_imm_8_s4;
3284 case M32C_OPERAND_IMM_8_S4N :
3285 value = fields->f_imm_8_s4;
3287 case M32C_OPERAND_IMM_SH_12_S4 :
3288 value = fields->f_imm_12_s4;
3290 case M32C_OPERAND_IMM_SH_20_S4 :
3291 value = fields->f_imm_20_s4;
3293 case M32C_OPERAND_IMM_SH_8_S4 :
3294 value = fields->f_imm_8_s4;
3296 case M32C_OPERAND_IMM1_S :
3297 value = fields->f_imm1_S;
3299 case M32C_OPERAND_IMM3_S :
3300 value = fields->f_imm3_S;
3302 case M32C_OPERAND_LAB_16_8 :
3303 value = fields->f_lab_16_8;
3305 case M32C_OPERAND_LAB_24_8 :
3306 value = fields->f_lab_24_8;
3308 case M32C_OPERAND_LAB_32_8 :
3309 value = fields->f_lab_32_8;
3311 case M32C_OPERAND_LAB_40_8 :
3312 value = fields->f_lab_40_8;
3314 case M32C_OPERAND_LAB_5_3 :
3315 value = fields->f_lab_5_3;
3317 case M32C_OPERAND_LAB_8_16 :
3318 value = fields->f_lab_8_16;
3320 case M32C_OPERAND_LAB_8_24 :
3321 value = fields->f_lab_8_24;
3323 case M32C_OPERAND_LAB_8_8 :
3324 value = fields->f_lab_8_8;
3326 case M32C_OPERAND_LAB32_JMP_S :
3327 value = fields->f_lab32_jmp_s;
3329 case M32C_OPERAND_Q :
3332 case M32C_OPERAND_R0 :
3335 case M32C_OPERAND_R0H :
3338 case M32C_OPERAND_R0L :
3341 case M32C_OPERAND_R1 :
3344 case M32C_OPERAND_R1R2R0 :
3347 case M32C_OPERAND_R2 :
3350 case M32C_OPERAND_R2R0 :
3353 case M32C_OPERAND_R3 :
3356 case M32C_OPERAND_R3R1 :
3359 case M32C_OPERAND_REGSETPOP :
3360 value = fields->f_8_8;
3362 case M32C_OPERAND_REGSETPUSH :
3363 value = fields->f_8_8;
3365 case M32C_OPERAND_RN16_PUSH_S :
3366 value = fields->f_4_1;
3368 case M32C_OPERAND_S :
3371 case M32C_OPERAND_SRC16AN :
3372 value = fields->f_src16_an;
3374 case M32C_OPERAND_SRC16ANHI :
3375 value = fields->f_src16_an;
3377 case M32C_OPERAND_SRC16ANQI :
3378 value = fields->f_src16_an;
3380 case M32C_OPERAND_SRC16RNHI :
3381 value = fields->f_src16_rn;
3383 case M32C_OPERAND_SRC16RNQI :
3384 value = fields->f_src16_rn;
3386 case M32C_OPERAND_SRC32ANPREFIXED :
3387 value = fields->f_src32_an_prefixed;
3389 case M32C_OPERAND_SRC32ANPREFIXEDHI :
3390 value = fields->f_src32_an_prefixed;
3392 case M32C_OPERAND_SRC32ANPREFIXEDQI :
3393 value = fields->f_src32_an_prefixed;
3395 case M32C_OPERAND_SRC32ANPREFIXEDSI :
3396 value = fields->f_src32_an_prefixed;
3398 case M32C_OPERAND_SRC32ANUNPREFIXED :
3399 value = fields->f_src32_an_unprefixed;
3401 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
3402 value = fields->f_src32_an_unprefixed;
3404 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
3405 value = fields->f_src32_an_unprefixed;
3407 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
3408 value = fields->f_src32_an_unprefixed;
3410 case M32C_OPERAND_SRC32RNPREFIXEDHI :
3411 value = fields->f_src32_rn_prefixed_HI;
3413 case M32C_OPERAND_SRC32RNPREFIXEDQI :
3414 value = fields->f_src32_rn_prefixed_QI;
3416 case M32C_OPERAND_SRC32RNPREFIXEDSI :
3417 value = fields->f_src32_rn_prefixed_SI;
3419 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
3420 value = fields->f_src32_rn_unprefixed_HI;
3422 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
3423 value = fields->f_src32_rn_unprefixed_QI;
3425 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
3426 value = fields->f_src32_rn_unprefixed_SI;
3428 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
3429 value = fields->f_5_1;
3431 case M32C_OPERAND_X :
3434 case M32C_OPERAND_Z :
3437 case M32C_OPERAND_COND16_16 :
3438 value = fields->f_dsp_16_u8;
3440 case M32C_OPERAND_COND16_24 :
3441 value = fields->f_dsp_24_u8;
3443 case M32C_OPERAND_COND16_32 :
3444 value = fields->f_dsp_32_u8;
3446 case M32C_OPERAND_COND16C :
3447 value = fields->f_cond16;
3449 case M32C_OPERAND_COND16J :
3450 value = fields->f_cond16;
3452 case M32C_OPERAND_COND16J5 :
3453 value = fields->f_cond16j_5;
3455 case M32C_OPERAND_COND32 :
3456 value = fields->f_cond32;
3458 case M32C_OPERAND_COND32_16 :
3459 value = fields->f_dsp_16_u8;
3461 case M32C_OPERAND_COND32_24 :
3462 value = fields->f_dsp_24_u8;
3464 case M32C_OPERAND_COND32_32 :
3465 value = fields->f_dsp_32_u8;
3467 case M32C_OPERAND_COND32_40 :
3468 value = fields->f_dsp_40_u8;
3470 case M32C_OPERAND_COND32J :
3471 value = fields->f_cond32j;
3473 case M32C_OPERAND_CR1_PREFIXED_32 :
3474 value = fields->f_21_3;
3476 case M32C_OPERAND_CR1_UNPREFIXED_32 :
3477 value = fields->f_13_3;
3479 case M32C_OPERAND_CR16 :
3480 value = fields->f_9_3;
3482 case M32C_OPERAND_CR2_32 :
3483 value = fields->f_13_3;
3485 case M32C_OPERAND_CR3_PREFIXED_32 :
3486 value = fields->f_21_3;
3488 case M32C_OPERAND_CR3_UNPREFIXED_32 :
3489 value = fields->f_13_3;
3491 case M32C_OPERAND_FLAGS16 :
3492 value = fields->f_9_3;
3494 case M32C_OPERAND_FLAGS32 :
3495 value = fields->f_13_3;
3497 case M32C_OPERAND_SCCOND32 :
3498 value = fields->f_cond16;
3500 case M32C_OPERAND_SIZE :
3505 /* xgettext:c-format */
3506 fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"),
3515 m32c_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
3517 const CGEN_FIELDS * fields)
3523 case M32C_OPERAND_A0 :
3526 case M32C_OPERAND_A1 :
3529 case M32C_OPERAND_AN16_PUSH_S :
3530 value = fields->f_4_1;
3532 case M32C_OPERAND_BIT16AN :
3533 value = fields->f_dst16_an;
3535 case M32C_OPERAND_BIT16RN :
3536 value = fields->f_dst16_rn;
3538 case M32C_OPERAND_BIT3_S :
3539 value = fields->f_imm3_S;
3541 case M32C_OPERAND_BIT32ANPREFIXED :
3542 value = fields->f_dst32_an_prefixed;
3544 case M32C_OPERAND_BIT32ANUNPREFIXED :
3545 value = fields->f_dst32_an_unprefixed;
3547 case M32C_OPERAND_BIT32RNPREFIXED :
3548 value = fields->f_dst32_rn_prefixed_QI;
3550 case M32C_OPERAND_BIT32RNUNPREFIXED :
3551 value = fields->f_dst32_rn_unprefixed_QI;
3553 case M32C_OPERAND_BITBASE16_16_S8 :
3554 value = fields->f_dsp_16_s8;
3556 case M32C_OPERAND_BITBASE16_16_U16 :
3557 value = fields->f_dsp_16_u16;
3559 case M32C_OPERAND_BITBASE16_16_U8 :
3560 value = fields->f_dsp_16_u8;
3562 case M32C_OPERAND_BITBASE16_8_U11_S :
3563 value = fields->f_bitbase16_u11_S;
3565 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
3566 value = fields->f_bitbase32_16_s11_unprefixed;
3568 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
3569 value = fields->f_bitbase32_16_s19_unprefixed;
3571 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
3572 value = fields->f_bitbase32_16_u11_unprefixed;
3574 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
3575 value = fields->f_bitbase32_16_u19_unprefixed;
3577 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
3578 value = fields->f_bitbase32_16_u27_unprefixed;
3580 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
3581 value = fields->f_bitbase32_24_s11_prefixed;
3583 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
3584 value = fields->f_bitbase32_24_s19_prefixed;
3586 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
3587 value = fields->f_bitbase32_24_u11_prefixed;
3589 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
3590 value = fields->f_bitbase32_24_u19_prefixed;
3592 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
3593 value = fields->f_bitbase32_24_u27_prefixed;
3595 case M32C_OPERAND_BITNO16R :
3596 value = fields->f_dsp_16_u8;
3598 case M32C_OPERAND_BITNO32PREFIXED :
3599 value = fields->f_bitno32_prefixed;
3601 case M32C_OPERAND_BITNO32UNPREFIXED :
3602 value = fields->f_bitno32_unprefixed;
3604 case M32C_OPERAND_DSP_10_U6 :
3605 value = fields->f_dsp_10_u6;
3607 case M32C_OPERAND_DSP_16_S16 :
3608 value = fields->f_dsp_16_s16;
3610 case M32C_OPERAND_DSP_16_S8 :
3611 value = fields->f_dsp_16_s8;
3613 case M32C_OPERAND_DSP_16_U16 :
3614 value = fields->f_dsp_16_u16;
3616 case M32C_OPERAND_DSP_16_U20 :
3617 value = fields->f_dsp_16_u24;
3619 case M32C_OPERAND_DSP_16_U24 :
3620 value = fields->f_dsp_16_u24;
3622 case M32C_OPERAND_DSP_16_U8 :
3623 value = fields->f_dsp_16_u8;
3625 case M32C_OPERAND_DSP_24_S16 :
3626 value = fields->f_dsp_24_s16;
3628 case M32C_OPERAND_DSP_24_S8 :
3629 value = fields->f_dsp_24_s8;
3631 case M32C_OPERAND_DSP_24_U16 :
3632 value = fields->f_dsp_24_u16;
3634 case M32C_OPERAND_DSP_24_U20 :
3635 value = fields->f_dsp_24_u24;
3637 case M32C_OPERAND_DSP_24_U24 :
3638 value = fields->f_dsp_24_u24;
3640 case M32C_OPERAND_DSP_24_U8 :
3641 value = fields->f_dsp_24_u8;
3643 case M32C_OPERAND_DSP_32_S16 :
3644 value = fields->f_dsp_32_s16;
3646 case M32C_OPERAND_DSP_32_S8 :
3647 value = fields->f_dsp_32_s8;
3649 case M32C_OPERAND_DSP_32_U16 :
3650 value = fields->f_dsp_32_u16;
3652 case M32C_OPERAND_DSP_32_U20 :
3653 value = fields->f_dsp_32_u24;
3655 case M32C_OPERAND_DSP_32_U24 :
3656 value = fields->f_dsp_32_u24;
3658 case M32C_OPERAND_DSP_32_U8 :
3659 value = fields->f_dsp_32_u8;
3661 case M32C_OPERAND_DSP_40_S16 :
3662 value = fields->f_dsp_40_s16;
3664 case M32C_OPERAND_DSP_40_S8 :
3665 value = fields->f_dsp_40_s8;
3667 case M32C_OPERAND_DSP_40_U16 :
3668 value = fields->f_dsp_40_u16;
3670 case M32C_OPERAND_DSP_40_U20 :
3671 value = fields->f_dsp_40_u20;
3673 case M32C_OPERAND_DSP_40_U24 :
3674 value = fields->f_dsp_40_u24;
3676 case M32C_OPERAND_DSP_40_U8 :
3677 value = fields->f_dsp_40_u8;
3679 case M32C_OPERAND_DSP_48_S16 :
3680 value = fields->f_dsp_48_s16;
3682 case M32C_OPERAND_DSP_48_S8 :
3683 value = fields->f_dsp_48_s8;
3685 case M32C_OPERAND_DSP_48_U16 :
3686 value = fields->f_dsp_48_u16;
3688 case M32C_OPERAND_DSP_48_U20 :
3689 value = fields->f_dsp_48_u20;
3691 case M32C_OPERAND_DSP_48_U24 :
3692 value = fields->f_dsp_48_u24;
3694 case M32C_OPERAND_DSP_48_U8 :
3695 value = fields->f_dsp_48_u8;
3697 case M32C_OPERAND_DSP_8_S24 :
3698 value = fields->f_dsp_8_s24;
3700 case M32C_OPERAND_DSP_8_S8 :
3701 value = fields->f_dsp_8_s8;
3703 case M32C_OPERAND_DSP_8_U16 :
3704 value = fields->f_dsp_8_u16;
3706 case M32C_OPERAND_DSP_8_U24 :
3707 value = fields->f_dsp_8_u24;
3709 case M32C_OPERAND_DSP_8_U6 :
3710 value = fields->f_dsp_8_u6;
3712 case M32C_OPERAND_DSP_8_U8 :
3713 value = fields->f_dsp_8_u8;
3715 case M32C_OPERAND_DST16AN :
3716 value = fields->f_dst16_an;
3718 case M32C_OPERAND_DST16AN_S :
3719 value = fields->f_dst16_an_s;
3721 case M32C_OPERAND_DST16ANHI :
3722 value = fields->f_dst16_an;
3724 case M32C_OPERAND_DST16ANQI :
3725 value = fields->f_dst16_an;
3727 case M32C_OPERAND_DST16ANQI_S :
3728 value = fields->f_dst16_rn_QI_s;
3730 case M32C_OPERAND_DST16ANSI :
3731 value = fields->f_dst16_an;
3733 case M32C_OPERAND_DST16RNEXTQI :
3734 value = fields->f_dst16_rn_ext;
3736 case M32C_OPERAND_DST16RNHI :
3737 value = fields->f_dst16_rn;
3739 case M32C_OPERAND_DST16RNQI :
3740 value = fields->f_dst16_rn;
3742 case M32C_OPERAND_DST16RNQI_S :
3743 value = fields->f_dst16_rn_QI_s;
3745 case M32C_OPERAND_DST16RNSI :
3746 value = fields->f_dst16_rn;
3748 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
3749 value = fields->f_dst32_an_unprefixed;
3751 case M32C_OPERAND_DST32ANPREFIXED :
3752 value = fields->f_dst32_an_prefixed;
3754 case M32C_OPERAND_DST32ANPREFIXEDHI :
3755 value = fields->f_dst32_an_prefixed;
3757 case M32C_OPERAND_DST32ANPREFIXEDQI :
3758 value = fields->f_dst32_an_prefixed;
3760 case M32C_OPERAND_DST32ANPREFIXEDSI :
3761 value = fields->f_dst32_an_prefixed;
3763 case M32C_OPERAND_DST32ANUNPREFIXED :
3764 value = fields->f_dst32_an_unprefixed;
3766 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
3767 value = fields->f_dst32_an_unprefixed;
3769 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
3770 value = fields->f_dst32_an_unprefixed;
3772 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
3773 value = fields->f_dst32_an_unprefixed;
3775 case M32C_OPERAND_DST32R0HI_S :
3778 case M32C_OPERAND_DST32R0QI_S :
3781 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
3782 value = fields->f_dst32_rn_ext_unprefixed;
3784 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
3785 value = fields->f_dst32_rn_ext_unprefixed;
3787 case M32C_OPERAND_DST32RNPREFIXEDHI :
3788 value = fields->f_dst32_rn_prefixed_HI;
3790 case M32C_OPERAND_DST32RNPREFIXEDQI :
3791 value = fields->f_dst32_rn_prefixed_QI;
3793 case M32C_OPERAND_DST32RNPREFIXEDSI :
3794 value = fields->f_dst32_rn_prefixed_SI;
3796 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
3797 value = fields->f_dst32_rn_unprefixed_HI;
3799 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
3800 value = fields->f_dst32_rn_unprefixed_QI;
3802 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
3803 value = fields->f_dst32_rn_unprefixed_SI;
3805 case M32C_OPERAND_G :
3808 case M32C_OPERAND_IMM_12_S4 :
3809 value = fields->f_imm_12_s4;
3811 case M32C_OPERAND_IMM_12_S4N :
3812 value = fields->f_imm_12_s4;
3814 case M32C_OPERAND_IMM_13_U3 :
3815 value = fields->f_imm_13_u3;
3817 case M32C_OPERAND_IMM_16_HI :
3818 value = fields->f_dsp_16_s16;
3820 case M32C_OPERAND_IMM_16_QI :
3821 value = fields->f_dsp_16_s8;
3823 case M32C_OPERAND_IMM_16_SI :
3824 value = fields->f_dsp_16_s32;
3826 case M32C_OPERAND_IMM_20_S4 :
3827 value = fields->f_imm_20_s4;
3829 case M32C_OPERAND_IMM_24_HI :
3830 value = fields->f_dsp_24_s16;
3832 case M32C_OPERAND_IMM_24_QI :
3833 value = fields->f_dsp_24_s8;
3835 case M32C_OPERAND_IMM_24_SI :
3836 value = fields->f_dsp_24_s32;
3838 case M32C_OPERAND_IMM_32_HI :
3839 value = fields->f_dsp_32_s16;
3841 case M32C_OPERAND_IMM_32_QI :
3842 value = fields->f_dsp_32_s8;
3844 case M32C_OPERAND_IMM_32_SI :
3845 value = fields->f_dsp_32_s32;
3847 case M32C_OPERAND_IMM_40_HI :
3848 value = fields->f_dsp_40_s16;
3850 case M32C_OPERAND_IMM_40_QI :
3851 value = fields->f_dsp_40_s8;
3853 case M32C_OPERAND_IMM_40_SI :
3854 value = fields->f_dsp_40_s32;
3856 case M32C_OPERAND_IMM_48_HI :
3857 value = fields->f_dsp_48_s16;
3859 case M32C_OPERAND_IMM_48_QI :
3860 value = fields->f_dsp_48_s8;
3862 case M32C_OPERAND_IMM_48_SI :
3863 value = fields->f_dsp_48_s32;
3865 case M32C_OPERAND_IMM_56_HI :
3866 value = fields->f_dsp_56_s16;
3868 case M32C_OPERAND_IMM_56_QI :
3869 value = fields->f_dsp_56_s8;
3871 case M32C_OPERAND_IMM_64_HI :
3872 value = fields->f_dsp_64_s16;
3874 case M32C_OPERAND_IMM_8_HI :
3875 value = fields->f_dsp_8_s16;
3877 case M32C_OPERAND_IMM_8_QI :
3878 value = fields->f_dsp_8_s8;
3880 case M32C_OPERAND_IMM_8_S4 :
3881 value = fields->f_imm_8_s4;
3883 case M32C_OPERAND_IMM_8_S4N :
3884 value = fields->f_imm_8_s4;
3886 case M32C_OPERAND_IMM_SH_12_S4 :
3887 value = fields->f_imm_12_s4;
3889 case M32C_OPERAND_IMM_SH_20_S4 :
3890 value = fields->f_imm_20_s4;
3892 case M32C_OPERAND_IMM_SH_8_S4 :
3893 value = fields->f_imm_8_s4;
3895 case M32C_OPERAND_IMM1_S :
3896 value = fields->f_imm1_S;
3898 case M32C_OPERAND_IMM3_S :
3899 value = fields->f_imm3_S;
3901 case M32C_OPERAND_LAB_16_8 :
3902 value = fields->f_lab_16_8;
3904 case M32C_OPERAND_LAB_24_8 :
3905 value = fields->f_lab_24_8;
3907 case M32C_OPERAND_LAB_32_8 :
3908 value = fields->f_lab_32_8;
3910 case M32C_OPERAND_LAB_40_8 :
3911 value = fields->f_lab_40_8;
3913 case M32C_OPERAND_LAB_5_3 :
3914 value = fields->f_lab_5_3;
3916 case M32C_OPERAND_LAB_8_16 :
3917 value = fields->f_lab_8_16;
3919 case M32C_OPERAND_LAB_8_24 :
3920 value = fields->f_lab_8_24;
3922 case M32C_OPERAND_LAB_8_8 :
3923 value = fields->f_lab_8_8;
3925 case M32C_OPERAND_LAB32_JMP_S :
3926 value = fields->f_lab32_jmp_s;
3928 case M32C_OPERAND_Q :
3931 case M32C_OPERAND_R0 :
3934 case M32C_OPERAND_R0H :
3937 case M32C_OPERAND_R0L :
3940 case M32C_OPERAND_R1 :
3943 case M32C_OPERAND_R1R2R0 :
3946 case M32C_OPERAND_R2 :
3949 case M32C_OPERAND_R2R0 :
3952 case M32C_OPERAND_R3 :
3955 case M32C_OPERAND_R3R1 :
3958 case M32C_OPERAND_REGSETPOP :
3959 value = fields->f_8_8;
3961 case M32C_OPERAND_REGSETPUSH :
3962 value = fields->f_8_8;
3964 case M32C_OPERAND_RN16_PUSH_S :
3965 value = fields->f_4_1;
3967 case M32C_OPERAND_S :
3970 case M32C_OPERAND_SRC16AN :
3971 value = fields->f_src16_an;
3973 case M32C_OPERAND_SRC16ANHI :
3974 value = fields->f_src16_an;
3976 case M32C_OPERAND_SRC16ANQI :
3977 value = fields->f_src16_an;
3979 case M32C_OPERAND_SRC16RNHI :
3980 value = fields->f_src16_rn;
3982 case M32C_OPERAND_SRC16RNQI :
3983 value = fields->f_src16_rn;
3985 case M32C_OPERAND_SRC32ANPREFIXED :
3986 value = fields->f_src32_an_prefixed;
3988 case M32C_OPERAND_SRC32ANPREFIXEDHI :
3989 value = fields->f_src32_an_prefixed;
3991 case M32C_OPERAND_SRC32ANPREFIXEDQI :
3992 value = fields->f_src32_an_prefixed;
3994 case M32C_OPERAND_SRC32ANPREFIXEDSI :
3995 value = fields->f_src32_an_prefixed;
3997 case M32C_OPERAND_SRC32ANUNPREFIXED :
3998 value = fields->f_src32_an_unprefixed;
4000 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
4001 value = fields->f_src32_an_unprefixed;
4003 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
4004 value = fields->f_src32_an_unprefixed;
4006 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
4007 value = fields->f_src32_an_unprefixed;
4009 case M32C_OPERAND_SRC32RNPREFIXEDHI :
4010 value = fields->f_src32_rn_prefixed_HI;
4012 case M32C_OPERAND_SRC32RNPREFIXEDQI :
4013 value = fields->f_src32_rn_prefixed_QI;
4015 case M32C_OPERAND_SRC32RNPREFIXEDSI :
4016 value = fields->f_src32_rn_prefixed_SI;
4018 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
4019 value = fields->f_src32_rn_unprefixed_HI;
4021 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
4022 value = fields->f_src32_rn_unprefixed_QI;
4024 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
4025 value = fields->f_src32_rn_unprefixed_SI;
4027 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
4028 value = fields->f_5_1;
4030 case M32C_OPERAND_X :
4033 case M32C_OPERAND_Z :
4036 case M32C_OPERAND_COND16_16 :
4037 value = fields->f_dsp_16_u8;
4039 case M32C_OPERAND_COND16_24 :
4040 value = fields->f_dsp_24_u8;
4042 case M32C_OPERAND_COND16_32 :
4043 value = fields->f_dsp_32_u8;
4045 case M32C_OPERAND_COND16C :
4046 value = fields->f_cond16;
4048 case M32C_OPERAND_COND16J :
4049 value = fields->f_cond16;
4051 case M32C_OPERAND_COND16J5 :
4052 value = fields->f_cond16j_5;
4054 case M32C_OPERAND_COND32 :
4055 value = fields->f_cond32;
4057 case M32C_OPERAND_COND32_16 :
4058 value = fields->f_dsp_16_u8;
4060 case M32C_OPERAND_COND32_24 :
4061 value = fields->f_dsp_24_u8;
4063 case M32C_OPERAND_COND32_32 :
4064 value = fields->f_dsp_32_u8;
4066 case M32C_OPERAND_COND32_40 :
4067 value = fields->f_dsp_40_u8;
4069 case M32C_OPERAND_COND32J :
4070 value = fields->f_cond32j;
4072 case M32C_OPERAND_CR1_PREFIXED_32 :
4073 value = fields->f_21_3;
4075 case M32C_OPERAND_CR1_UNPREFIXED_32 :
4076 value = fields->f_13_3;
4078 case M32C_OPERAND_CR16 :
4079 value = fields->f_9_3;
4081 case M32C_OPERAND_CR2_32 :
4082 value = fields->f_13_3;
4084 case M32C_OPERAND_CR3_PREFIXED_32 :
4085 value = fields->f_21_3;
4087 case M32C_OPERAND_CR3_UNPREFIXED_32 :
4088 value = fields->f_13_3;
4090 case M32C_OPERAND_FLAGS16 :
4091 value = fields->f_9_3;
4093 case M32C_OPERAND_FLAGS32 :
4094 value = fields->f_13_3;
4096 case M32C_OPERAND_SCCOND32 :
4097 value = fields->f_cond16;
4099 case M32C_OPERAND_SIZE :
4104 /* xgettext:c-format */
4105 fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"),
4113 void m32c_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
4114 void m32c_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
4116 /* Stuffing values in cgen_fields is handled by a collection of functions.
4117 They are distinguished by the type of the VALUE argument they accept.
4118 TODO: floating point, inlining support, remove cases where argument type
4122 m32c_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
4124 CGEN_FIELDS * fields,
4129 case M32C_OPERAND_A0 :
4131 case M32C_OPERAND_A1 :
4133 case M32C_OPERAND_AN16_PUSH_S :
4134 fields->f_4_1 = value;
4136 case M32C_OPERAND_BIT16AN :
4137 fields->f_dst16_an = value;
4139 case M32C_OPERAND_BIT16RN :
4140 fields->f_dst16_rn = value;
4142 case M32C_OPERAND_BIT3_S :
4143 fields->f_imm3_S = value;
4145 case M32C_OPERAND_BIT32ANPREFIXED :
4146 fields->f_dst32_an_prefixed = value;
4148 case M32C_OPERAND_BIT32ANUNPREFIXED :
4149 fields->f_dst32_an_unprefixed = value;
4151 case M32C_OPERAND_BIT32RNPREFIXED :
4152 fields->f_dst32_rn_prefixed_QI = value;
4154 case M32C_OPERAND_BIT32RNUNPREFIXED :
4155 fields->f_dst32_rn_unprefixed_QI = value;
4157 case M32C_OPERAND_BITBASE16_16_S8 :
4158 fields->f_dsp_16_s8 = value;
4160 case M32C_OPERAND_BITBASE16_16_U16 :
4161 fields->f_dsp_16_u16 = value;
4163 case M32C_OPERAND_BITBASE16_16_U8 :
4164 fields->f_dsp_16_u8 = value;
4166 case M32C_OPERAND_BITBASE16_8_U11_S :
4167 fields->f_bitbase16_u11_S = value;
4169 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
4170 fields->f_bitbase32_16_s11_unprefixed = value;
4172 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
4173 fields->f_bitbase32_16_s19_unprefixed = value;
4175 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
4176 fields->f_bitbase32_16_u11_unprefixed = value;
4178 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
4179 fields->f_bitbase32_16_u19_unprefixed = value;
4181 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
4182 fields->f_bitbase32_16_u27_unprefixed = value;
4184 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
4185 fields->f_bitbase32_24_s11_prefixed = value;
4187 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
4188 fields->f_bitbase32_24_s19_prefixed = value;
4190 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
4191 fields->f_bitbase32_24_u11_prefixed = value;
4193 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
4194 fields->f_bitbase32_24_u19_prefixed = value;
4196 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
4197 fields->f_bitbase32_24_u27_prefixed = value;
4199 case M32C_OPERAND_BITNO16R :
4200 fields->f_dsp_16_u8 = value;
4202 case M32C_OPERAND_BITNO32PREFIXED :
4203 fields->f_bitno32_prefixed = value;
4205 case M32C_OPERAND_BITNO32UNPREFIXED :
4206 fields->f_bitno32_unprefixed = value;
4208 case M32C_OPERAND_DSP_10_U6 :
4209 fields->f_dsp_10_u6 = value;
4211 case M32C_OPERAND_DSP_16_S16 :
4212 fields->f_dsp_16_s16 = value;
4214 case M32C_OPERAND_DSP_16_S8 :
4215 fields->f_dsp_16_s8 = value;
4217 case M32C_OPERAND_DSP_16_U16 :
4218 fields->f_dsp_16_u16 = value;
4220 case M32C_OPERAND_DSP_16_U20 :
4221 fields->f_dsp_16_u24 = value;
4223 case M32C_OPERAND_DSP_16_U24 :
4224 fields->f_dsp_16_u24 = value;
4226 case M32C_OPERAND_DSP_16_U8 :
4227 fields->f_dsp_16_u8 = value;
4229 case M32C_OPERAND_DSP_24_S16 :
4230 fields->f_dsp_24_s16 = value;
4232 case M32C_OPERAND_DSP_24_S8 :
4233 fields->f_dsp_24_s8 = value;
4235 case M32C_OPERAND_DSP_24_U16 :
4236 fields->f_dsp_24_u16 = value;
4238 case M32C_OPERAND_DSP_24_U20 :
4239 fields->f_dsp_24_u24 = value;
4241 case M32C_OPERAND_DSP_24_U24 :
4242 fields->f_dsp_24_u24 = value;
4244 case M32C_OPERAND_DSP_24_U8 :
4245 fields->f_dsp_24_u8 = value;
4247 case M32C_OPERAND_DSP_32_S16 :
4248 fields->f_dsp_32_s16 = value;
4250 case M32C_OPERAND_DSP_32_S8 :
4251 fields->f_dsp_32_s8 = value;
4253 case M32C_OPERAND_DSP_32_U16 :
4254 fields->f_dsp_32_u16 = value;
4256 case M32C_OPERAND_DSP_32_U20 :
4257 fields->f_dsp_32_u24 = value;
4259 case M32C_OPERAND_DSP_32_U24 :
4260 fields->f_dsp_32_u24 = value;
4262 case M32C_OPERAND_DSP_32_U8 :
4263 fields->f_dsp_32_u8 = value;
4265 case M32C_OPERAND_DSP_40_S16 :
4266 fields->f_dsp_40_s16 = value;
4268 case M32C_OPERAND_DSP_40_S8 :
4269 fields->f_dsp_40_s8 = value;
4271 case M32C_OPERAND_DSP_40_U16 :
4272 fields->f_dsp_40_u16 = value;
4274 case M32C_OPERAND_DSP_40_U20 :
4275 fields->f_dsp_40_u20 = value;
4277 case M32C_OPERAND_DSP_40_U24 :
4278 fields->f_dsp_40_u24 = value;
4280 case M32C_OPERAND_DSP_40_U8 :
4281 fields->f_dsp_40_u8 = value;
4283 case M32C_OPERAND_DSP_48_S16 :
4284 fields->f_dsp_48_s16 = value;
4286 case M32C_OPERAND_DSP_48_S8 :
4287 fields->f_dsp_48_s8 = value;
4289 case M32C_OPERAND_DSP_48_U16 :
4290 fields->f_dsp_48_u16 = value;
4292 case M32C_OPERAND_DSP_48_U20 :
4293 fields->f_dsp_48_u20 = value;
4295 case M32C_OPERAND_DSP_48_U24 :
4296 fields->f_dsp_48_u24 = value;
4298 case M32C_OPERAND_DSP_48_U8 :
4299 fields->f_dsp_48_u8 = value;
4301 case M32C_OPERAND_DSP_8_S24 :
4302 fields->f_dsp_8_s24 = value;
4304 case M32C_OPERAND_DSP_8_S8 :
4305 fields->f_dsp_8_s8 = value;
4307 case M32C_OPERAND_DSP_8_U16 :
4308 fields->f_dsp_8_u16 = value;
4310 case M32C_OPERAND_DSP_8_U24 :
4311 fields->f_dsp_8_u24 = value;
4313 case M32C_OPERAND_DSP_8_U6 :
4314 fields->f_dsp_8_u6 = value;
4316 case M32C_OPERAND_DSP_8_U8 :
4317 fields->f_dsp_8_u8 = value;
4319 case M32C_OPERAND_DST16AN :
4320 fields->f_dst16_an = value;
4322 case M32C_OPERAND_DST16AN_S :
4323 fields->f_dst16_an_s = value;
4325 case M32C_OPERAND_DST16ANHI :
4326 fields->f_dst16_an = value;
4328 case M32C_OPERAND_DST16ANQI :
4329 fields->f_dst16_an = value;
4331 case M32C_OPERAND_DST16ANQI_S :
4332 fields->f_dst16_rn_QI_s = value;
4334 case M32C_OPERAND_DST16ANSI :
4335 fields->f_dst16_an = value;
4337 case M32C_OPERAND_DST16RNEXTQI :
4338 fields->f_dst16_rn_ext = value;
4340 case M32C_OPERAND_DST16RNHI :
4341 fields->f_dst16_rn = value;
4343 case M32C_OPERAND_DST16RNQI :
4344 fields->f_dst16_rn = value;
4346 case M32C_OPERAND_DST16RNQI_S :
4347 fields->f_dst16_rn_QI_s = value;
4349 case M32C_OPERAND_DST16RNSI :
4350 fields->f_dst16_rn = value;
4352 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
4353 fields->f_dst32_an_unprefixed = value;
4355 case M32C_OPERAND_DST32ANPREFIXED :
4356 fields->f_dst32_an_prefixed = value;
4358 case M32C_OPERAND_DST32ANPREFIXEDHI :
4359 fields->f_dst32_an_prefixed = value;
4361 case M32C_OPERAND_DST32ANPREFIXEDQI :
4362 fields->f_dst32_an_prefixed = value;
4364 case M32C_OPERAND_DST32ANPREFIXEDSI :
4365 fields->f_dst32_an_prefixed = value;
4367 case M32C_OPERAND_DST32ANUNPREFIXED :
4368 fields->f_dst32_an_unprefixed = value;
4370 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
4371 fields->f_dst32_an_unprefixed = value;
4373 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
4374 fields->f_dst32_an_unprefixed = value;
4376 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
4377 fields->f_dst32_an_unprefixed = value;
4379 case M32C_OPERAND_DST32R0HI_S :
4381 case M32C_OPERAND_DST32R0QI_S :
4383 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
4384 fields->f_dst32_rn_ext_unprefixed = value;
4386 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
4387 fields->f_dst32_rn_ext_unprefixed = value;
4389 case M32C_OPERAND_DST32RNPREFIXEDHI :
4390 fields->f_dst32_rn_prefixed_HI = value;
4392 case M32C_OPERAND_DST32RNPREFIXEDQI :
4393 fields->f_dst32_rn_prefixed_QI = value;
4395 case M32C_OPERAND_DST32RNPREFIXEDSI :
4396 fields->f_dst32_rn_prefixed_SI = value;
4398 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
4399 fields->f_dst32_rn_unprefixed_HI = value;
4401 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
4402 fields->f_dst32_rn_unprefixed_QI = value;
4404 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
4405 fields->f_dst32_rn_unprefixed_SI = value;
4407 case M32C_OPERAND_G :
4409 case M32C_OPERAND_IMM_12_S4 :
4410 fields->f_imm_12_s4 = value;
4412 case M32C_OPERAND_IMM_12_S4N :
4413 fields->f_imm_12_s4 = value;
4415 case M32C_OPERAND_IMM_13_U3 :
4416 fields->f_imm_13_u3 = value;
4418 case M32C_OPERAND_IMM_16_HI :
4419 fields->f_dsp_16_s16 = value;
4421 case M32C_OPERAND_IMM_16_QI :
4422 fields->f_dsp_16_s8 = value;
4424 case M32C_OPERAND_IMM_16_SI :
4425 fields->f_dsp_16_s32 = value;
4427 case M32C_OPERAND_IMM_20_S4 :
4428 fields->f_imm_20_s4 = value;
4430 case M32C_OPERAND_IMM_24_HI :
4431 fields->f_dsp_24_s16 = value;
4433 case M32C_OPERAND_IMM_24_QI :
4434 fields->f_dsp_24_s8 = value;
4436 case M32C_OPERAND_IMM_24_SI :
4437 fields->f_dsp_24_s32 = value;
4439 case M32C_OPERAND_IMM_32_HI :
4440 fields->f_dsp_32_s16 = value;
4442 case M32C_OPERAND_IMM_32_QI :
4443 fields->f_dsp_32_s8 = value;
4445 case M32C_OPERAND_IMM_32_SI :
4446 fields->f_dsp_32_s32 = value;
4448 case M32C_OPERAND_IMM_40_HI :
4449 fields->f_dsp_40_s16 = value;
4451 case M32C_OPERAND_IMM_40_QI :
4452 fields->f_dsp_40_s8 = value;
4454 case M32C_OPERAND_IMM_40_SI :
4455 fields->f_dsp_40_s32 = value;
4457 case M32C_OPERAND_IMM_48_HI :
4458 fields->f_dsp_48_s16 = value;
4460 case M32C_OPERAND_IMM_48_QI :
4461 fields->f_dsp_48_s8 = value;
4463 case M32C_OPERAND_IMM_48_SI :
4464 fields->f_dsp_48_s32 = value;
4466 case M32C_OPERAND_IMM_56_HI :
4467 fields->f_dsp_56_s16 = value;
4469 case M32C_OPERAND_IMM_56_QI :
4470 fields->f_dsp_56_s8 = value;
4472 case M32C_OPERAND_IMM_64_HI :
4473 fields->f_dsp_64_s16 = value;
4475 case M32C_OPERAND_IMM_8_HI :
4476 fields->f_dsp_8_s16 = value;
4478 case M32C_OPERAND_IMM_8_QI :
4479 fields->f_dsp_8_s8 = value;
4481 case M32C_OPERAND_IMM_8_S4 :
4482 fields->f_imm_8_s4 = value;
4484 case M32C_OPERAND_IMM_8_S4N :
4485 fields->f_imm_8_s4 = value;
4487 case M32C_OPERAND_IMM_SH_12_S4 :
4488 fields->f_imm_12_s4 = value;
4490 case M32C_OPERAND_IMM_SH_20_S4 :
4491 fields->f_imm_20_s4 = value;
4493 case M32C_OPERAND_IMM_SH_8_S4 :
4494 fields->f_imm_8_s4 = value;
4496 case M32C_OPERAND_IMM1_S :
4497 fields->f_imm1_S = value;
4499 case M32C_OPERAND_IMM3_S :
4500 fields->f_imm3_S = value;
4502 case M32C_OPERAND_LAB_16_8 :
4503 fields->f_lab_16_8 = value;
4505 case M32C_OPERAND_LAB_24_8 :
4506 fields->f_lab_24_8 = value;
4508 case M32C_OPERAND_LAB_32_8 :
4509 fields->f_lab_32_8 = value;
4511 case M32C_OPERAND_LAB_40_8 :
4512 fields->f_lab_40_8 = value;
4514 case M32C_OPERAND_LAB_5_3 :
4515 fields->f_lab_5_3 = value;
4517 case M32C_OPERAND_LAB_8_16 :
4518 fields->f_lab_8_16 = value;
4520 case M32C_OPERAND_LAB_8_24 :
4521 fields->f_lab_8_24 = value;
4523 case M32C_OPERAND_LAB_8_8 :
4524 fields->f_lab_8_8 = value;
4526 case M32C_OPERAND_LAB32_JMP_S :
4527 fields->f_lab32_jmp_s = value;
4529 case M32C_OPERAND_Q :
4531 case M32C_OPERAND_R0 :
4533 case M32C_OPERAND_R0H :
4535 case M32C_OPERAND_R0L :
4537 case M32C_OPERAND_R1 :
4539 case M32C_OPERAND_R1R2R0 :
4541 case M32C_OPERAND_R2 :
4543 case M32C_OPERAND_R2R0 :
4545 case M32C_OPERAND_R3 :
4547 case M32C_OPERAND_R3R1 :
4549 case M32C_OPERAND_REGSETPOP :
4550 fields->f_8_8 = value;
4552 case M32C_OPERAND_REGSETPUSH :
4553 fields->f_8_8 = value;
4555 case M32C_OPERAND_RN16_PUSH_S :
4556 fields->f_4_1 = value;
4558 case M32C_OPERAND_S :
4560 case M32C_OPERAND_SRC16AN :
4561 fields->f_src16_an = value;
4563 case M32C_OPERAND_SRC16ANHI :
4564 fields->f_src16_an = value;
4566 case M32C_OPERAND_SRC16ANQI :
4567 fields->f_src16_an = value;
4569 case M32C_OPERAND_SRC16RNHI :
4570 fields->f_src16_rn = value;
4572 case M32C_OPERAND_SRC16RNQI :
4573 fields->f_src16_rn = value;
4575 case M32C_OPERAND_SRC32ANPREFIXED :
4576 fields->f_src32_an_prefixed = value;
4578 case M32C_OPERAND_SRC32ANPREFIXEDHI :
4579 fields->f_src32_an_prefixed = value;
4581 case M32C_OPERAND_SRC32ANPREFIXEDQI :
4582 fields->f_src32_an_prefixed = value;
4584 case M32C_OPERAND_SRC32ANPREFIXEDSI :
4585 fields->f_src32_an_prefixed = value;
4587 case M32C_OPERAND_SRC32ANUNPREFIXED :
4588 fields->f_src32_an_unprefixed = value;
4590 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
4591 fields->f_src32_an_unprefixed = value;
4593 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
4594 fields->f_src32_an_unprefixed = value;
4596 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
4597 fields->f_src32_an_unprefixed = value;
4599 case M32C_OPERAND_SRC32RNPREFIXEDHI :
4600 fields->f_src32_rn_prefixed_HI = value;
4602 case M32C_OPERAND_SRC32RNPREFIXEDQI :
4603 fields->f_src32_rn_prefixed_QI = value;
4605 case M32C_OPERAND_SRC32RNPREFIXEDSI :
4606 fields->f_src32_rn_prefixed_SI = value;
4608 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
4609 fields->f_src32_rn_unprefixed_HI = value;
4611 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
4612 fields->f_src32_rn_unprefixed_QI = value;
4614 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
4615 fields->f_src32_rn_unprefixed_SI = value;
4617 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
4618 fields->f_5_1 = value;
4620 case M32C_OPERAND_X :
4622 case M32C_OPERAND_Z :
4624 case M32C_OPERAND_COND16_16 :
4625 fields->f_dsp_16_u8 = value;
4627 case M32C_OPERAND_COND16_24 :
4628 fields->f_dsp_24_u8 = value;
4630 case M32C_OPERAND_COND16_32 :
4631 fields->f_dsp_32_u8 = value;
4633 case M32C_OPERAND_COND16C :
4634 fields->f_cond16 = value;
4636 case M32C_OPERAND_COND16J :
4637 fields->f_cond16 = value;
4639 case M32C_OPERAND_COND16J5 :
4640 fields->f_cond16j_5 = value;
4642 case M32C_OPERAND_COND32 :
4643 fields->f_cond32 = value;
4645 case M32C_OPERAND_COND32_16 :
4646 fields->f_dsp_16_u8 = value;
4648 case M32C_OPERAND_COND32_24 :
4649 fields->f_dsp_24_u8 = value;
4651 case M32C_OPERAND_COND32_32 :
4652 fields->f_dsp_32_u8 = value;
4654 case M32C_OPERAND_COND32_40 :
4655 fields->f_dsp_40_u8 = value;
4657 case M32C_OPERAND_COND32J :
4658 fields->f_cond32j = value;
4660 case M32C_OPERAND_CR1_PREFIXED_32 :
4661 fields->f_21_3 = value;
4663 case M32C_OPERAND_CR1_UNPREFIXED_32 :
4664 fields->f_13_3 = value;
4666 case M32C_OPERAND_CR16 :
4667 fields->f_9_3 = value;
4669 case M32C_OPERAND_CR2_32 :
4670 fields->f_13_3 = value;
4672 case M32C_OPERAND_CR3_PREFIXED_32 :
4673 fields->f_21_3 = value;
4675 case M32C_OPERAND_CR3_UNPREFIXED_32 :
4676 fields->f_13_3 = value;
4678 case M32C_OPERAND_FLAGS16 :
4679 fields->f_9_3 = value;
4681 case M32C_OPERAND_FLAGS32 :
4682 fields->f_13_3 = value;
4684 case M32C_OPERAND_SCCOND32 :
4685 fields->f_cond16 = value;
4687 case M32C_OPERAND_SIZE :
4691 /* xgettext:c-format */
4692 fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"),
4699 m32c_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
4701 CGEN_FIELDS * fields,
4706 case M32C_OPERAND_A0 :
4708 case M32C_OPERAND_A1 :
4710 case M32C_OPERAND_AN16_PUSH_S :
4711 fields->f_4_1 = value;
4713 case M32C_OPERAND_BIT16AN :
4714 fields->f_dst16_an = value;
4716 case M32C_OPERAND_BIT16RN :
4717 fields->f_dst16_rn = value;
4719 case M32C_OPERAND_BIT3_S :
4720 fields->f_imm3_S = value;
4722 case M32C_OPERAND_BIT32ANPREFIXED :
4723 fields->f_dst32_an_prefixed = value;
4725 case M32C_OPERAND_BIT32ANUNPREFIXED :
4726 fields->f_dst32_an_unprefixed = value;
4728 case M32C_OPERAND_BIT32RNPREFIXED :
4729 fields->f_dst32_rn_prefixed_QI = value;
4731 case M32C_OPERAND_BIT32RNUNPREFIXED :
4732 fields->f_dst32_rn_unprefixed_QI = value;
4734 case M32C_OPERAND_BITBASE16_16_S8 :
4735 fields->f_dsp_16_s8 = value;
4737 case M32C_OPERAND_BITBASE16_16_U16 :
4738 fields->f_dsp_16_u16 = value;
4740 case M32C_OPERAND_BITBASE16_16_U8 :
4741 fields->f_dsp_16_u8 = value;
4743 case M32C_OPERAND_BITBASE16_8_U11_S :
4744 fields->f_bitbase16_u11_S = value;
4746 case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
4747 fields->f_bitbase32_16_s11_unprefixed = value;
4749 case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
4750 fields->f_bitbase32_16_s19_unprefixed = value;
4752 case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
4753 fields->f_bitbase32_16_u11_unprefixed = value;
4755 case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
4756 fields->f_bitbase32_16_u19_unprefixed = value;
4758 case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
4759 fields->f_bitbase32_16_u27_unprefixed = value;
4761 case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
4762 fields->f_bitbase32_24_s11_prefixed = value;
4764 case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
4765 fields->f_bitbase32_24_s19_prefixed = value;
4767 case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
4768 fields->f_bitbase32_24_u11_prefixed = value;
4770 case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
4771 fields->f_bitbase32_24_u19_prefixed = value;
4773 case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
4774 fields->f_bitbase32_24_u27_prefixed = value;
4776 case M32C_OPERAND_BITNO16R :
4777 fields->f_dsp_16_u8 = value;
4779 case M32C_OPERAND_BITNO32PREFIXED :
4780 fields->f_bitno32_prefixed = value;
4782 case M32C_OPERAND_BITNO32UNPREFIXED :
4783 fields->f_bitno32_unprefixed = value;
4785 case M32C_OPERAND_DSP_10_U6 :
4786 fields->f_dsp_10_u6 = value;
4788 case M32C_OPERAND_DSP_16_S16 :
4789 fields->f_dsp_16_s16 = value;
4791 case M32C_OPERAND_DSP_16_S8 :
4792 fields->f_dsp_16_s8 = value;
4794 case M32C_OPERAND_DSP_16_U16 :
4795 fields->f_dsp_16_u16 = value;
4797 case M32C_OPERAND_DSP_16_U20 :
4798 fields->f_dsp_16_u24 = value;
4800 case M32C_OPERAND_DSP_16_U24 :
4801 fields->f_dsp_16_u24 = value;
4803 case M32C_OPERAND_DSP_16_U8 :
4804 fields->f_dsp_16_u8 = value;
4806 case M32C_OPERAND_DSP_24_S16 :
4807 fields->f_dsp_24_s16 = value;
4809 case M32C_OPERAND_DSP_24_S8 :
4810 fields->f_dsp_24_s8 = value;
4812 case M32C_OPERAND_DSP_24_U16 :
4813 fields->f_dsp_24_u16 = value;
4815 case M32C_OPERAND_DSP_24_U20 :
4816 fields->f_dsp_24_u24 = value;
4818 case M32C_OPERAND_DSP_24_U24 :
4819 fields->f_dsp_24_u24 = value;
4821 case M32C_OPERAND_DSP_24_U8 :
4822 fields->f_dsp_24_u8 = value;
4824 case M32C_OPERAND_DSP_32_S16 :
4825 fields->f_dsp_32_s16 = value;
4827 case M32C_OPERAND_DSP_32_S8 :
4828 fields->f_dsp_32_s8 = value;
4830 case M32C_OPERAND_DSP_32_U16 :
4831 fields->f_dsp_32_u16 = value;
4833 case M32C_OPERAND_DSP_32_U20 :
4834 fields->f_dsp_32_u24 = value;
4836 case M32C_OPERAND_DSP_32_U24 :
4837 fields->f_dsp_32_u24 = value;
4839 case M32C_OPERAND_DSP_32_U8 :
4840 fields->f_dsp_32_u8 = value;
4842 case M32C_OPERAND_DSP_40_S16 :
4843 fields->f_dsp_40_s16 = value;
4845 case M32C_OPERAND_DSP_40_S8 :
4846 fields->f_dsp_40_s8 = value;
4848 case M32C_OPERAND_DSP_40_U16 :
4849 fields->f_dsp_40_u16 = value;
4851 case M32C_OPERAND_DSP_40_U20 :
4852 fields->f_dsp_40_u20 = value;
4854 case M32C_OPERAND_DSP_40_U24 :
4855 fields->f_dsp_40_u24 = value;
4857 case M32C_OPERAND_DSP_40_U8 :
4858 fields->f_dsp_40_u8 = value;
4860 case M32C_OPERAND_DSP_48_S16 :
4861 fields->f_dsp_48_s16 = value;
4863 case M32C_OPERAND_DSP_48_S8 :
4864 fields->f_dsp_48_s8 = value;
4866 case M32C_OPERAND_DSP_48_U16 :
4867 fields->f_dsp_48_u16 = value;
4869 case M32C_OPERAND_DSP_48_U20 :
4870 fields->f_dsp_48_u20 = value;
4872 case M32C_OPERAND_DSP_48_U24 :
4873 fields->f_dsp_48_u24 = value;
4875 case M32C_OPERAND_DSP_48_U8 :
4876 fields->f_dsp_48_u8 = value;
4878 case M32C_OPERAND_DSP_8_S24 :
4879 fields->f_dsp_8_s24 = value;
4881 case M32C_OPERAND_DSP_8_S8 :
4882 fields->f_dsp_8_s8 = value;
4884 case M32C_OPERAND_DSP_8_U16 :
4885 fields->f_dsp_8_u16 = value;
4887 case M32C_OPERAND_DSP_8_U24 :
4888 fields->f_dsp_8_u24 = value;
4890 case M32C_OPERAND_DSP_8_U6 :
4891 fields->f_dsp_8_u6 = value;
4893 case M32C_OPERAND_DSP_8_U8 :
4894 fields->f_dsp_8_u8 = value;
4896 case M32C_OPERAND_DST16AN :
4897 fields->f_dst16_an = value;
4899 case M32C_OPERAND_DST16AN_S :
4900 fields->f_dst16_an_s = value;
4902 case M32C_OPERAND_DST16ANHI :
4903 fields->f_dst16_an = value;
4905 case M32C_OPERAND_DST16ANQI :
4906 fields->f_dst16_an = value;
4908 case M32C_OPERAND_DST16ANQI_S :
4909 fields->f_dst16_rn_QI_s = value;
4911 case M32C_OPERAND_DST16ANSI :
4912 fields->f_dst16_an = value;
4914 case M32C_OPERAND_DST16RNEXTQI :
4915 fields->f_dst16_rn_ext = value;
4917 case M32C_OPERAND_DST16RNHI :
4918 fields->f_dst16_rn = value;
4920 case M32C_OPERAND_DST16RNQI :
4921 fields->f_dst16_rn = value;
4923 case M32C_OPERAND_DST16RNQI_S :
4924 fields->f_dst16_rn_QI_s = value;
4926 case M32C_OPERAND_DST16RNSI :
4927 fields->f_dst16_rn = value;
4929 case M32C_OPERAND_DST32ANEXTUNPREFIXED :
4930 fields->f_dst32_an_unprefixed = value;
4932 case M32C_OPERAND_DST32ANPREFIXED :
4933 fields->f_dst32_an_prefixed = value;
4935 case M32C_OPERAND_DST32ANPREFIXEDHI :
4936 fields->f_dst32_an_prefixed = value;
4938 case M32C_OPERAND_DST32ANPREFIXEDQI :
4939 fields->f_dst32_an_prefixed = value;
4941 case M32C_OPERAND_DST32ANPREFIXEDSI :
4942 fields->f_dst32_an_prefixed = value;
4944 case M32C_OPERAND_DST32ANUNPREFIXED :
4945 fields->f_dst32_an_unprefixed = value;
4947 case M32C_OPERAND_DST32ANUNPREFIXEDHI :
4948 fields->f_dst32_an_unprefixed = value;
4950 case M32C_OPERAND_DST32ANUNPREFIXEDQI :
4951 fields->f_dst32_an_unprefixed = value;
4953 case M32C_OPERAND_DST32ANUNPREFIXEDSI :
4954 fields->f_dst32_an_unprefixed = value;
4956 case M32C_OPERAND_DST32R0HI_S :
4958 case M32C_OPERAND_DST32R0QI_S :
4960 case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
4961 fields->f_dst32_rn_ext_unprefixed = value;
4963 case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
4964 fields->f_dst32_rn_ext_unprefixed = value;
4966 case M32C_OPERAND_DST32RNPREFIXEDHI :
4967 fields->f_dst32_rn_prefixed_HI = value;
4969 case M32C_OPERAND_DST32RNPREFIXEDQI :
4970 fields->f_dst32_rn_prefixed_QI = value;
4972 case M32C_OPERAND_DST32RNPREFIXEDSI :
4973 fields->f_dst32_rn_prefixed_SI = value;
4975 case M32C_OPERAND_DST32RNUNPREFIXEDHI :
4976 fields->f_dst32_rn_unprefixed_HI = value;
4978 case M32C_OPERAND_DST32RNUNPREFIXEDQI :
4979 fields->f_dst32_rn_unprefixed_QI = value;
4981 case M32C_OPERAND_DST32RNUNPREFIXEDSI :
4982 fields->f_dst32_rn_unprefixed_SI = value;
4984 case M32C_OPERAND_G :
4986 case M32C_OPERAND_IMM_12_S4 :
4987 fields->f_imm_12_s4 = value;
4989 case M32C_OPERAND_IMM_12_S4N :
4990 fields->f_imm_12_s4 = value;
4992 case M32C_OPERAND_IMM_13_U3 :
4993 fields->f_imm_13_u3 = value;
4995 case M32C_OPERAND_IMM_16_HI :
4996 fields->f_dsp_16_s16 = value;
4998 case M32C_OPERAND_IMM_16_QI :
4999 fields->f_dsp_16_s8 = value;
5001 case M32C_OPERAND_IMM_16_SI :
5002 fields->f_dsp_16_s32 = value;
5004 case M32C_OPERAND_IMM_20_S4 :
5005 fields->f_imm_20_s4 = value;
5007 case M32C_OPERAND_IMM_24_HI :
5008 fields->f_dsp_24_s16 = value;
5010 case M32C_OPERAND_IMM_24_QI :
5011 fields->f_dsp_24_s8 = value;
5013 case M32C_OPERAND_IMM_24_SI :
5014 fields->f_dsp_24_s32 = value;
5016 case M32C_OPERAND_IMM_32_HI :
5017 fields->f_dsp_32_s16 = value;
5019 case M32C_OPERAND_IMM_32_QI :
5020 fields->f_dsp_32_s8 = value;
5022 case M32C_OPERAND_IMM_32_SI :
5023 fields->f_dsp_32_s32 = value;
5025 case M32C_OPERAND_IMM_40_HI :
5026 fields->f_dsp_40_s16 = value;
5028 case M32C_OPERAND_IMM_40_QI :
5029 fields->f_dsp_40_s8 = value;
5031 case M32C_OPERAND_IMM_40_SI :
5032 fields->f_dsp_40_s32 = value;
5034 case M32C_OPERAND_IMM_48_HI :
5035 fields->f_dsp_48_s16 = value;
5037 case M32C_OPERAND_IMM_48_QI :
5038 fields->f_dsp_48_s8 = value;
5040 case M32C_OPERAND_IMM_48_SI :
5041 fields->f_dsp_48_s32 = value;
5043 case M32C_OPERAND_IMM_56_HI :
5044 fields->f_dsp_56_s16 = value;
5046 case M32C_OPERAND_IMM_56_QI :
5047 fields->f_dsp_56_s8 = value;
5049 case M32C_OPERAND_IMM_64_HI :
5050 fields->f_dsp_64_s16 = value;
5052 case M32C_OPERAND_IMM_8_HI :
5053 fields->f_dsp_8_s16 = value;
5055 case M32C_OPERAND_IMM_8_QI :
5056 fields->f_dsp_8_s8 = value;
5058 case M32C_OPERAND_IMM_8_S4 :
5059 fields->f_imm_8_s4 = value;
5061 case M32C_OPERAND_IMM_8_S4N :
5062 fields->f_imm_8_s4 = value;
5064 case M32C_OPERAND_IMM_SH_12_S4 :
5065 fields->f_imm_12_s4 = value;
5067 case M32C_OPERAND_IMM_SH_20_S4 :
5068 fields->f_imm_20_s4 = value;
5070 case M32C_OPERAND_IMM_SH_8_S4 :
5071 fields->f_imm_8_s4 = value;
5073 case M32C_OPERAND_IMM1_S :
5074 fields->f_imm1_S = value;
5076 case M32C_OPERAND_IMM3_S :
5077 fields->f_imm3_S = value;
5079 case M32C_OPERAND_LAB_16_8 :
5080 fields->f_lab_16_8 = value;
5082 case M32C_OPERAND_LAB_24_8 :
5083 fields->f_lab_24_8 = value;
5085 case M32C_OPERAND_LAB_32_8 :
5086 fields->f_lab_32_8 = value;
5088 case M32C_OPERAND_LAB_40_8 :
5089 fields->f_lab_40_8 = value;
5091 case M32C_OPERAND_LAB_5_3 :
5092 fields->f_lab_5_3 = value;
5094 case M32C_OPERAND_LAB_8_16 :
5095 fields->f_lab_8_16 = value;
5097 case M32C_OPERAND_LAB_8_24 :
5098 fields->f_lab_8_24 = value;
5100 case M32C_OPERAND_LAB_8_8 :
5101 fields->f_lab_8_8 = value;
5103 case M32C_OPERAND_LAB32_JMP_S :
5104 fields->f_lab32_jmp_s = value;
5106 case M32C_OPERAND_Q :
5108 case M32C_OPERAND_R0 :
5110 case M32C_OPERAND_R0H :
5112 case M32C_OPERAND_R0L :
5114 case M32C_OPERAND_R1 :
5116 case M32C_OPERAND_R1R2R0 :
5118 case M32C_OPERAND_R2 :
5120 case M32C_OPERAND_R2R0 :
5122 case M32C_OPERAND_R3 :
5124 case M32C_OPERAND_R3R1 :
5126 case M32C_OPERAND_REGSETPOP :
5127 fields->f_8_8 = value;
5129 case M32C_OPERAND_REGSETPUSH :
5130 fields->f_8_8 = value;
5132 case M32C_OPERAND_RN16_PUSH_S :
5133 fields->f_4_1 = value;
5135 case M32C_OPERAND_S :
5137 case M32C_OPERAND_SRC16AN :
5138 fields->f_src16_an = value;
5140 case M32C_OPERAND_SRC16ANHI :
5141 fields->f_src16_an = value;
5143 case M32C_OPERAND_SRC16ANQI :
5144 fields->f_src16_an = value;
5146 case M32C_OPERAND_SRC16RNHI :
5147 fields->f_src16_rn = value;
5149 case M32C_OPERAND_SRC16RNQI :
5150 fields->f_src16_rn = value;
5152 case M32C_OPERAND_SRC32ANPREFIXED :
5153 fields->f_src32_an_prefixed = value;
5155 case M32C_OPERAND_SRC32ANPREFIXEDHI :
5156 fields->f_src32_an_prefixed = value;
5158 case M32C_OPERAND_SRC32ANPREFIXEDQI :
5159 fields->f_src32_an_prefixed = value;
5161 case M32C_OPERAND_SRC32ANPREFIXEDSI :
5162 fields->f_src32_an_prefixed = value;
5164 case M32C_OPERAND_SRC32ANUNPREFIXED :
5165 fields->f_src32_an_unprefixed = value;
5167 case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
5168 fields->f_src32_an_unprefixed = value;
5170 case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
5171 fields->f_src32_an_unprefixed = value;
5173 case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
5174 fields->f_src32_an_unprefixed = value;
5176 case M32C_OPERAND_SRC32RNPREFIXEDHI :
5177 fields->f_src32_rn_prefixed_HI = value;
5179 case M32C_OPERAND_SRC32RNPREFIXEDQI :
5180 fields->f_src32_rn_prefixed_QI = value;
5182 case M32C_OPERAND_SRC32RNPREFIXEDSI :
5183 fields->f_src32_rn_prefixed_SI = value;
5185 case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
5186 fields->f_src32_rn_unprefixed_HI = value;
5188 case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
5189 fields->f_src32_rn_unprefixed_QI = value;
5191 case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
5192 fields->f_src32_rn_unprefixed_SI = value;
5194 case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
5195 fields->f_5_1 = value;
5197 case M32C_OPERAND_X :
5199 case M32C_OPERAND_Z :
5201 case M32C_OPERAND_COND16_16 :
5202 fields->f_dsp_16_u8 = value;
5204 case M32C_OPERAND_COND16_24 :
5205 fields->f_dsp_24_u8 = value;
5207 case M32C_OPERAND_COND16_32 :
5208 fields->f_dsp_32_u8 = value;
5210 case M32C_OPERAND_COND16C :
5211 fields->f_cond16 = value;
5213 case M32C_OPERAND_COND16J :
5214 fields->f_cond16 = value;
5216 case M32C_OPERAND_COND16J5 :
5217 fields->f_cond16j_5 = value;
5219 case M32C_OPERAND_COND32 :
5220 fields->f_cond32 = value;
5222 case M32C_OPERAND_COND32_16 :
5223 fields->f_dsp_16_u8 = value;
5225 case M32C_OPERAND_COND32_24 :
5226 fields->f_dsp_24_u8 = value;
5228 case M32C_OPERAND_COND32_32 :
5229 fields->f_dsp_32_u8 = value;
5231 case M32C_OPERAND_COND32_40 :
5232 fields->f_dsp_40_u8 = value;
5234 case M32C_OPERAND_COND32J :
5235 fields->f_cond32j = value;
5237 case M32C_OPERAND_CR1_PREFIXED_32 :
5238 fields->f_21_3 = value;
5240 case M32C_OPERAND_CR1_UNPREFIXED_32 :
5241 fields->f_13_3 = value;
5243 case M32C_OPERAND_CR16 :
5244 fields->f_9_3 = value;
5246 case M32C_OPERAND_CR2_32 :
5247 fields->f_13_3 = value;
5249 case M32C_OPERAND_CR3_PREFIXED_32 :
5250 fields->f_21_3 = value;
5252 case M32C_OPERAND_CR3_UNPREFIXED_32 :
5253 fields->f_13_3 = value;
5255 case M32C_OPERAND_FLAGS16 :
5256 fields->f_9_3 = value;
5258 case M32C_OPERAND_FLAGS32 :
5259 fields->f_13_3 = value;
5261 case M32C_OPERAND_SCCOND32 :
5262 fields->f_cond16 = value;
5264 case M32C_OPERAND_SIZE :
5268 /* xgettext:c-format */
5269 fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"),
5275 /* Function to call before using the instruction builder tables. */
5278 m32c_cgen_init_ibld_table (CGEN_CPU_DESC cd)
5280 cd->insert_handlers = & m32c_cgen_insert_handlers[0];
5281 cd->extract_handlers = & m32c_cgen_extract_handlers[0];
5283 cd->insert_operand = m32c_cgen_insert_operand;
5284 cd->extract_operand = m32c_cgen_extract_operand;
5286 cd->get_int_operand = m32c_cgen_get_int_operand;
5287 cd->set_int_operand = m32c_cgen_set_int_operand;
5288 cd->get_vma_operand = m32c_cgen_get_vma_operand;
5289 cd->set_vma_operand = m32c_cgen_set_vma_operand;