1 /* Instruction building/extraction support for mep. -*- 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 (C) 1996-2016 Free Software Foundation, Inc.
8 This file is part of libopcodes.
10 This library is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
24 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
35 #include "cgen/basic-modes.h"
37 #include "safe-ctype.h"
40 #define min(a,b) ((a) < (b) ? (a) : (b))
42 #define max(a,b) ((a) > (b) ? (a) : (b))
44 /* Used by the ifield rtx function. */
45 #define FLD(f) (fields->f)
47 static const char * insert_normal
48 (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
49 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
50 static const char * insert_insn_normal
51 (CGEN_CPU_DESC, const CGEN_INSN *,
52 CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
53 static int extract_normal
54 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
55 unsigned int, unsigned int, unsigned int, unsigned int,
56 unsigned int, unsigned int, bfd_vma, long *);
57 static int extract_insn_normal
58 (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
59 CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
61 static void put_insn_int_value
62 (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
65 static CGEN_INLINE void insert_1
66 (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
67 static CGEN_INLINE int fill_cache
68 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
69 static CGEN_INLINE long extract_1
70 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
73 /* Operand insertion. */
77 /* Subroutine of insert_normal. */
79 static CGEN_INLINE void
80 insert_1 (CGEN_CPU_DESC cd,
90 x = cgen_get_insn_value (cd, bufp, word_length);
92 /* Written this way to avoid undefined behaviour. */
93 mask = (((1L << (length - 1)) - 1) << 1) | 1;
95 shift = (start + 1) - length;
97 shift = (word_length - (start + length));
98 x = (x & ~(mask << shift)) | ((value & mask) << shift);
100 cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
103 #endif /* ! CGEN_INT_INSN_P */
105 /* Default insertion routine.
107 ATTRS is a mask of the boolean attributes.
108 WORD_OFFSET is the offset in bits from the start of the insn of the value.
109 WORD_LENGTH is the length of the word in bits in which the value resides.
110 START is the starting bit number in the word, architecture origin.
111 LENGTH is the length of VALUE in bits.
112 TOTAL_LENGTH is the total length of the insn in bits.
114 The result is an error message or NULL if success. */
116 /* ??? This duplicates functionality with bfd's howto table and
117 bfd_install_relocation. */
118 /* ??? This doesn't handle bfd_vma's. Create another function when
122 insert_normal (CGEN_CPU_DESC cd,
125 unsigned int word_offset,
128 unsigned int word_length,
129 unsigned int total_length,
130 CGEN_INSN_BYTES_PTR buffer)
132 static char errbuf[100];
133 /* Written this way to avoid undefined behaviour. */
134 unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1;
136 /* If LENGTH is zero, this operand doesn't contribute to the value. */
140 if (word_length > 8 * sizeof (CGEN_INSN_INT))
143 /* For architectures with insns smaller than the base-insn-bitsize,
144 word_length may be too big. */
145 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
148 && word_length > total_length)
149 word_length = total_length;
152 /* Ensure VALUE will fit. */
153 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
155 long minval = - (1L << (length - 1));
156 unsigned long maxval = mask;
158 if ((value > 0 && (unsigned long) value > maxval)
161 /* xgettext:c-format */
163 _("operand out of range (%ld not between %ld and %lu)"),
164 value, minval, maxval);
168 else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
170 unsigned long maxval = mask;
171 unsigned long val = (unsigned long) value;
173 /* For hosts with a word size > 32 check to see if value has been sign
174 extended beyond 32 bits. If so then ignore these higher sign bits
175 as the user is attempting to store a 32-bit signed value into an
176 unsigned 32-bit field which is allowed. */
177 if (sizeof (unsigned long) > 4 && ((value >> 32) == -1))
182 /* xgettext:c-format */
184 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
191 if (! cgen_signed_overflow_ok_p (cd))
193 long minval = - (1L << (length - 1));
194 long maxval = (1L << (length - 1)) - 1;
196 if (value < minval || value > maxval)
199 /* xgettext:c-format */
200 (errbuf, _("operand out of range (%ld not between %ld and %ld)"),
201 value, minval, maxval);
210 int shift_within_word, shift_to_word, shift;
212 /* How to shift the value to BIT0 of the word. */
213 shift_to_word = total_length - (word_offset + word_length);
215 /* How to shift the value to the field within the word. */
216 if (CGEN_INSN_LSB0_P)
217 shift_within_word = start + 1 - length;
219 shift_within_word = word_length - start - length;
221 /* The total SHIFT, then mask in the value. */
222 shift = shift_to_word + shift_within_word;
223 *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift);
226 #else /* ! CGEN_INT_INSN_P */
229 unsigned char *bufp = (unsigned char *) buffer + word_offset / 8;
231 insert_1 (cd, value, start, length, word_length, bufp);
234 #endif /* ! CGEN_INT_INSN_P */
239 /* Default insn builder (insert handler).
240 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
241 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
242 recorded in host byte order, otherwise BUFFER is an array of bytes
243 and the value is recorded in target byte order).
244 The result is an error message or NULL if success. */
247 insert_insn_normal (CGEN_CPU_DESC cd,
248 const CGEN_INSN * insn,
249 CGEN_FIELDS * fields,
250 CGEN_INSN_BYTES_PTR buffer,
253 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
255 const CGEN_SYNTAX_CHAR_TYPE * syn;
257 CGEN_INIT_INSERT (cd);
258 value = CGEN_INSN_BASE_VALUE (insn);
260 /* If we're recording insns as numbers (rather than a string of bytes),
261 target byte order handling is deferred until later. */
265 put_insn_int_value (cd, buffer, cd->base_insn_bitsize,
266 CGEN_FIELDS_BITSIZE (fields), value);
270 cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
271 (unsigned) CGEN_FIELDS_BITSIZE (fields)),
274 #endif /* ! CGEN_INT_INSN_P */
276 /* ??? It would be better to scan the format's fields.
277 Still need to be able to insert a value based on the operand though;
278 e.g. storing a branch displacement that got resolved later.
279 Needs more thought first. */
281 for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn)
285 if (CGEN_SYNTAX_CHAR_P (* syn))
288 errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
298 /* Cover function to store an insn value into an integral insn. Must go here
299 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
302 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
303 CGEN_INSN_BYTES_PTR buf,
308 /* For architectures with insns smaller than the base-insn-bitsize,
309 length may be too big. */
310 if (length > insn_length)
314 int shift = insn_length - length;
315 /* Written this way to avoid undefined behaviour. */
316 CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1;
318 *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
323 /* Operand extraction. */
325 #if ! CGEN_INT_INSN_P
327 /* Subroutine of extract_normal.
328 Ensure sufficient bytes are cached in EX_INFO.
329 OFFSET is the offset in bytes from the start of the insn of the value.
330 BYTES is the length of the needed value.
331 Returns 1 for success, 0 for failure. */
333 static CGEN_INLINE int
334 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
335 CGEN_EXTRACT_INFO *ex_info,
340 /* It's doubtful that the middle part has already been fetched so
341 we don't optimize that case. kiss. */
343 disassemble_info *info = (disassemble_info *) ex_info->dis_info;
345 /* First do a quick check. */
346 mask = (1 << bytes) - 1;
347 if (((ex_info->valid >> offset) & mask) == mask)
350 /* Search for the first byte we need to read. */
351 for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1)
352 if (! (mask & ex_info->valid))
360 status = (*info->read_memory_func)
361 (pc, ex_info->insn_bytes + offset, bytes, info);
365 (*info->memory_error_func) (status, pc, info);
369 ex_info->valid |= ((1 << bytes) - 1) << offset;
375 /* Subroutine of extract_normal. */
377 static CGEN_INLINE long
378 extract_1 (CGEN_CPU_DESC cd,
379 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
384 bfd_vma pc ATTRIBUTE_UNUSED)
389 x = cgen_get_insn_value (cd, bufp, word_length);
391 if (CGEN_INSN_LSB0_P)
392 shift = (start + 1) - length;
394 shift = (word_length - (start + length));
398 #endif /* ! CGEN_INT_INSN_P */
400 /* Default extraction routine.
402 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
403 or sometimes less for cases like the m32r where the base insn size is 32
404 but some insns are 16 bits.
405 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
406 but for generality we take a bitmask of all of them.
407 WORD_OFFSET is the offset in bits from the start of the insn of the value.
408 WORD_LENGTH is the length of the word in bits in which the value resides.
409 START is the starting bit number in the word, architecture origin.
410 LENGTH is the length of VALUE in bits.
411 TOTAL_LENGTH is the total length of the insn in bits.
413 Returns 1 for success, 0 for failure. */
415 /* ??? The return code isn't properly used. wip. */
417 /* ??? This doesn't handle bfd_vma's. Create another function when
421 extract_normal (CGEN_CPU_DESC cd,
422 #if ! CGEN_INT_INSN_P
423 CGEN_EXTRACT_INFO *ex_info,
425 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
427 CGEN_INSN_INT insn_value,
429 unsigned int word_offset,
432 unsigned int word_length,
433 unsigned int total_length,
434 #if ! CGEN_INT_INSN_P
437 bfd_vma pc ATTRIBUTE_UNUSED,
443 /* If LENGTH is zero, this operand doesn't contribute to the value
444 so give it a standard value of zero. */
451 if (word_length > 8 * sizeof (CGEN_INSN_INT))
454 /* For architectures with insns smaller than the insn-base-bitsize,
455 word_length may be too big. */
456 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
458 if (word_offset + word_length > total_length)
459 word_length = total_length - word_offset;
462 /* Does the value reside in INSN_VALUE, and at the right alignment? */
464 if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length))
466 if (CGEN_INSN_LSB0_P)
467 value = insn_value >> ((word_offset + start + 1) - length);
469 value = insn_value >> (total_length - ( word_offset + start + length));
472 #if ! CGEN_INT_INSN_P
476 unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
478 if (word_length > 8 * sizeof (CGEN_INSN_INT))
481 if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
484 value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc);
487 #endif /* ! CGEN_INT_INSN_P */
489 /* Written this way to avoid undefined behaviour. */
490 mask = (((1L << (length - 1)) - 1) << 1) | 1;
494 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
495 && (value & (1L << (length - 1))))
503 /* Default insn extractor.
505 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
506 The extracted fields are stored in FIELDS.
507 EX_INFO is used to handle reading variable length insns.
508 Return the length of the insn in bits, or 0 if no match,
509 or -1 if an error occurs fetching data (memory_error_func will have
513 extract_insn_normal (CGEN_CPU_DESC cd,
514 const CGEN_INSN *insn,
515 CGEN_EXTRACT_INFO *ex_info,
516 CGEN_INSN_INT insn_value,
520 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
521 const CGEN_SYNTAX_CHAR_TYPE *syn;
523 CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn);
525 CGEN_INIT_EXTRACT (cd);
527 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
531 if (CGEN_SYNTAX_CHAR_P (*syn))
534 length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
535 ex_info, insn_value, fields, pc);
540 /* We recognized and successfully extracted this insn. */
541 return CGEN_INSN_BITSIZE (insn);
544 /* Machine generated code added here. */
546 const char * mep_cgen_insert_operand
547 (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
549 /* Main entry point for operand insertion.
551 This function is basically just a big switch statement. Earlier versions
552 used tables to look up the function to use, but
553 - if the table contains both assembler and disassembler functions then
554 the disassembler contains much of the assembler and vice-versa,
555 - there's a lot of inlining possibilities as things grow,
556 - using a switch statement avoids the function call overhead.
558 This function could be moved into `parse_insn_normal', but keeping it
559 separate makes clear the interface between `parse_insn_normal' and each of
560 the handlers. It's also needed by GAS to insert operands that couldn't be
561 resolved during parsing. */
564 mep_cgen_insert_operand (CGEN_CPU_DESC cd,
566 CGEN_FIELDS * fields,
567 CGEN_INSN_BYTES_PTR buffer,
568 bfd_vma pc ATTRIBUTE_UNUSED)
570 const char * errmsg = NULL;
571 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
575 case MEP_OPERAND_ADDR24A4 :
578 FLD (f_24u8a4n_hi) = ((UINT) (FLD (f_24u8a4n)) >> (8));
579 FLD (f_24u8a4n_lo) = ((UINT) (((FLD (f_24u8a4n)) & (252))) >> (2));
581 errmsg = insert_normal (cd, fields->f_24u8a4n_hi, 0, 0, 16, 16, 32, total_length, buffer);
584 errmsg = insert_normal (cd, fields->f_24u8a4n_lo, 0, 0, 8, 6, 32, total_length, buffer);
589 case MEP_OPERAND_C5RMUIMM20 :
592 FLD (f_c5_rm) = ((UINT) (FLD (f_c5_rmuimm20)) >> (16));
593 FLD (f_c5_16u16) = ((FLD (f_c5_rmuimm20)) & (65535));
595 errmsg = insert_normal (cd, fields->f_c5_rm, 0, 0, 8, 4, 32, total_length, buffer);
598 errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer);
603 case MEP_OPERAND_C5RNMUIMM24 :
606 FLD (f_c5_rnm) = ((UINT) (FLD (f_c5_rnmuimm24)) >> (16));
607 FLD (f_c5_16u16) = ((FLD (f_c5_rnmuimm24)) & (65535));
609 errmsg = insert_normal (cd, fields->f_c5_rnm, 0, 0, 4, 8, 32, total_length, buffer);
612 errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer);
617 case MEP_OPERAND_CALLNUM :
620 FLD (f_5) = ((((UINT) (FLD (f_callnum)) >> (3))) & (1));
621 FLD (f_6) = ((((UINT) (FLD (f_callnum)) >> (2))) & (1));
622 FLD (f_7) = ((((UINT) (FLD (f_callnum)) >> (1))) & (1));
623 FLD (f_11) = ((FLD (f_callnum)) & (1));
625 errmsg = insert_normal (cd, fields->f_5, 0, 0, 5, 1, 32, total_length, buffer);
628 errmsg = insert_normal (cd, fields->f_6, 0, 0, 6, 1, 32, total_length, buffer);
631 errmsg = insert_normal (cd, fields->f_7, 0, 0, 7, 1, 32, total_length, buffer);
634 errmsg = insert_normal (cd, fields->f_11, 0, 0, 11, 1, 32, total_length, buffer);
639 case MEP_OPERAND_CCCC :
640 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
642 case MEP_OPERAND_CCRN :
645 FLD (f_ccrn_hi) = ((((UINT) (FLD (f_ccrn)) >> (4))) & (3));
646 FLD (f_ccrn_lo) = ((FLD (f_ccrn)) & (15));
648 errmsg = insert_normal (cd, fields->f_ccrn_hi, 0, 0, 28, 2, 32, total_length, buffer);
651 errmsg = insert_normal (cd, fields->f_ccrn_lo, 0, 0, 4, 4, 32, total_length, buffer);
656 case MEP_OPERAND_CDISP10 :
658 long value = fields->f_cdisp10;
659 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
660 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
663 case MEP_OPERAND_CDISP10A2 :
665 long value = fields->f_cdisp10;
666 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
667 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
670 case MEP_OPERAND_CDISP10A4 :
672 long value = fields->f_cdisp10;
673 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
674 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
677 case MEP_OPERAND_CDISP10A8 :
679 long value = fields->f_cdisp10;
680 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
681 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
684 case MEP_OPERAND_CDISP12 :
685 errmsg = insert_normal (cd, fields->f_12s20, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 12, 32, total_length, buffer);
687 case MEP_OPERAND_CIMM4 :
688 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
690 case MEP_OPERAND_CIMM5 :
691 errmsg = insert_normal (cd, fields->f_5u24, 0, 0, 24, 5, 32, total_length, buffer);
693 case MEP_OPERAND_CODE16 :
694 errmsg = insert_normal (cd, fields->f_16u16, 0, 0, 16, 16, 32, total_length, buffer);
696 case MEP_OPERAND_CODE24 :
699 FLD (f_24u4n_hi) = ((UINT) (FLD (f_24u4n)) >> (16));
700 FLD (f_24u4n_lo) = ((FLD (f_24u4n)) & (65535));
702 errmsg = insert_normal (cd, fields->f_24u4n_hi, 0, 0, 4, 8, 32, total_length, buffer);
705 errmsg = insert_normal (cd, fields->f_24u4n_lo, 0, 0, 16, 16, 32, total_length, buffer);
710 case MEP_OPERAND_CP_FLAG :
712 case MEP_OPERAND_CRN :
713 errmsg = insert_normal (cd, fields->f_crn, 0, 0, 4, 4, 32, total_length, buffer);
715 case MEP_OPERAND_CRN64 :
716 errmsg = insert_normal (cd, fields->f_crn, 0, 0, 4, 4, 32, total_length, buffer);
718 case MEP_OPERAND_CRNX :
721 FLD (f_crnx_lo) = ((FLD (f_crnx)) & (15));
722 FLD (f_crnx_hi) = ((UINT) (FLD (f_crnx)) >> (4));
724 errmsg = insert_normal (cd, fields->f_crnx_hi, 0, 0, 28, 1, 32, total_length, buffer);
727 errmsg = insert_normal (cd, fields->f_crnx_lo, 0, 0, 4, 4, 32, total_length, buffer);
732 case MEP_OPERAND_CRNX64 :
735 FLD (f_crnx_lo) = ((FLD (f_crnx)) & (15));
736 FLD (f_crnx_hi) = ((UINT) (FLD (f_crnx)) >> (4));
738 errmsg = insert_normal (cd, fields->f_crnx_hi, 0, 0, 28, 1, 32, total_length, buffer);
741 errmsg = insert_normal (cd, fields->f_crnx_lo, 0, 0, 4, 4, 32, total_length, buffer);
746 case MEP_OPERAND_CROC :
747 errmsg = insert_normal (cd, fields->f_ivc2_5u7, 0, 0, 7, 5, 32, total_length, buffer);
749 case MEP_OPERAND_CROP :
750 errmsg = insert_normal (cd, fields->f_ivc2_5u23, 0, 0, 23, 5, 32, total_length, buffer);
752 case MEP_OPERAND_CRPC :
753 errmsg = insert_normal (cd, fields->f_ivc2_5u26, 0, 0, 26, 5, 32, total_length, buffer);
755 case MEP_OPERAND_CRPP :
756 errmsg = insert_normal (cd, fields->f_ivc2_5u18, 0, 0, 18, 5, 32, total_length, buffer);
758 case MEP_OPERAND_CRQC :
759 errmsg = insert_normal (cd, fields->f_ivc2_5u21, 0, 0, 21, 5, 32, total_length, buffer);
761 case MEP_OPERAND_CRQP :
762 errmsg = insert_normal (cd, fields->f_ivc2_5u13, 0, 0, 13, 5, 32, total_length, buffer);
764 case MEP_OPERAND_CSRN :
767 FLD (f_csrn_lo) = ((FLD (f_csrn)) & (15));
768 FLD (f_csrn_hi) = ((UINT) (FLD (f_csrn)) >> (4));
770 errmsg = insert_normal (cd, fields->f_csrn_hi, 0, 0, 15, 1, 32, total_length, buffer);
773 errmsg = insert_normal (cd, fields->f_csrn_lo, 0, 0, 8, 4, 32, total_length, buffer);
778 case MEP_OPERAND_CSRN_IDX :
781 FLD (f_csrn_lo) = ((FLD (f_csrn)) & (15));
782 FLD (f_csrn_hi) = ((UINT) (FLD (f_csrn)) >> (4));
784 errmsg = insert_normal (cd, fields->f_csrn_hi, 0, 0, 15, 1, 32, total_length, buffer);
787 errmsg = insert_normal (cd, fields->f_csrn_lo, 0, 0, 8, 4, 32, total_length, buffer);
792 case MEP_OPERAND_DBG :
794 case MEP_OPERAND_DEPC :
796 case MEP_OPERAND_EPC :
798 case MEP_OPERAND_EXC :
800 case MEP_OPERAND_HI :
802 case MEP_OPERAND_IMM16P0 :
805 FLD (f_ivc2_8u0) = ((((UINT) (FLD (f_ivc2_imm16p0)) >> (8))) & (255));
806 FLD (f_ivc2_8u20) = ((FLD (f_ivc2_imm16p0)) & (255));
808 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
811 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
816 case MEP_OPERAND_IMM3P12 :
817 errmsg = insert_normal (cd, fields->f_ivc2_3u12, 0, 0, 12, 3, 32, total_length, buffer);
819 case MEP_OPERAND_IMM3P25 :
820 errmsg = insert_normal (cd, fields->f_ivc2_3u25, 0, 0, 25, 3, 32, total_length, buffer);
822 case MEP_OPERAND_IMM3P4 :
823 errmsg = insert_normal (cd, fields->f_ivc2_3u4, 0, 0, 4, 3, 32, total_length, buffer);
825 case MEP_OPERAND_IMM3P5 :
826 errmsg = insert_normal (cd, fields->f_ivc2_3u5, 0, 0, 5, 3, 32, total_length, buffer);
828 case MEP_OPERAND_IMM3P9 :
829 errmsg = insert_normal (cd, fields->f_ivc2_3u9, 0, 0, 9, 3, 32, total_length, buffer);
831 case MEP_OPERAND_IMM4P10 :
832 errmsg = insert_normal (cd, fields->f_ivc2_4u10, 0, 0, 10, 4, 32, total_length, buffer);
834 case MEP_OPERAND_IMM4P4 :
835 errmsg = insert_normal (cd, fields->f_ivc2_4u4, 0, 0, 4, 4, 32, total_length, buffer);
837 case MEP_OPERAND_IMM4P8 :
838 errmsg = insert_normal (cd, fields->f_ivc2_4u8, 0, 0, 8, 4, 32, total_length, buffer);
840 case MEP_OPERAND_IMM5P23 :
841 errmsg = insert_normal (cd, fields->f_ivc2_5u23, 0, 0, 23, 5, 32, total_length, buffer);
843 case MEP_OPERAND_IMM5P3 :
844 errmsg = insert_normal (cd, fields->f_ivc2_5u3, 0, 0, 3, 5, 32, total_length, buffer);
846 case MEP_OPERAND_IMM5P7 :
847 errmsg = insert_normal (cd, fields->f_ivc2_5u7, 0, 0, 7, 5, 32, total_length, buffer);
849 case MEP_OPERAND_IMM5P8 :
850 errmsg = insert_normal (cd, fields->f_ivc2_5u8, 0, 0, 8, 5, 32, total_length, buffer);
852 case MEP_OPERAND_IMM6P2 :
853 errmsg = insert_normal (cd, fields->f_ivc2_6u2, 0, 0, 2, 6, 32, total_length, buffer);
855 case MEP_OPERAND_IMM6P6 :
856 errmsg = insert_normal (cd, fields->f_ivc2_6u6, 0, 0, 6, 6, 32, total_length, buffer);
858 case MEP_OPERAND_IMM8P0 :
859 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
861 case MEP_OPERAND_IMM8P20 :
862 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
864 case MEP_OPERAND_IMM8P4 :
865 errmsg = insert_normal (cd, fields->f_ivc2_8u4, 0, 0, 4, 8, 32, total_length, buffer);
867 case MEP_OPERAND_IVC_X_0_2 :
868 errmsg = insert_normal (cd, fields->f_ivc2_2u0, 0, 0, 0, 2, 32, total_length, buffer);
870 case MEP_OPERAND_IVC_X_0_3 :
871 errmsg = insert_normal (cd, fields->f_ivc2_3u0, 0, 0, 0, 3, 32, total_length, buffer);
873 case MEP_OPERAND_IVC_X_0_4 :
874 errmsg = insert_normal (cd, fields->f_ivc2_4u0, 0, 0, 0, 4, 32, total_length, buffer);
876 case MEP_OPERAND_IVC_X_0_5 :
877 errmsg = insert_normal (cd, fields->f_ivc2_5u0, 0, 0, 0, 5, 32, total_length, buffer);
879 case MEP_OPERAND_IVC_X_6_1 :
880 errmsg = insert_normal (cd, fields->f_ivc2_1u6, 0, 0, 6, 1, 32, total_length, buffer);
882 case MEP_OPERAND_IVC_X_6_2 :
883 errmsg = insert_normal (cd, fields->f_ivc2_2u6, 0, 0, 6, 2, 32, total_length, buffer);
885 case MEP_OPERAND_IVC_X_6_3 :
886 errmsg = insert_normal (cd, fields->f_ivc2_3u6, 0, 0, 6, 3, 32, total_length, buffer);
888 case MEP_OPERAND_IVC2_ACC0_0 :
890 case MEP_OPERAND_IVC2_ACC0_1 :
892 case MEP_OPERAND_IVC2_ACC0_2 :
894 case MEP_OPERAND_IVC2_ACC0_3 :
896 case MEP_OPERAND_IVC2_ACC0_4 :
898 case MEP_OPERAND_IVC2_ACC0_5 :
900 case MEP_OPERAND_IVC2_ACC0_6 :
902 case MEP_OPERAND_IVC2_ACC0_7 :
904 case MEP_OPERAND_IVC2_ACC1_0 :
906 case MEP_OPERAND_IVC2_ACC1_1 :
908 case MEP_OPERAND_IVC2_ACC1_2 :
910 case MEP_OPERAND_IVC2_ACC1_3 :
912 case MEP_OPERAND_IVC2_ACC1_4 :
914 case MEP_OPERAND_IVC2_ACC1_5 :
916 case MEP_OPERAND_IVC2_ACC1_6 :
918 case MEP_OPERAND_IVC2_ACC1_7 :
920 case MEP_OPERAND_IVC2_CC :
922 case MEP_OPERAND_IVC2_COFA0 :
924 case MEP_OPERAND_IVC2_COFA1 :
926 case MEP_OPERAND_IVC2_COFR0 :
928 case MEP_OPERAND_IVC2_COFR1 :
930 case MEP_OPERAND_IVC2_CSAR0 :
932 case MEP_OPERAND_IVC2_CSAR1 :
934 case MEP_OPERAND_IVC2C3CCRN :
937 FLD (f_ivc2_ccrn_c3hi) = ((((UINT) (FLD (f_ivc2_ccrn_c3)) >> (4))) & (3));
938 FLD (f_ivc2_ccrn_c3lo) = ((FLD (f_ivc2_ccrn_c3)) & (15));
940 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_c3hi, 0, 0, 28, 2, 32, total_length, buffer);
943 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_c3lo, 0, 0, 4, 4, 32, total_length, buffer);
948 case MEP_OPERAND_IVC2CCRN :
951 FLD (f_ivc2_ccrn_h2) = ((((UINT) (FLD (f_ivc2_ccrn)) >> (4))) & (3));
952 FLD (f_ivc2_ccrn_lo) = ((FLD (f_ivc2_ccrn)) & (15));
954 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_h2, 0, 0, 20, 2, 32, total_length, buffer);
957 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_lo, 0, 0, 0, 4, 32, total_length, buffer);
962 case MEP_OPERAND_IVC2CRN :
965 FLD (f_ivc2_ccrn_h1) = ((((UINT) (FLD (f_ivc2_crnx)) >> (4))) & (1));
966 FLD (f_ivc2_ccrn_lo) = ((FLD (f_ivc2_crnx)) & (15));
968 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_h1, 0, 0, 20, 1, 32, total_length, buffer);
971 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_lo, 0, 0, 0, 4, 32, total_length, buffer);
976 case MEP_OPERAND_IVC2RM :
977 errmsg = insert_normal (cd, fields->f_ivc2_crm, 0, 0, 4, 4, 32, total_length, buffer);
979 case MEP_OPERAND_LO :
981 case MEP_OPERAND_LP :
983 case MEP_OPERAND_MB0 :
985 case MEP_OPERAND_MB1 :
987 case MEP_OPERAND_ME0 :
989 case MEP_OPERAND_ME1 :
991 case MEP_OPERAND_NPC :
993 case MEP_OPERAND_OPT :
995 case MEP_OPERAND_PCABS24A2 :
998 FLD (f_24u5a2n_lo) = ((UINT) (((FLD (f_24u5a2n)) & (255))) >> (1));
999 FLD (f_24u5a2n_hi) = ((UINT) (FLD (f_24u5a2n)) >> (8));
1001 errmsg = insert_normal (cd, fields->f_24u5a2n_hi, 0, 0, 16, 16, 32, total_length, buffer);
1004 errmsg = insert_normal (cd, fields->f_24u5a2n_lo, 0, 0, 5, 7, 32, total_length, buffer);
1009 case MEP_OPERAND_PCREL12A2 :
1011 long value = fields->f_12s4a2;
1012 value = ((SI) (((value) - (pc))) >> (1));
1013 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 4, 11, 32, total_length, buffer);
1016 case MEP_OPERAND_PCREL17A2 :
1018 long value = fields->f_17s16a2;
1019 value = ((SI) (((value) - (pc))) >> (1));
1020 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, buffer);
1023 case MEP_OPERAND_PCREL24A2 :
1026 FLD (f_24s5a2n) = ((FLD (f_24s5a2n)) - (pc));
1027 FLD (f_24s5a2n_lo) = ((UINT) (((FLD (f_24s5a2n)) & (254))) >> (1));
1028 FLD (f_24s5a2n_hi) = ((INT) (FLD (f_24s5a2n)) >> (8));
1030 errmsg = insert_normal (cd, fields->f_24s5a2n_hi, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, buffer);
1033 errmsg = insert_normal (cd, fields->f_24s5a2n_lo, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 7, 32, total_length, buffer);
1038 case MEP_OPERAND_PCREL8A2 :
1040 long value = fields->f_8s8a2;
1041 value = ((SI) (((value) - (pc))) >> (1));
1042 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 7, 32, total_length, buffer);
1045 case MEP_OPERAND_PSW :
1047 case MEP_OPERAND_R0 :
1049 case MEP_OPERAND_R1 :
1051 case MEP_OPERAND_RL :
1052 errmsg = insert_normal (cd, fields->f_rl, 0, 0, 12, 4, 32, total_length, buffer);
1054 case MEP_OPERAND_RL5 :
1055 errmsg = insert_normal (cd, fields->f_rl5, 0, 0, 20, 4, 32, total_length, buffer);
1057 case MEP_OPERAND_RM :
1058 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
1060 case MEP_OPERAND_RMA :
1061 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
1063 case MEP_OPERAND_RN :
1064 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1066 case MEP_OPERAND_RN3 :
1067 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1069 case MEP_OPERAND_RN3C :
1070 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1072 case MEP_OPERAND_RN3L :
1073 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1075 case MEP_OPERAND_RN3S :
1076 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1078 case MEP_OPERAND_RN3UC :
1079 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1081 case MEP_OPERAND_RN3UL :
1082 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1084 case MEP_OPERAND_RN3US :
1085 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1087 case MEP_OPERAND_RNC :
1088 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1090 case MEP_OPERAND_RNL :
1091 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1093 case MEP_OPERAND_RNS :
1094 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1096 case MEP_OPERAND_RNUC :
1097 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1099 case MEP_OPERAND_RNUL :
1100 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1102 case MEP_OPERAND_RNUS :
1103 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1105 case MEP_OPERAND_SAR :
1107 case MEP_OPERAND_SDISP16 :
1108 errmsg = insert_normal (cd, fields->f_16s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
1110 case MEP_OPERAND_SIMM16 :
1111 errmsg = insert_normal (cd, fields->f_16s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
1113 case MEP_OPERAND_SIMM16P0 :
1116 FLD (f_ivc2_8u0) = ((((UINT) (FLD (f_ivc2_simm16p0)) >> (8))) & (255));
1117 FLD (f_ivc2_8u20) = ((FLD (f_ivc2_simm16p0)) & (255));
1119 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
1122 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
1127 case MEP_OPERAND_SIMM6 :
1128 errmsg = insert_normal (cd, fields->f_6s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 6, 32, total_length, buffer);
1130 case MEP_OPERAND_SIMM8 :
1131 errmsg = insert_normal (cd, fields->f_8s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, buffer);
1133 case MEP_OPERAND_SIMM8P0 :
1134 errmsg = insert_normal (cd, fields->f_ivc2_8s0, 0|(1<<CGEN_IFLD_SIGNED), 0, 0, 8, 32, total_length, buffer);
1136 case MEP_OPERAND_SIMM8P20 :
1137 errmsg = insert_normal (cd, fields->f_ivc2_8s20, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 8, 32, total_length, buffer);
1139 case MEP_OPERAND_SIMM8P4 :
1140 errmsg = insert_normal (cd, fields->f_ivc2_8s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 32, total_length, buffer);
1142 case MEP_OPERAND_SP :
1144 case MEP_OPERAND_SPR :
1146 case MEP_OPERAND_TP :
1148 case MEP_OPERAND_TPR :
1150 case MEP_OPERAND_UDISP2 :
1151 errmsg = insert_normal (cd, fields->f_2u6, 0, 0, 6, 2, 32, total_length, buffer);
1153 case MEP_OPERAND_UDISP7 :
1154 errmsg = insert_normal (cd, fields->f_7u9, 0, 0, 9, 7, 32, total_length, buffer);
1156 case MEP_OPERAND_UDISP7A2 :
1158 long value = fields->f_7u9a2;
1159 value = ((USI) (value) >> (1));
1160 errmsg = insert_normal (cd, value, 0, 0, 9, 6, 32, total_length, buffer);
1163 case MEP_OPERAND_UDISP7A4 :
1165 long value = fields->f_7u9a4;
1166 value = ((USI) (value) >> (2));
1167 errmsg = insert_normal (cd, value, 0, 0, 9, 5, 32, total_length, buffer);
1170 case MEP_OPERAND_UIMM16 :
1171 errmsg = insert_normal (cd, fields->f_16u16, 0, 0, 16, 16, 32, total_length, buffer);
1173 case MEP_OPERAND_UIMM2 :
1174 errmsg = insert_normal (cd, fields->f_2u10, 0, 0, 10, 2, 32, total_length, buffer);
1176 case MEP_OPERAND_UIMM24 :
1179 FLD (f_24u8n_hi) = ((UINT) (FLD (f_24u8n)) >> (8));
1180 FLD (f_24u8n_lo) = ((FLD (f_24u8n)) & (255));
1182 errmsg = insert_normal (cd, fields->f_24u8n_hi, 0, 0, 16, 16, 32, total_length, buffer);
1185 errmsg = insert_normal (cd, fields->f_24u8n_lo, 0, 0, 8, 8, 32, total_length, buffer);
1190 case MEP_OPERAND_UIMM3 :
1191 errmsg = insert_normal (cd, fields->f_3u5, 0, 0, 5, 3, 32, total_length, buffer);
1193 case MEP_OPERAND_UIMM4 :
1194 errmsg = insert_normal (cd, fields->f_4u8, 0, 0, 8, 4, 32, total_length, buffer);
1196 case MEP_OPERAND_UIMM5 :
1197 errmsg = insert_normal (cd, fields->f_5u8, 0, 0, 8, 5, 32, total_length, buffer);
1199 case MEP_OPERAND_UIMM7A4 :
1201 long value = fields->f_7u9a4;
1202 value = ((USI) (value) >> (2));
1203 errmsg = insert_normal (cd, value, 0, 0, 9, 5, 32, total_length, buffer);
1206 case MEP_OPERAND_ZERO :
1210 /* xgettext:c-format */
1211 fprintf (stderr, _("Unrecognized field %d while building insn.\n"),
1219 int mep_cgen_extract_operand
1220 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
1222 /* Main entry point for operand extraction.
1223 The result is <= 0 for error, >0 for success.
1224 ??? Actual values aren't well defined right now.
1226 This function is basically just a big switch statement. Earlier versions
1227 used tables to look up the function to use, but
1228 - if the table contains both assembler and disassembler functions then
1229 the disassembler contains much of the assembler and vice-versa,
1230 - there's a lot of inlining possibilities as things grow,
1231 - using a switch statement avoids the function call overhead.
1233 This function could be moved into `print_insn_normal', but keeping it
1234 separate makes clear the interface between `print_insn_normal' and each of
1238 mep_cgen_extract_operand (CGEN_CPU_DESC cd,
1240 CGEN_EXTRACT_INFO *ex_info,
1241 CGEN_INSN_INT insn_value,
1242 CGEN_FIELDS * fields,
1245 /* Assume success (for those operands that are nops). */
1247 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
1251 case MEP_OPERAND_ADDR24A4 :
1253 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8a4n_hi);
1254 if (length <= 0) break;
1255 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 6, 32, total_length, pc, & fields->f_24u8a4n_lo);
1256 if (length <= 0) break;
1257 FLD (f_24u8a4n) = ((((FLD (f_24u8a4n_hi)) << (8))) | (((FLD (f_24u8a4n_lo)) << (2))));
1260 case MEP_OPERAND_C5RMUIMM20 :
1262 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_c5_rm);
1263 if (length <= 0) break;
1264 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1265 if (length <= 0) break;
1267 FLD (f_c5_rmuimm20) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rm)) << (16))));
1271 case MEP_OPERAND_C5RNMUIMM24 :
1273 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_c5_rnm);
1274 if (length <= 0) break;
1275 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1276 if (length <= 0) break;
1278 FLD (f_c5_rnmuimm24) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rnm)) << (16))));
1282 case MEP_OPERAND_CALLNUM :
1284 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_5);
1285 if (length <= 0) break;
1286 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_6);
1287 if (length <= 0) break;
1288 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7);
1289 if (length <= 0) break;
1290 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_11);
1291 if (length <= 0) break;
1292 FLD (f_callnum) = ((((FLD (f_5)) << (3))) | (((((FLD (f_6)) << (2))) | (((((FLD (f_7)) << (1))) | (FLD (f_11)))))));
1295 case MEP_OPERAND_CCCC :
1296 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1298 case MEP_OPERAND_CCRN :
1300 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ccrn_hi);
1301 if (length <= 0) break;
1302 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ccrn_lo);
1303 if (length <= 0) break;
1304 FLD (f_ccrn) = ((((FLD (f_ccrn_hi)) << (4))) | (FLD (f_ccrn_lo)));
1307 case MEP_OPERAND_CDISP10 :
1310 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1311 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
1312 fields->f_cdisp10 = value;
1315 case MEP_OPERAND_CDISP10A2 :
1318 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1319 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
1320 fields->f_cdisp10 = value;
1323 case MEP_OPERAND_CDISP10A4 :
1326 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1327 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
1328 fields->f_cdisp10 = value;
1331 case MEP_OPERAND_CDISP10A8 :
1334 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1335 value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023)));
1336 fields->f_cdisp10 = value;
1339 case MEP_OPERAND_CDISP12 :
1340 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 12, 32, total_length, pc, & fields->f_12s20);
1342 case MEP_OPERAND_CIMM4 :
1343 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1345 case MEP_OPERAND_CIMM5 :
1346 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 5, 32, total_length, pc, & fields->f_5u24);
1348 case MEP_OPERAND_CODE16 :
1349 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1351 case MEP_OPERAND_CODE24 :
1353 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_24u4n_hi);
1354 if (length <= 0) break;
1355 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u4n_lo);
1356 if (length <= 0) break;
1357 FLD (f_24u4n) = ((((FLD (f_24u4n_hi)) << (16))) | (FLD (f_24u4n_lo)));
1360 case MEP_OPERAND_CP_FLAG :
1362 case MEP_OPERAND_CRN :
1363 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1365 case MEP_OPERAND_CRN64 :
1366 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1368 case MEP_OPERAND_CRNX :
1370 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1371 if (length <= 0) break;
1372 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1373 if (length <= 0) break;
1374 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1377 case MEP_OPERAND_CRNX64 :
1379 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1380 if (length <= 0) break;
1381 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1382 if (length <= 0) break;
1383 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1386 case MEP_OPERAND_CROC :
1387 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1389 case MEP_OPERAND_CROP :
1390 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1392 case MEP_OPERAND_CRPC :
1393 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 5, 32, total_length, pc, & fields->f_ivc2_5u26);
1395 case MEP_OPERAND_CRPP :
1396 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 5, 32, total_length, pc, & fields->f_ivc2_5u18);
1398 case MEP_OPERAND_CRQC :
1399 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 5, 32, total_length, pc, & fields->f_ivc2_5u21);
1401 case MEP_OPERAND_CRQP :
1402 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 5, 32, total_length, pc, & fields->f_ivc2_5u13);
1404 case MEP_OPERAND_CSRN :
1406 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1407 if (length <= 0) break;
1408 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1409 if (length <= 0) break;
1410 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1413 case MEP_OPERAND_CSRN_IDX :
1415 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1416 if (length <= 0) break;
1417 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1418 if (length <= 0) break;
1419 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1422 case MEP_OPERAND_DBG :
1424 case MEP_OPERAND_DEPC :
1426 case MEP_OPERAND_EPC :
1428 case MEP_OPERAND_EXC :
1430 case MEP_OPERAND_HI :
1432 case MEP_OPERAND_IMM16P0 :
1434 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1435 if (length <= 0) break;
1436 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1437 if (length <= 0) break;
1439 FLD (f_ivc2_imm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1443 case MEP_OPERAND_IMM3P12 :
1444 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 3, 32, total_length, pc, & fields->f_ivc2_3u12);
1446 case MEP_OPERAND_IMM3P25 :
1447 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 3, 32, total_length, pc, & fields->f_ivc2_3u25);
1449 case MEP_OPERAND_IMM3P4 :
1450 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 3, 32, total_length, pc, & fields->f_ivc2_3u4);
1452 case MEP_OPERAND_IMM3P5 :
1453 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_ivc2_3u5);
1455 case MEP_OPERAND_IMM3P9 :
1456 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_ivc2_3u9);
1458 case MEP_OPERAND_IMM4P10 :
1459 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 4, 32, total_length, pc, & fields->f_ivc2_4u10);
1461 case MEP_OPERAND_IMM4P4 :
1462 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_4u4);
1464 case MEP_OPERAND_IMM4P8 :
1465 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_ivc2_4u8);
1467 case MEP_OPERAND_IMM5P23 :
1468 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1470 case MEP_OPERAND_IMM5P3 :
1471 length = extract_normal (cd, ex_info, insn_value, 0, 0, 3, 5, 32, total_length, pc, & fields->f_ivc2_5u3);
1473 case MEP_OPERAND_IMM5P7 :
1474 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1476 case MEP_OPERAND_IMM5P8 :
1477 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_ivc2_5u8);
1479 case MEP_OPERAND_IMM6P2 :
1480 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 6, 32, total_length, pc, & fields->f_ivc2_6u2);
1482 case MEP_OPERAND_IMM6P6 :
1483 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 6, 32, total_length, pc, & fields->f_ivc2_6u6);
1485 case MEP_OPERAND_IMM8P0 :
1486 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1488 case MEP_OPERAND_IMM8P20 :
1489 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1491 case MEP_OPERAND_IMM8P4 :
1492 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8u4);
1494 case MEP_OPERAND_IVC_X_0_2 :
1495 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 2, 32, total_length, pc, & fields->f_ivc2_2u0);
1497 case MEP_OPERAND_IVC_X_0_3 :
1498 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 3, 32, total_length, pc, & fields->f_ivc2_3u0);
1500 case MEP_OPERAND_IVC_X_0_4 :
1501 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_4u0);
1503 case MEP_OPERAND_IVC_X_0_5 :
1504 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 5, 32, total_length, pc, & fields->f_ivc2_5u0);
1506 case MEP_OPERAND_IVC_X_6_1 :
1507 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_ivc2_1u6);
1509 case MEP_OPERAND_IVC_X_6_2 :
1510 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_ivc2_2u6);
1512 case MEP_OPERAND_IVC_X_6_3 :
1513 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 3, 32, total_length, pc, & fields->f_ivc2_3u6);
1515 case MEP_OPERAND_IVC2_ACC0_0 :
1517 case MEP_OPERAND_IVC2_ACC0_1 :
1519 case MEP_OPERAND_IVC2_ACC0_2 :
1521 case MEP_OPERAND_IVC2_ACC0_3 :
1523 case MEP_OPERAND_IVC2_ACC0_4 :
1525 case MEP_OPERAND_IVC2_ACC0_5 :
1527 case MEP_OPERAND_IVC2_ACC0_6 :
1529 case MEP_OPERAND_IVC2_ACC0_7 :
1531 case MEP_OPERAND_IVC2_ACC1_0 :
1533 case MEP_OPERAND_IVC2_ACC1_1 :
1535 case MEP_OPERAND_IVC2_ACC1_2 :
1537 case MEP_OPERAND_IVC2_ACC1_3 :
1539 case MEP_OPERAND_IVC2_ACC1_4 :
1541 case MEP_OPERAND_IVC2_ACC1_5 :
1543 case MEP_OPERAND_IVC2_ACC1_6 :
1545 case MEP_OPERAND_IVC2_ACC1_7 :
1547 case MEP_OPERAND_IVC2_CC :
1549 case MEP_OPERAND_IVC2_COFA0 :
1551 case MEP_OPERAND_IVC2_COFA1 :
1553 case MEP_OPERAND_IVC2_COFR0 :
1555 case MEP_OPERAND_IVC2_COFR1 :
1557 case MEP_OPERAND_IVC2_CSAR0 :
1559 case MEP_OPERAND_IVC2_CSAR1 :
1561 case MEP_OPERAND_IVC2C3CCRN :
1563 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_c3hi);
1564 if (length <= 0) break;
1565 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_c3lo);
1566 if (length <= 0) break;
1567 FLD (f_ivc2_ccrn_c3) = ((((FLD (f_ivc2_ccrn_c3hi)) << (4))) | (FLD (f_ivc2_ccrn_c3lo)));
1570 case MEP_OPERAND_IVC2CCRN :
1572 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_h2);
1573 if (length <= 0) break;
1574 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1575 if (length <= 0) break;
1576 FLD (f_ivc2_ccrn) = ((((FLD (f_ivc2_ccrn_h2)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1579 case MEP_OPERAND_IVC2CRN :
1581 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 1, 32, total_length, pc, & fields->f_ivc2_ccrn_h1);
1582 if (length <= 0) break;
1583 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1584 if (length <= 0) break;
1585 FLD (f_ivc2_crnx) = ((((FLD (f_ivc2_ccrn_h1)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1588 case MEP_OPERAND_IVC2RM :
1589 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_crm);
1591 case MEP_OPERAND_LO :
1593 case MEP_OPERAND_LP :
1595 case MEP_OPERAND_MB0 :
1597 case MEP_OPERAND_MB1 :
1599 case MEP_OPERAND_ME0 :
1601 case MEP_OPERAND_ME1 :
1603 case MEP_OPERAND_NPC :
1605 case MEP_OPERAND_OPT :
1607 case MEP_OPERAND_PCABS24A2 :
1609 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u5a2n_hi);
1610 if (length <= 0) break;
1611 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 7, 32, total_length, pc, & fields->f_24u5a2n_lo);
1612 if (length <= 0) break;
1613 FLD (f_24u5a2n) = ((((FLD (f_24u5a2n_hi)) << (8))) | (((FLD (f_24u5a2n_lo)) << (1))));
1616 case MEP_OPERAND_PCREL12A2 :
1619 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 4, 11, 32, total_length, pc, & value);
1620 value = ((((value) << (1))) + (pc));
1621 fields->f_12s4a2 = value;
1624 case MEP_OPERAND_PCREL17A2 :
1627 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, pc, & value);
1628 value = ((((value) << (1))) + (pc));
1629 fields->f_17s16a2 = value;
1632 case MEP_OPERAND_PCREL24A2 :
1634 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, pc, & fields->f_24s5a2n_hi);
1635 if (length <= 0) break;
1636 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 7, 32, total_length, pc, & fields->f_24s5a2n_lo);
1637 if (length <= 0) break;
1638 FLD (f_24s5a2n) = ((((((FLD (f_24s5a2n_hi)) << (8))) | (((FLD (f_24s5a2n_lo)) << (1))))) + (pc));
1641 case MEP_OPERAND_PCREL8A2 :
1644 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 7, 32, total_length, pc, & value);
1645 value = ((((value) << (1))) + (pc));
1646 fields->f_8s8a2 = value;
1649 case MEP_OPERAND_PSW :
1651 case MEP_OPERAND_R0 :
1653 case MEP_OPERAND_R1 :
1655 case MEP_OPERAND_RL :
1656 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_rl);
1658 case MEP_OPERAND_RL5 :
1659 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 4, 32, total_length, pc, & fields->f_rl5);
1661 case MEP_OPERAND_RM :
1662 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1664 case MEP_OPERAND_RMA :
1665 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1667 case MEP_OPERAND_RN :
1668 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1670 case MEP_OPERAND_RN3 :
1671 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1673 case MEP_OPERAND_RN3C :
1674 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1676 case MEP_OPERAND_RN3L :
1677 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1679 case MEP_OPERAND_RN3S :
1680 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1682 case MEP_OPERAND_RN3UC :
1683 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1685 case MEP_OPERAND_RN3UL :
1686 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1688 case MEP_OPERAND_RN3US :
1689 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1691 case MEP_OPERAND_RNC :
1692 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1694 case MEP_OPERAND_RNL :
1695 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1697 case MEP_OPERAND_RNS :
1698 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1700 case MEP_OPERAND_RNUC :
1701 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1703 case MEP_OPERAND_RNUL :
1704 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1706 case MEP_OPERAND_RNUS :
1707 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1709 case MEP_OPERAND_SAR :
1711 case MEP_OPERAND_SDISP16 :
1712 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1714 case MEP_OPERAND_SIMM16 :
1715 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1717 case MEP_OPERAND_SIMM16P0 :
1719 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1720 if (length <= 0) break;
1721 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1722 if (length <= 0) break;
1724 FLD (f_ivc2_simm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1728 case MEP_OPERAND_SIMM6 :
1729 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 6, 32, total_length, pc, & fields->f_6s8);
1731 case MEP_OPERAND_SIMM8 :
1732 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, pc, & fields->f_8s8);
1734 case MEP_OPERAND_SIMM8P0 :
1735 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8s0);
1737 case MEP_OPERAND_SIMM8P20 :
1738 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8s20);
1740 case MEP_OPERAND_SIMM8P4 :
1741 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8s4);
1743 case MEP_OPERAND_SP :
1745 case MEP_OPERAND_SPR :
1747 case MEP_OPERAND_TP :
1749 case MEP_OPERAND_TPR :
1751 case MEP_OPERAND_UDISP2 :
1752 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_2u6);
1754 case MEP_OPERAND_UDISP7 :
1755 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 7, 32, total_length, pc, & fields->f_7u9);
1757 case MEP_OPERAND_UDISP7A2 :
1760 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 6, 32, total_length, pc, & value);
1761 value = ((value) << (1));
1762 fields->f_7u9a2 = value;
1765 case MEP_OPERAND_UDISP7A4 :
1768 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1769 value = ((value) << (2));
1770 fields->f_7u9a4 = value;
1773 case MEP_OPERAND_UIMM16 :
1774 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1776 case MEP_OPERAND_UIMM2 :
1777 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & fields->f_2u10);
1779 case MEP_OPERAND_UIMM24 :
1781 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8n_hi);
1782 if (length <= 0) break;
1783 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_24u8n_lo);
1784 if (length <= 0) break;
1785 FLD (f_24u8n) = ((((FLD (f_24u8n_hi)) << (8))) | (FLD (f_24u8n_lo)));
1788 case MEP_OPERAND_UIMM3 :
1789 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_3u5);
1791 case MEP_OPERAND_UIMM4 :
1792 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_4u8);
1794 case MEP_OPERAND_UIMM5 :
1795 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_5u8);
1797 case MEP_OPERAND_UIMM7A4 :
1800 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1801 value = ((value) << (2));
1802 fields->f_7u9a4 = value;
1805 case MEP_OPERAND_ZERO :
1809 /* xgettext:c-format */
1810 fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"),
1818 cgen_insert_fn * const mep_cgen_insert_handlers[] =
1823 cgen_extract_fn * const mep_cgen_extract_handlers[] =
1825 extract_insn_normal,
1828 int mep_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1829 bfd_vma mep_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1831 /* Getting values from cgen_fields is handled by a collection of functions.
1832 They are distinguished by the type of the VALUE argument they return.
1833 TODO: floating point, inlining support, remove cases where result type
1837 mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1839 const CGEN_FIELDS * fields)
1845 case MEP_OPERAND_ADDR24A4 :
1846 value = fields->f_24u8a4n;
1848 case MEP_OPERAND_C5RMUIMM20 :
1849 value = fields->f_c5_rmuimm20;
1851 case MEP_OPERAND_C5RNMUIMM24 :
1852 value = fields->f_c5_rnmuimm24;
1854 case MEP_OPERAND_CALLNUM :
1855 value = fields->f_callnum;
1857 case MEP_OPERAND_CCCC :
1858 value = fields->f_rm;
1860 case MEP_OPERAND_CCRN :
1861 value = fields->f_ccrn;
1863 case MEP_OPERAND_CDISP10 :
1864 value = fields->f_cdisp10;
1866 case MEP_OPERAND_CDISP10A2 :
1867 value = fields->f_cdisp10;
1869 case MEP_OPERAND_CDISP10A4 :
1870 value = fields->f_cdisp10;
1872 case MEP_OPERAND_CDISP10A8 :
1873 value = fields->f_cdisp10;
1875 case MEP_OPERAND_CDISP12 :
1876 value = fields->f_12s20;
1878 case MEP_OPERAND_CIMM4 :
1879 value = fields->f_rn;
1881 case MEP_OPERAND_CIMM5 :
1882 value = fields->f_5u24;
1884 case MEP_OPERAND_CODE16 :
1885 value = fields->f_16u16;
1887 case MEP_OPERAND_CODE24 :
1888 value = fields->f_24u4n;
1890 case MEP_OPERAND_CP_FLAG :
1893 case MEP_OPERAND_CRN :
1894 value = fields->f_crn;
1896 case MEP_OPERAND_CRN64 :
1897 value = fields->f_crn;
1899 case MEP_OPERAND_CRNX :
1900 value = fields->f_crnx;
1902 case MEP_OPERAND_CRNX64 :
1903 value = fields->f_crnx;
1905 case MEP_OPERAND_CROC :
1906 value = fields->f_ivc2_5u7;
1908 case MEP_OPERAND_CROP :
1909 value = fields->f_ivc2_5u23;
1911 case MEP_OPERAND_CRPC :
1912 value = fields->f_ivc2_5u26;
1914 case MEP_OPERAND_CRPP :
1915 value = fields->f_ivc2_5u18;
1917 case MEP_OPERAND_CRQC :
1918 value = fields->f_ivc2_5u21;
1920 case MEP_OPERAND_CRQP :
1921 value = fields->f_ivc2_5u13;
1923 case MEP_OPERAND_CSRN :
1924 value = fields->f_csrn;
1926 case MEP_OPERAND_CSRN_IDX :
1927 value = fields->f_csrn;
1929 case MEP_OPERAND_DBG :
1932 case MEP_OPERAND_DEPC :
1935 case MEP_OPERAND_EPC :
1938 case MEP_OPERAND_EXC :
1941 case MEP_OPERAND_HI :
1944 case MEP_OPERAND_IMM16P0 :
1945 value = fields->f_ivc2_imm16p0;
1947 case MEP_OPERAND_IMM3P12 :
1948 value = fields->f_ivc2_3u12;
1950 case MEP_OPERAND_IMM3P25 :
1951 value = fields->f_ivc2_3u25;
1953 case MEP_OPERAND_IMM3P4 :
1954 value = fields->f_ivc2_3u4;
1956 case MEP_OPERAND_IMM3P5 :
1957 value = fields->f_ivc2_3u5;
1959 case MEP_OPERAND_IMM3P9 :
1960 value = fields->f_ivc2_3u9;
1962 case MEP_OPERAND_IMM4P10 :
1963 value = fields->f_ivc2_4u10;
1965 case MEP_OPERAND_IMM4P4 :
1966 value = fields->f_ivc2_4u4;
1968 case MEP_OPERAND_IMM4P8 :
1969 value = fields->f_ivc2_4u8;
1971 case MEP_OPERAND_IMM5P23 :
1972 value = fields->f_ivc2_5u23;
1974 case MEP_OPERAND_IMM5P3 :
1975 value = fields->f_ivc2_5u3;
1977 case MEP_OPERAND_IMM5P7 :
1978 value = fields->f_ivc2_5u7;
1980 case MEP_OPERAND_IMM5P8 :
1981 value = fields->f_ivc2_5u8;
1983 case MEP_OPERAND_IMM6P2 :
1984 value = fields->f_ivc2_6u2;
1986 case MEP_OPERAND_IMM6P6 :
1987 value = fields->f_ivc2_6u6;
1989 case MEP_OPERAND_IMM8P0 :
1990 value = fields->f_ivc2_8u0;
1992 case MEP_OPERAND_IMM8P20 :
1993 value = fields->f_ivc2_8u20;
1995 case MEP_OPERAND_IMM8P4 :
1996 value = fields->f_ivc2_8u4;
1998 case MEP_OPERAND_IVC_X_0_2 :
1999 value = fields->f_ivc2_2u0;
2001 case MEP_OPERAND_IVC_X_0_3 :
2002 value = fields->f_ivc2_3u0;
2004 case MEP_OPERAND_IVC_X_0_4 :
2005 value = fields->f_ivc2_4u0;
2007 case MEP_OPERAND_IVC_X_0_5 :
2008 value = fields->f_ivc2_5u0;
2010 case MEP_OPERAND_IVC_X_6_1 :
2011 value = fields->f_ivc2_1u6;
2013 case MEP_OPERAND_IVC_X_6_2 :
2014 value = fields->f_ivc2_2u6;
2016 case MEP_OPERAND_IVC_X_6_3 :
2017 value = fields->f_ivc2_3u6;
2019 case MEP_OPERAND_IVC2_ACC0_0 :
2022 case MEP_OPERAND_IVC2_ACC0_1 :
2025 case MEP_OPERAND_IVC2_ACC0_2 :
2028 case MEP_OPERAND_IVC2_ACC0_3 :
2031 case MEP_OPERAND_IVC2_ACC0_4 :
2034 case MEP_OPERAND_IVC2_ACC0_5 :
2037 case MEP_OPERAND_IVC2_ACC0_6 :
2040 case MEP_OPERAND_IVC2_ACC0_7 :
2043 case MEP_OPERAND_IVC2_ACC1_0 :
2046 case MEP_OPERAND_IVC2_ACC1_1 :
2049 case MEP_OPERAND_IVC2_ACC1_2 :
2052 case MEP_OPERAND_IVC2_ACC1_3 :
2055 case MEP_OPERAND_IVC2_ACC1_4 :
2058 case MEP_OPERAND_IVC2_ACC1_5 :
2061 case MEP_OPERAND_IVC2_ACC1_6 :
2064 case MEP_OPERAND_IVC2_ACC1_7 :
2067 case MEP_OPERAND_IVC2_CC :
2070 case MEP_OPERAND_IVC2_COFA0 :
2073 case MEP_OPERAND_IVC2_COFA1 :
2076 case MEP_OPERAND_IVC2_COFR0 :
2079 case MEP_OPERAND_IVC2_COFR1 :
2082 case MEP_OPERAND_IVC2_CSAR0 :
2085 case MEP_OPERAND_IVC2_CSAR1 :
2088 case MEP_OPERAND_IVC2C3CCRN :
2089 value = fields->f_ivc2_ccrn_c3;
2091 case MEP_OPERAND_IVC2CCRN :
2092 value = fields->f_ivc2_ccrn;
2094 case MEP_OPERAND_IVC2CRN :
2095 value = fields->f_ivc2_crnx;
2097 case MEP_OPERAND_IVC2RM :
2098 value = fields->f_ivc2_crm;
2100 case MEP_OPERAND_LO :
2103 case MEP_OPERAND_LP :
2106 case MEP_OPERAND_MB0 :
2109 case MEP_OPERAND_MB1 :
2112 case MEP_OPERAND_ME0 :
2115 case MEP_OPERAND_ME1 :
2118 case MEP_OPERAND_NPC :
2121 case MEP_OPERAND_OPT :
2124 case MEP_OPERAND_PCABS24A2 :
2125 value = fields->f_24u5a2n;
2127 case MEP_OPERAND_PCREL12A2 :
2128 value = fields->f_12s4a2;
2130 case MEP_OPERAND_PCREL17A2 :
2131 value = fields->f_17s16a2;
2133 case MEP_OPERAND_PCREL24A2 :
2134 value = fields->f_24s5a2n;
2136 case MEP_OPERAND_PCREL8A2 :
2137 value = fields->f_8s8a2;
2139 case MEP_OPERAND_PSW :
2142 case MEP_OPERAND_R0 :
2145 case MEP_OPERAND_R1 :
2148 case MEP_OPERAND_RL :
2149 value = fields->f_rl;
2151 case MEP_OPERAND_RL5 :
2152 value = fields->f_rl5;
2154 case MEP_OPERAND_RM :
2155 value = fields->f_rm;
2157 case MEP_OPERAND_RMA :
2158 value = fields->f_rm;
2160 case MEP_OPERAND_RN :
2161 value = fields->f_rn;
2163 case MEP_OPERAND_RN3 :
2164 value = fields->f_rn3;
2166 case MEP_OPERAND_RN3C :
2167 value = fields->f_rn3;
2169 case MEP_OPERAND_RN3L :
2170 value = fields->f_rn3;
2172 case MEP_OPERAND_RN3S :
2173 value = fields->f_rn3;
2175 case MEP_OPERAND_RN3UC :
2176 value = fields->f_rn3;
2178 case MEP_OPERAND_RN3UL :
2179 value = fields->f_rn3;
2181 case MEP_OPERAND_RN3US :
2182 value = fields->f_rn3;
2184 case MEP_OPERAND_RNC :
2185 value = fields->f_rn;
2187 case MEP_OPERAND_RNL :
2188 value = fields->f_rn;
2190 case MEP_OPERAND_RNS :
2191 value = fields->f_rn;
2193 case MEP_OPERAND_RNUC :
2194 value = fields->f_rn;
2196 case MEP_OPERAND_RNUL :
2197 value = fields->f_rn;
2199 case MEP_OPERAND_RNUS :
2200 value = fields->f_rn;
2202 case MEP_OPERAND_SAR :
2205 case MEP_OPERAND_SDISP16 :
2206 value = fields->f_16s16;
2208 case MEP_OPERAND_SIMM16 :
2209 value = fields->f_16s16;
2211 case MEP_OPERAND_SIMM16P0 :
2212 value = fields->f_ivc2_simm16p0;
2214 case MEP_OPERAND_SIMM6 :
2215 value = fields->f_6s8;
2217 case MEP_OPERAND_SIMM8 :
2218 value = fields->f_8s8;
2220 case MEP_OPERAND_SIMM8P0 :
2221 value = fields->f_ivc2_8s0;
2223 case MEP_OPERAND_SIMM8P20 :
2224 value = fields->f_ivc2_8s20;
2226 case MEP_OPERAND_SIMM8P4 :
2227 value = fields->f_ivc2_8s4;
2229 case MEP_OPERAND_SP :
2232 case MEP_OPERAND_SPR :
2235 case MEP_OPERAND_TP :
2238 case MEP_OPERAND_TPR :
2241 case MEP_OPERAND_UDISP2 :
2242 value = fields->f_2u6;
2244 case MEP_OPERAND_UDISP7 :
2245 value = fields->f_7u9;
2247 case MEP_OPERAND_UDISP7A2 :
2248 value = fields->f_7u9a2;
2250 case MEP_OPERAND_UDISP7A4 :
2251 value = fields->f_7u9a4;
2253 case MEP_OPERAND_UIMM16 :
2254 value = fields->f_16u16;
2256 case MEP_OPERAND_UIMM2 :
2257 value = fields->f_2u10;
2259 case MEP_OPERAND_UIMM24 :
2260 value = fields->f_24u8n;
2262 case MEP_OPERAND_UIMM3 :
2263 value = fields->f_3u5;
2265 case MEP_OPERAND_UIMM4 :
2266 value = fields->f_4u8;
2268 case MEP_OPERAND_UIMM5 :
2269 value = fields->f_5u8;
2271 case MEP_OPERAND_UIMM7A4 :
2272 value = fields->f_7u9a4;
2274 case MEP_OPERAND_ZERO :
2279 /* xgettext:c-format */
2280 fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"),
2289 mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2291 const CGEN_FIELDS * fields)
2297 case MEP_OPERAND_ADDR24A4 :
2298 value = fields->f_24u8a4n;
2300 case MEP_OPERAND_C5RMUIMM20 :
2301 value = fields->f_c5_rmuimm20;
2303 case MEP_OPERAND_C5RNMUIMM24 :
2304 value = fields->f_c5_rnmuimm24;
2306 case MEP_OPERAND_CALLNUM :
2307 value = fields->f_callnum;
2309 case MEP_OPERAND_CCCC :
2310 value = fields->f_rm;
2312 case MEP_OPERAND_CCRN :
2313 value = fields->f_ccrn;
2315 case MEP_OPERAND_CDISP10 :
2316 value = fields->f_cdisp10;
2318 case MEP_OPERAND_CDISP10A2 :
2319 value = fields->f_cdisp10;
2321 case MEP_OPERAND_CDISP10A4 :
2322 value = fields->f_cdisp10;
2324 case MEP_OPERAND_CDISP10A8 :
2325 value = fields->f_cdisp10;
2327 case MEP_OPERAND_CDISP12 :
2328 value = fields->f_12s20;
2330 case MEP_OPERAND_CIMM4 :
2331 value = fields->f_rn;
2333 case MEP_OPERAND_CIMM5 :
2334 value = fields->f_5u24;
2336 case MEP_OPERAND_CODE16 :
2337 value = fields->f_16u16;
2339 case MEP_OPERAND_CODE24 :
2340 value = fields->f_24u4n;
2342 case MEP_OPERAND_CP_FLAG :
2345 case MEP_OPERAND_CRN :
2346 value = fields->f_crn;
2348 case MEP_OPERAND_CRN64 :
2349 value = fields->f_crn;
2351 case MEP_OPERAND_CRNX :
2352 value = fields->f_crnx;
2354 case MEP_OPERAND_CRNX64 :
2355 value = fields->f_crnx;
2357 case MEP_OPERAND_CROC :
2358 value = fields->f_ivc2_5u7;
2360 case MEP_OPERAND_CROP :
2361 value = fields->f_ivc2_5u23;
2363 case MEP_OPERAND_CRPC :
2364 value = fields->f_ivc2_5u26;
2366 case MEP_OPERAND_CRPP :
2367 value = fields->f_ivc2_5u18;
2369 case MEP_OPERAND_CRQC :
2370 value = fields->f_ivc2_5u21;
2372 case MEP_OPERAND_CRQP :
2373 value = fields->f_ivc2_5u13;
2375 case MEP_OPERAND_CSRN :
2376 value = fields->f_csrn;
2378 case MEP_OPERAND_CSRN_IDX :
2379 value = fields->f_csrn;
2381 case MEP_OPERAND_DBG :
2384 case MEP_OPERAND_DEPC :
2387 case MEP_OPERAND_EPC :
2390 case MEP_OPERAND_EXC :
2393 case MEP_OPERAND_HI :
2396 case MEP_OPERAND_IMM16P0 :
2397 value = fields->f_ivc2_imm16p0;
2399 case MEP_OPERAND_IMM3P12 :
2400 value = fields->f_ivc2_3u12;
2402 case MEP_OPERAND_IMM3P25 :
2403 value = fields->f_ivc2_3u25;
2405 case MEP_OPERAND_IMM3P4 :
2406 value = fields->f_ivc2_3u4;
2408 case MEP_OPERAND_IMM3P5 :
2409 value = fields->f_ivc2_3u5;
2411 case MEP_OPERAND_IMM3P9 :
2412 value = fields->f_ivc2_3u9;
2414 case MEP_OPERAND_IMM4P10 :
2415 value = fields->f_ivc2_4u10;
2417 case MEP_OPERAND_IMM4P4 :
2418 value = fields->f_ivc2_4u4;
2420 case MEP_OPERAND_IMM4P8 :
2421 value = fields->f_ivc2_4u8;
2423 case MEP_OPERAND_IMM5P23 :
2424 value = fields->f_ivc2_5u23;
2426 case MEP_OPERAND_IMM5P3 :
2427 value = fields->f_ivc2_5u3;
2429 case MEP_OPERAND_IMM5P7 :
2430 value = fields->f_ivc2_5u7;
2432 case MEP_OPERAND_IMM5P8 :
2433 value = fields->f_ivc2_5u8;
2435 case MEP_OPERAND_IMM6P2 :
2436 value = fields->f_ivc2_6u2;
2438 case MEP_OPERAND_IMM6P6 :
2439 value = fields->f_ivc2_6u6;
2441 case MEP_OPERAND_IMM8P0 :
2442 value = fields->f_ivc2_8u0;
2444 case MEP_OPERAND_IMM8P20 :
2445 value = fields->f_ivc2_8u20;
2447 case MEP_OPERAND_IMM8P4 :
2448 value = fields->f_ivc2_8u4;
2450 case MEP_OPERAND_IVC_X_0_2 :
2451 value = fields->f_ivc2_2u0;
2453 case MEP_OPERAND_IVC_X_0_3 :
2454 value = fields->f_ivc2_3u0;
2456 case MEP_OPERAND_IVC_X_0_4 :
2457 value = fields->f_ivc2_4u0;
2459 case MEP_OPERAND_IVC_X_0_5 :
2460 value = fields->f_ivc2_5u0;
2462 case MEP_OPERAND_IVC_X_6_1 :
2463 value = fields->f_ivc2_1u6;
2465 case MEP_OPERAND_IVC_X_6_2 :
2466 value = fields->f_ivc2_2u6;
2468 case MEP_OPERAND_IVC_X_6_3 :
2469 value = fields->f_ivc2_3u6;
2471 case MEP_OPERAND_IVC2_ACC0_0 :
2474 case MEP_OPERAND_IVC2_ACC0_1 :
2477 case MEP_OPERAND_IVC2_ACC0_2 :
2480 case MEP_OPERAND_IVC2_ACC0_3 :
2483 case MEP_OPERAND_IVC2_ACC0_4 :
2486 case MEP_OPERAND_IVC2_ACC0_5 :
2489 case MEP_OPERAND_IVC2_ACC0_6 :
2492 case MEP_OPERAND_IVC2_ACC0_7 :
2495 case MEP_OPERAND_IVC2_ACC1_0 :
2498 case MEP_OPERAND_IVC2_ACC1_1 :
2501 case MEP_OPERAND_IVC2_ACC1_2 :
2504 case MEP_OPERAND_IVC2_ACC1_3 :
2507 case MEP_OPERAND_IVC2_ACC1_4 :
2510 case MEP_OPERAND_IVC2_ACC1_5 :
2513 case MEP_OPERAND_IVC2_ACC1_6 :
2516 case MEP_OPERAND_IVC2_ACC1_7 :
2519 case MEP_OPERAND_IVC2_CC :
2522 case MEP_OPERAND_IVC2_COFA0 :
2525 case MEP_OPERAND_IVC2_COFA1 :
2528 case MEP_OPERAND_IVC2_COFR0 :
2531 case MEP_OPERAND_IVC2_COFR1 :
2534 case MEP_OPERAND_IVC2_CSAR0 :
2537 case MEP_OPERAND_IVC2_CSAR1 :
2540 case MEP_OPERAND_IVC2C3CCRN :
2541 value = fields->f_ivc2_ccrn_c3;
2543 case MEP_OPERAND_IVC2CCRN :
2544 value = fields->f_ivc2_ccrn;
2546 case MEP_OPERAND_IVC2CRN :
2547 value = fields->f_ivc2_crnx;
2549 case MEP_OPERAND_IVC2RM :
2550 value = fields->f_ivc2_crm;
2552 case MEP_OPERAND_LO :
2555 case MEP_OPERAND_LP :
2558 case MEP_OPERAND_MB0 :
2561 case MEP_OPERAND_MB1 :
2564 case MEP_OPERAND_ME0 :
2567 case MEP_OPERAND_ME1 :
2570 case MEP_OPERAND_NPC :
2573 case MEP_OPERAND_OPT :
2576 case MEP_OPERAND_PCABS24A2 :
2577 value = fields->f_24u5a2n;
2579 case MEP_OPERAND_PCREL12A2 :
2580 value = fields->f_12s4a2;
2582 case MEP_OPERAND_PCREL17A2 :
2583 value = fields->f_17s16a2;
2585 case MEP_OPERAND_PCREL24A2 :
2586 value = fields->f_24s5a2n;
2588 case MEP_OPERAND_PCREL8A2 :
2589 value = fields->f_8s8a2;
2591 case MEP_OPERAND_PSW :
2594 case MEP_OPERAND_R0 :
2597 case MEP_OPERAND_R1 :
2600 case MEP_OPERAND_RL :
2601 value = fields->f_rl;
2603 case MEP_OPERAND_RL5 :
2604 value = fields->f_rl5;
2606 case MEP_OPERAND_RM :
2607 value = fields->f_rm;
2609 case MEP_OPERAND_RMA :
2610 value = fields->f_rm;
2612 case MEP_OPERAND_RN :
2613 value = fields->f_rn;
2615 case MEP_OPERAND_RN3 :
2616 value = fields->f_rn3;
2618 case MEP_OPERAND_RN3C :
2619 value = fields->f_rn3;
2621 case MEP_OPERAND_RN3L :
2622 value = fields->f_rn3;
2624 case MEP_OPERAND_RN3S :
2625 value = fields->f_rn3;
2627 case MEP_OPERAND_RN3UC :
2628 value = fields->f_rn3;
2630 case MEP_OPERAND_RN3UL :
2631 value = fields->f_rn3;
2633 case MEP_OPERAND_RN3US :
2634 value = fields->f_rn3;
2636 case MEP_OPERAND_RNC :
2637 value = fields->f_rn;
2639 case MEP_OPERAND_RNL :
2640 value = fields->f_rn;
2642 case MEP_OPERAND_RNS :
2643 value = fields->f_rn;
2645 case MEP_OPERAND_RNUC :
2646 value = fields->f_rn;
2648 case MEP_OPERAND_RNUL :
2649 value = fields->f_rn;
2651 case MEP_OPERAND_RNUS :
2652 value = fields->f_rn;
2654 case MEP_OPERAND_SAR :
2657 case MEP_OPERAND_SDISP16 :
2658 value = fields->f_16s16;
2660 case MEP_OPERAND_SIMM16 :
2661 value = fields->f_16s16;
2663 case MEP_OPERAND_SIMM16P0 :
2664 value = fields->f_ivc2_simm16p0;
2666 case MEP_OPERAND_SIMM6 :
2667 value = fields->f_6s8;
2669 case MEP_OPERAND_SIMM8 :
2670 value = fields->f_8s8;
2672 case MEP_OPERAND_SIMM8P0 :
2673 value = fields->f_ivc2_8s0;
2675 case MEP_OPERAND_SIMM8P20 :
2676 value = fields->f_ivc2_8s20;
2678 case MEP_OPERAND_SIMM8P4 :
2679 value = fields->f_ivc2_8s4;
2681 case MEP_OPERAND_SP :
2684 case MEP_OPERAND_SPR :
2687 case MEP_OPERAND_TP :
2690 case MEP_OPERAND_TPR :
2693 case MEP_OPERAND_UDISP2 :
2694 value = fields->f_2u6;
2696 case MEP_OPERAND_UDISP7 :
2697 value = fields->f_7u9;
2699 case MEP_OPERAND_UDISP7A2 :
2700 value = fields->f_7u9a2;
2702 case MEP_OPERAND_UDISP7A4 :
2703 value = fields->f_7u9a4;
2705 case MEP_OPERAND_UIMM16 :
2706 value = fields->f_16u16;
2708 case MEP_OPERAND_UIMM2 :
2709 value = fields->f_2u10;
2711 case MEP_OPERAND_UIMM24 :
2712 value = fields->f_24u8n;
2714 case MEP_OPERAND_UIMM3 :
2715 value = fields->f_3u5;
2717 case MEP_OPERAND_UIMM4 :
2718 value = fields->f_4u8;
2720 case MEP_OPERAND_UIMM5 :
2721 value = fields->f_5u8;
2723 case MEP_OPERAND_UIMM7A4 :
2724 value = fields->f_7u9a4;
2726 case MEP_OPERAND_ZERO :
2731 /* xgettext:c-format */
2732 fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"),
2740 void mep_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
2741 void mep_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
2743 /* Stuffing values in cgen_fields is handled by a collection of functions.
2744 They are distinguished by the type of the VALUE argument they accept.
2745 TODO: floating point, inlining support, remove cases where argument type
2749 mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2751 CGEN_FIELDS * fields,
2756 case MEP_OPERAND_ADDR24A4 :
2757 fields->f_24u8a4n = value;
2759 case MEP_OPERAND_C5RMUIMM20 :
2760 fields->f_c5_rmuimm20 = value;
2762 case MEP_OPERAND_C5RNMUIMM24 :
2763 fields->f_c5_rnmuimm24 = value;
2765 case MEP_OPERAND_CALLNUM :
2766 fields->f_callnum = value;
2768 case MEP_OPERAND_CCCC :
2769 fields->f_rm = value;
2771 case MEP_OPERAND_CCRN :
2772 fields->f_ccrn = value;
2774 case MEP_OPERAND_CDISP10 :
2775 fields->f_cdisp10 = value;
2777 case MEP_OPERAND_CDISP10A2 :
2778 fields->f_cdisp10 = value;
2780 case MEP_OPERAND_CDISP10A4 :
2781 fields->f_cdisp10 = value;
2783 case MEP_OPERAND_CDISP10A8 :
2784 fields->f_cdisp10 = value;
2786 case MEP_OPERAND_CDISP12 :
2787 fields->f_12s20 = value;
2789 case MEP_OPERAND_CIMM4 :
2790 fields->f_rn = value;
2792 case MEP_OPERAND_CIMM5 :
2793 fields->f_5u24 = value;
2795 case MEP_OPERAND_CODE16 :
2796 fields->f_16u16 = value;
2798 case MEP_OPERAND_CODE24 :
2799 fields->f_24u4n = value;
2801 case MEP_OPERAND_CP_FLAG :
2803 case MEP_OPERAND_CRN :
2804 fields->f_crn = value;
2806 case MEP_OPERAND_CRN64 :
2807 fields->f_crn = value;
2809 case MEP_OPERAND_CRNX :
2810 fields->f_crnx = value;
2812 case MEP_OPERAND_CRNX64 :
2813 fields->f_crnx = value;
2815 case MEP_OPERAND_CROC :
2816 fields->f_ivc2_5u7 = value;
2818 case MEP_OPERAND_CROP :
2819 fields->f_ivc2_5u23 = value;
2821 case MEP_OPERAND_CRPC :
2822 fields->f_ivc2_5u26 = value;
2824 case MEP_OPERAND_CRPP :
2825 fields->f_ivc2_5u18 = value;
2827 case MEP_OPERAND_CRQC :
2828 fields->f_ivc2_5u21 = value;
2830 case MEP_OPERAND_CRQP :
2831 fields->f_ivc2_5u13 = value;
2833 case MEP_OPERAND_CSRN :
2834 fields->f_csrn = value;
2836 case MEP_OPERAND_CSRN_IDX :
2837 fields->f_csrn = value;
2839 case MEP_OPERAND_DBG :
2841 case MEP_OPERAND_DEPC :
2843 case MEP_OPERAND_EPC :
2845 case MEP_OPERAND_EXC :
2847 case MEP_OPERAND_HI :
2849 case MEP_OPERAND_IMM16P0 :
2850 fields->f_ivc2_imm16p0 = value;
2852 case MEP_OPERAND_IMM3P12 :
2853 fields->f_ivc2_3u12 = value;
2855 case MEP_OPERAND_IMM3P25 :
2856 fields->f_ivc2_3u25 = value;
2858 case MEP_OPERAND_IMM3P4 :
2859 fields->f_ivc2_3u4 = value;
2861 case MEP_OPERAND_IMM3P5 :
2862 fields->f_ivc2_3u5 = value;
2864 case MEP_OPERAND_IMM3P9 :
2865 fields->f_ivc2_3u9 = value;
2867 case MEP_OPERAND_IMM4P10 :
2868 fields->f_ivc2_4u10 = value;
2870 case MEP_OPERAND_IMM4P4 :
2871 fields->f_ivc2_4u4 = value;
2873 case MEP_OPERAND_IMM4P8 :
2874 fields->f_ivc2_4u8 = value;
2876 case MEP_OPERAND_IMM5P23 :
2877 fields->f_ivc2_5u23 = value;
2879 case MEP_OPERAND_IMM5P3 :
2880 fields->f_ivc2_5u3 = value;
2882 case MEP_OPERAND_IMM5P7 :
2883 fields->f_ivc2_5u7 = value;
2885 case MEP_OPERAND_IMM5P8 :
2886 fields->f_ivc2_5u8 = value;
2888 case MEP_OPERAND_IMM6P2 :
2889 fields->f_ivc2_6u2 = value;
2891 case MEP_OPERAND_IMM6P6 :
2892 fields->f_ivc2_6u6 = value;
2894 case MEP_OPERAND_IMM8P0 :
2895 fields->f_ivc2_8u0 = value;
2897 case MEP_OPERAND_IMM8P20 :
2898 fields->f_ivc2_8u20 = value;
2900 case MEP_OPERAND_IMM8P4 :
2901 fields->f_ivc2_8u4 = value;
2903 case MEP_OPERAND_IVC_X_0_2 :
2904 fields->f_ivc2_2u0 = value;
2906 case MEP_OPERAND_IVC_X_0_3 :
2907 fields->f_ivc2_3u0 = value;
2909 case MEP_OPERAND_IVC_X_0_4 :
2910 fields->f_ivc2_4u0 = value;
2912 case MEP_OPERAND_IVC_X_0_5 :
2913 fields->f_ivc2_5u0 = value;
2915 case MEP_OPERAND_IVC_X_6_1 :
2916 fields->f_ivc2_1u6 = value;
2918 case MEP_OPERAND_IVC_X_6_2 :
2919 fields->f_ivc2_2u6 = value;
2921 case MEP_OPERAND_IVC_X_6_3 :
2922 fields->f_ivc2_3u6 = value;
2924 case MEP_OPERAND_IVC2_ACC0_0 :
2926 case MEP_OPERAND_IVC2_ACC0_1 :
2928 case MEP_OPERAND_IVC2_ACC0_2 :
2930 case MEP_OPERAND_IVC2_ACC0_3 :
2932 case MEP_OPERAND_IVC2_ACC0_4 :
2934 case MEP_OPERAND_IVC2_ACC0_5 :
2936 case MEP_OPERAND_IVC2_ACC0_6 :
2938 case MEP_OPERAND_IVC2_ACC0_7 :
2940 case MEP_OPERAND_IVC2_ACC1_0 :
2942 case MEP_OPERAND_IVC2_ACC1_1 :
2944 case MEP_OPERAND_IVC2_ACC1_2 :
2946 case MEP_OPERAND_IVC2_ACC1_3 :
2948 case MEP_OPERAND_IVC2_ACC1_4 :
2950 case MEP_OPERAND_IVC2_ACC1_5 :
2952 case MEP_OPERAND_IVC2_ACC1_6 :
2954 case MEP_OPERAND_IVC2_ACC1_7 :
2956 case MEP_OPERAND_IVC2_CC :
2958 case MEP_OPERAND_IVC2_COFA0 :
2960 case MEP_OPERAND_IVC2_COFA1 :
2962 case MEP_OPERAND_IVC2_COFR0 :
2964 case MEP_OPERAND_IVC2_COFR1 :
2966 case MEP_OPERAND_IVC2_CSAR0 :
2968 case MEP_OPERAND_IVC2_CSAR1 :
2970 case MEP_OPERAND_IVC2C3CCRN :
2971 fields->f_ivc2_ccrn_c3 = value;
2973 case MEP_OPERAND_IVC2CCRN :
2974 fields->f_ivc2_ccrn = value;
2976 case MEP_OPERAND_IVC2CRN :
2977 fields->f_ivc2_crnx = value;
2979 case MEP_OPERAND_IVC2RM :
2980 fields->f_ivc2_crm = value;
2982 case MEP_OPERAND_LO :
2984 case MEP_OPERAND_LP :
2986 case MEP_OPERAND_MB0 :
2988 case MEP_OPERAND_MB1 :
2990 case MEP_OPERAND_ME0 :
2992 case MEP_OPERAND_ME1 :
2994 case MEP_OPERAND_NPC :
2996 case MEP_OPERAND_OPT :
2998 case MEP_OPERAND_PCABS24A2 :
2999 fields->f_24u5a2n = value;
3001 case MEP_OPERAND_PCREL12A2 :
3002 fields->f_12s4a2 = value;
3004 case MEP_OPERAND_PCREL17A2 :
3005 fields->f_17s16a2 = value;
3007 case MEP_OPERAND_PCREL24A2 :
3008 fields->f_24s5a2n = value;
3010 case MEP_OPERAND_PCREL8A2 :
3011 fields->f_8s8a2 = value;
3013 case MEP_OPERAND_PSW :
3015 case MEP_OPERAND_R0 :
3017 case MEP_OPERAND_R1 :
3019 case MEP_OPERAND_RL :
3020 fields->f_rl = value;
3022 case MEP_OPERAND_RL5 :
3023 fields->f_rl5 = value;
3025 case MEP_OPERAND_RM :
3026 fields->f_rm = value;
3028 case MEP_OPERAND_RMA :
3029 fields->f_rm = value;
3031 case MEP_OPERAND_RN :
3032 fields->f_rn = value;
3034 case MEP_OPERAND_RN3 :
3035 fields->f_rn3 = value;
3037 case MEP_OPERAND_RN3C :
3038 fields->f_rn3 = value;
3040 case MEP_OPERAND_RN3L :
3041 fields->f_rn3 = value;
3043 case MEP_OPERAND_RN3S :
3044 fields->f_rn3 = value;
3046 case MEP_OPERAND_RN3UC :
3047 fields->f_rn3 = value;
3049 case MEP_OPERAND_RN3UL :
3050 fields->f_rn3 = value;
3052 case MEP_OPERAND_RN3US :
3053 fields->f_rn3 = value;
3055 case MEP_OPERAND_RNC :
3056 fields->f_rn = value;
3058 case MEP_OPERAND_RNL :
3059 fields->f_rn = value;
3061 case MEP_OPERAND_RNS :
3062 fields->f_rn = value;
3064 case MEP_OPERAND_RNUC :
3065 fields->f_rn = value;
3067 case MEP_OPERAND_RNUL :
3068 fields->f_rn = value;
3070 case MEP_OPERAND_RNUS :
3071 fields->f_rn = value;
3073 case MEP_OPERAND_SAR :
3075 case MEP_OPERAND_SDISP16 :
3076 fields->f_16s16 = value;
3078 case MEP_OPERAND_SIMM16 :
3079 fields->f_16s16 = value;
3081 case MEP_OPERAND_SIMM16P0 :
3082 fields->f_ivc2_simm16p0 = value;
3084 case MEP_OPERAND_SIMM6 :
3085 fields->f_6s8 = value;
3087 case MEP_OPERAND_SIMM8 :
3088 fields->f_8s8 = value;
3090 case MEP_OPERAND_SIMM8P0 :
3091 fields->f_ivc2_8s0 = value;
3093 case MEP_OPERAND_SIMM8P20 :
3094 fields->f_ivc2_8s20 = value;
3096 case MEP_OPERAND_SIMM8P4 :
3097 fields->f_ivc2_8s4 = value;
3099 case MEP_OPERAND_SP :
3101 case MEP_OPERAND_SPR :
3103 case MEP_OPERAND_TP :
3105 case MEP_OPERAND_TPR :
3107 case MEP_OPERAND_UDISP2 :
3108 fields->f_2u6 = value;
3110 case MEP_OPERAND_UDISP7 :
3111 fields->f_7u9 = value;
3113 case MEP_OPERAND_UDISP7A2 :
3114 fields->f_7u9a2 = value;
3116 case MEP_OPERAND_UDISP7A4 :
3117 fields->f_7u9a4 = value;
3119 case MEP_OPERAND_UIMM16 :
3120 fields->f_16u16 = value;
3122 case MEP_OPERAND_UIMM2 :
3123 fields->f_2u10 = value;
3125 case MEP_OPERAND_UIMM24 :
3126 fields->f_24u8n = value;
3128 case MEP_OPERAND_UIMM3 :
3129 fields->f_3u5 = value;
3131 case MEP_OPERAND_UIMM4 :
3132 fields->f_4u8 = value;
3134 case MEP_OPERAND_UIMM5 :
3135 fields->f_5u8 = value;
3137 case MEP_OPERAND_UIMM7A4 :
3138 fields->f_7u9a4 = value;
3140 case MEP_OPERAND_ZERO :
3144 /* xgettext:c-format */
3145 fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"),
3152 mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
3154 CGEN_FIELDS * fields,
3159 case MEP_OPERAND_ADDR24A4 :
3160 fields->f_24u8a4n = value;
3162 case MEP_OPERAND_C5RMUIMM20 :
3163 fields->f_c5_rmuimm20 = value;
3165 case MEP_OPERAND_C5RNMUIMM24 :
3166 fields->f_c5_rnmuimm24 = value;
3168 case MEP_OPERAND_CALLNUM :
3169 fields->f_callnum = value;
3171 case MEP_OPERAND_CCCC :
3172 fields->f_rm = value;
3174 case MEP_OPERAND_CCRN :
3175 fields->f_ccrn = value;
3177 case MEP_OPERAND_CDISP10 :
3178 fields->f_cdisp10 = value;
3180 case MEP_OPERAND_CDISP10A2 :
3181 fields->f_cdisp10 = value;
3183 case MEP_OPERAND_CDISP10A4 :
3184 fields->f_cdisp10 = value;
3186 case MEP_OPERAND_CDISP10A8 :
3187 fields->f_cdisp10 = value;
3189 case MEP_OPERAND_CDISP12 :
3190 fields->f_12s20 = value;
3192 case MEP_OPERAND_CIMM4 :
3193 fields->f_rn = value;
3195 case MEP_OPERAND_CIMM5 :
3196 fields->f_5u24 = value;
3198 case MEP_OPERAND_CODE16 :
3199 fields->f_16u16 = value;
3201 case MEP_OPERAND_CODE24 :
3202 fields->f_24u4n = value;
3204 case MEP_OPERAND_CP_FLAG :
3206 case MEP_OPERAND_CRN :
3207 fields->f_crn = value;
3209 case MEP_OPERAND_CRN64 :
3210 fields->f_crn = value;
3212 case MEP_OPERAND_CRNX :
3213 fields->f_crnx = value;
3215 case MEP_OPERAND_CRNX64 :
3216 fields->f_crnx = value;
3218 case MEP_OPERAND_CROC :
3219 fields->f_ivc2_5u7 = value;
3221 case MEP_OPERAND_CROP :
3222 fields->f_ivc2_5u23 = value;
3224 case MEP_OPERAND_CRPC :
3225 fields->f_ivc2_5u26 = value;
3227 case MEP_OPERAND_CRPP :
3228 fields->f_ivc2_5u18 = value;
3230 case MEP_OPERAND_CRQC :
3231 fields->f_ivc2_5u21 = value;
3233 case MEP_OPERAND_CRQP :
3234 fields->f_ivc2_5u13 = value;
3236 case MEP_OPERAND_CSRN :
3237 fields->f_csrn = value;
3239 case MEP_OPERAND_CSRN_IDX :
3240 fields->f_csrn = value;
3242 case MEP_OPERAND_DBG :
3244 case MEP_OPERAND_DEPC :
3246 case MEP_OPERAND_EPC :
3248 case MEP_OPERAND_EXC :
3250 case MEP_OPERAND_HI :
3252 case MEP_OPERAND_IMM16P0 :
3253 fields->f_ivc2_imm16p0 = value;
3255 case MEP_OPERAND_IMM3P12 :
3256 fields->f_ivc2_3u12 = value;
3258 case MEP_OPERAND_IMM3P25 :
3259 fields->f_ivc2_3u25 = value;
3261 case MEP_OPERAND_IMM3P4 :
3262 fields->f_ivc2_3u4 = value;
3264 case MEP_OPERAND_IMM3P5 :
3265 fields->f_ivc2_3u5 = value;
3267 case MEP_OPERAND_IMM3P9 :
3268 fields->f_ivc2_3u9 = value;
3270 case MEP_OPERAND_IMM4P10 :
3271 fields->f_ivc2_4u10 = value;
3273 case MEP_OPERAND_IMM4P4 :
3274 fields->f_ivc2_4u4 = value;
3276 case MEP_OPERAND_IMM4P8 :
3277 fields->f_ivc2_4u8 = value;
3279 case MEP_OPERAND_IMM5P23 :
3280 fields->f_ivc2_5u23 = value;
3282 case MEP_OPERAND_IMM5P3 :
3283 fields->f_ivc2_5u3 = value;
3285 case MEP_OPERAND_IMM5P7 :
3286 fields->f_ivc2_5u7 = value;
3288 case MEP_OPERAND_IMM5P8 :
3289 fields->f_ivc2_5u8 = value;
3291 case MEP_OPERAND_IMM6P2 :
3292 fields->f_ivc2_6u2 = value;
3294 case MEP_OPERAND_IMM6P6 :
3295 fields->f_ivc2_6u6 = value;
3297 case MEP_OPERAND_IMM8P0 :
3298 fields->f_ivc2_8u0 = value;
3300 case MEP_OPERAND_IMM8P20 :
3301 fields->f_ivc2_8u20 = value;
3303 case MEP_OPERAND_IMM8P4 :
3304 fields->f_ivc2_8u4 = value;
3306 case MEP_OPERAND_IVC_X_0_2 :
3307 fields->f_ivc2_2u0 = value;
3309 case MEP_OPERAND_IVC_X_0_3 :
3310 fields->f_ivc2_3u0 = value;
3312 case MEP_OPERAND_IVC_X_0_4 :
3313 fields->f_ivc2_4u0 = value;
3315 case MEP_OPERAND_IVC_X_0_5 :
3316 fields->f_ivc2_5u0 = value;
3318 case MEP_OPERAND_IVC_X_6_1 :
3319 fields->f_ivc2_1u6 = value;
3321 case MEP_OPERAND_IVC_X_6_2 :
3322 fields->f_ivc2_2u6 = value;
3324 case MEP_OPERAND_IVC_X_6_3 :
3325 fields->f_ivc2_3u6 = value;
3327 case MEP_OPERAND_IVC2_ACC0_0 :
3329 case MEP_OPERAND_IVC2_ACC0_1 :
3331 case MEP_OPERAND_IVC2_ACC0_2 :
3333 case MEP_OPERAND_IVC2_ACC0_3 :
3335 case MEP_OPERAND_IVC2_ACC0_4 :
3337 case MEP_OPERAND_IVC2_ACC0_5 :
3339 case MEP_OPERAND_IVC2_ACC0_6 :
3341 case MEP_OPERAND_IVC2_ACC0_7 :
3343 case MEP_OPERAND_IVC2_ACC1_0 :
3345 case MEP_OPERAND_IVC2_ACC1_1 :
3347 case MEP_OPERAND_IVC2_ACC1_2 :
3349 case MEP_OPERAND_IVC2_ACC1_3 :
3351 case MEP_OPERAND_IVC2_ACC1_4 :
3353 case MEP_OPERAND_IVC2_ACC1_5 :
3355 case MEP_OPERAND_IVC2_ACC1_6 :
3357 case MEP_OPERAND_IVC2_ACC1_7 :
3359 case MEP_OPERAND_IVC2_CC :
3361 case MEP_OPERAND_IVC2_COFA0 :
3363 case MEP_OPERAND_IVC2_COFA1 :
3365 case MEP_OPERAND_IVC2_COFR0 :
3367 case MEP_OPERAND_IVC2_COFR1 :
3369 case MEP_OPERAND_IVC2_CSAR0 :
3371 case MEP_OPERAND_IVC2_CSAR1 :
3373 case MEP_OPERAND_IVC2C3CCRN :
3374 fields->f_ivc2_ccrn_c3 = value;
3376 case MEP_OPERAND_IVC2CCRN :
3377 fields->f_ivc2_ccrn = value;
3379 case MEP_OPERAND_IVC2CRN :
3380 fields->f_ivc2_crnx = value;
3382 case MEP_OPERAND_IVC2RM :
3383 fields->f_ivc2_crm = value;
3385 case MEP_OPERAND_LO :
3387 case MEP_OPERAND_LP :
3389 case MEP_OPERAND_MB0 :
3391 case MEP_OPERAND_MB1 :
3393 case MEP_OPERAND_ME0 :
3395 case MEP_OPERAND_ME1 :
3397 case MEP_OPERAND_NPC :
3399 case MEP_OPERAND_OPT :
3401 case MEP_OPERAND_PCABS24A2 :
3402 fields->f_24u5a2n = value;
3404 case MEP_OPERAND_PCREL12A2 :
3405 fields->f_12s4a2 = value;
3407 case MEP_OPERAND_PCREL17A2 :
3408 fields->f_17s16a2 = value;
3410 case MEP_OPERAND_PCREL24A2 :
3411 fields->f_24s5a2n = value;
3413 case MEP_OPERAND_PCREL8A2 :
3414 fields->f_8s8a2 = value;
3416 case MEP_OPERAND_PSW :
3418 case MEP_OPERAND_R0 :
3420 case MEP_OPERAND_R1 :
3422 case MEP_OPERAND_RL :
3423 fields->f_rl = value;
3425 case MEP_OPERAND_RL5 :
3426 fields->f_rl5 = value;
3428 case MEP_OPERAND_RM :
3429 fields->f_rm = value;
3431 case MEP_OPERAND_RMA :
3432 fields->f_rm = value;
3434 case MEP_OPERAND_RN :
3435 fields->f_rn = value;
3437 case MEP_OPERAND_RN3 :
3438 fields->f_rn3 = value;
3440 case MEP_OPERAND_RN3C :
3441 fields->f_rn3 = value;
3443 case MEP_OPERAND_RN3L :
3444 fields->f_rn3 = value;
3446 case MEP_OPERAND_RN3S :
3447 fields->f_rn3 = value;
3449 case MEP_OPERAND_RN3UC :
3450 fields->f_rn3 = value;
3452 case MEP_OPERAND_RN3UL :
3453 fields->f_rn3 = value;
3455 case MEP_OPERAND_RN3US :
3456 fields->f_rn3 = value;
3458 case MEP_OPERAND_RNC :
3459 fields->f_rn = value;
3461 case MEP_OPERAND_RNL :
3462 fields->f_rn = value;
3464 case MEP_OPERAND_RNS :
3465 fields->f_rn = value;
3467 case MEP_OPERAND_RNUC :
3468 fields->f_rn = value;
3470 case MEP_OPERAND_RNUL :
3471 fields->f_rn = value;
3473 case MEP_OPERAND_RNUS :
3474 fields->f_rn = value;
3476 case MEP_OPERAND_SAR :
3478 case MEP_OPERAND_SDISP16 :
3479 fields->f_16s16 = value;
3481 case MEP_OPERAND_SIMM16 :
3482 fields->f_16s16 = value;
3484 case MEP_OPERAND_SIMM16P0 :
3485 fields->f_ivc2_simm16p0 = value;
3487 case MEP_OPERAND_SIMM6 :
3488 fields->f_6s8 = value;
3490 case MEP_OPERAND_SIMM8 :
3491 fields->f_8s8 = value;
3493 case MEP_OPERAND_SIMM8P0 :
3494 fields->f_ivc2_8s0 = value;
3496 case MEP_OPERAND_SIMM8P20 :
3497 fields->f_ivc2_8s20 = value;
3499 case MEP_OPERAND_SIMM8P4 :
3500 fields->f_ivc2_8s4 = value;
3502 case MEP_OPERAND_SP :
3504 case MEP_OPERAND_SPR :
3506 case MEP_OPERAND_TP :
3508 case MEP_OPERAND_TPR :
3510 case MEP_OPERAND_UDISP2 :
3511 fields->f_2u6 = value;
3513 case MEP_OPERAND_UDISP7 :
3514 fields->f_7u9 = value;
3516 case MEP_OPERAND_UDISP7A2 :
3517 fields->f_7u9a2 = value;
3519 case MEP_OPERAND_UDISP7A4 :
3520 fields->f_7u9a4 = value;
3522 case MEP_OPERAND_UIMM16 :
3523 fields->f_16u16 = value;
3525 case MEP_OPERAND_UIMM2 :
3526 fields->f_2u10 = value;
3528 case MEP_OPERAND_UIMM24 :
3529 fields->f_24u8n = value;
3531 case MEP_OPERAND_UIMM3 :
3532 fields->f_3u5 = value;
3534 case MEP_OPERAND_UIMM4 :
3535 fields->f_4u8 = value;
3537 case MEP_OPERAND_UIMM5 :
3538 fields->f_5u8 = value;
3540 case MEP_OPERAND_UIMM7A4 :
3541 fields->f_7u9a4 = value;
3543 case MEP_OPERAND_ZERO :
3547 /* xgettext:c-format */
3548 fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"),
3554 /* Function to call before using the instruction builder tables. */
3557 mep_cgen_init_ibld_table (CGEN_CPU_DESC cd)
3559 cd->insert_handlers = & mep_cgen_insert_handlers[0];
3560 cd->extract_handlers = & mep_cgen_extract_handlers[0];
3562 cd->insert_operand = mep_cgen_insert_operand;
3563 cd->extract_operand = mep_cgen_extract_operand;
3565 cd->get_int_operand = mep_cgen_get_int_operand;
3566 cd->set_int_operand = mep_cgen_set_int_operand;
3567 cd->get_vma_operand = mep_cgen_get_vma_operand;
3568 cd->set_vma_operand = mep_cgen_set_vma_operand;