1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 /* Instruction building/extraction support for mep. -*- C -*-
4 THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
5 - the resultant file is machine generated, cgen-ibld.in isn't
7 Copyright (C) 1996-2018 Free Software Foundation, Inc.
9 This file is part of libopcodes.
11 This library is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
16 It is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
25 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
36 #include "cgen/basic-modes.h"
38 #include "safe-ctype.h"
41 #define min(a,b) ((a) < (b) ? (a) : (b))
43 #define max(a,b) ((a) > (b) ? (a) : (b))
45 /* Used by the ifield rtx function. */
46 #define FLD(f) (fields->f)
48 static const char * insert_normal
49 (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
50 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
51 static const char * insert_insn_normal
52 (CGEN_CPU_DESC, const CGEN_INSN *,
53 CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
54 static int extract_normal
55 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
56 unsigned int, unsigned int, unsigned int, unsigned int,
57 unsigned int, unsigned int, bfd_vma, long *);
58 static int extract_insn_normal
59 (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
60 CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
62 static void put_insn_int_value
63 (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
66 static CGEN_INLINE void insert_1
67 (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
68 static CGEN_INLINE int fill_cache
69 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
70 static CGEN_INLINE long extract_1
71 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
74 /* Operand insertion. */
78 /* Subroutine of insert_normal. */
80 static CGEN_INLINE void
81 insert_1 (CGEN_CPU_DESC cd,
91 x = cgen_get_insn_value (cd, bufp, word_length);
93 /* Written this way to avoid undefined behaviour. */
94 mask = (((1L << (length - 1)) - 1) << 1) | 1;
96 shift = (start + 1) - length;
98 shift = (word_length - (start + length));
99 x = (x & ~(mask << shift)) | ((value & mask) << shift);
101 cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
104 #endif /* ! CGEN_INT_INSN_P */
106 /* Default insertion routine.
108 ATTRS is a mask of the boolean attributes.
109 WORD_OFFSET is the offset in bits from the start of the insn of the value.
110 WORD_LENGTH is the length of the word in bits in which the value resides.
111 START is the starting bit number in the word, architecture origin.
112 LENGTH is the length of VALUE in bits.
113 TOTAL_LENGTH is the total length of the insn in bits.
115 The result is an error message or NULL if success. */
117 /* ??? This duplicates functionality with bfd's howto table and
118 bfd_install_relocation. */
119 /* ??? This doesn't handle bfd_vma's. Create another function when
123 insert_normal (CGEN_CPU_DESC cd,
126 unsigned int word_offset,
129 unsigned int word_length,
130 unsigned int total_length,
131 CGEN_INSN_BYTES_PTR buffer)
133 static char errbuf[100];
134 /* Written this way to avoid undefined behaviour. */
135 unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1;
137 /* If LENGTH is zero, this operand doesn't contribute to the value. */
141 if (word_length > 8 * sizeof (CGEN_INSN_INT))
144 /* For architectures with insns smaller than the base-insn-bitsize,
145 word_length may be too big. */
146 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
149 && word_length > total_length)
150 word_length = total_length;
153 /* Ensure VALUE will fit. */
154 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
156 long minval = - (1L << (length - 1));
157 unsigned long maxval = mask;
159 if ((value > 0 && (unsigned long) value > maxval)
162 /* xgettext:c-format */
164 _("operand out of range (%ld not between %ld and %lu)"),
165 value, minval, maxval);
169 else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
171 unsigned long maxval = mask;
172 unsigned long val = (unsigned long) value;
174 /* For hosts with a word size > 32 check to see if value has been sign
175 extended beyond 32 bits. If so then ignore these higher sign bits
176 as the user is attempting to store a 32-bit signed value into an
177 unsigned 32-bit field which is allowed. */
178 if (sizeof (unsigned long) > 4 && ((value >> 32) == -1))
183 /* xgettext:c-format */
185 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
192 if (! cgen_signed_overflow_ok_p (cd))
194 long minval = - (1L << (length - 1));
195 long maxval = (1L << (length - 1)) - 1;
197 if (value < minval || value > maxval)
200 /* xgettext:c-format */
201 (errbuf, _("operand out of range (%ld not between %ld and %ld)"),
202 value, minval, maxval);
211 int shift_within_word, shift_to_word, shift;
213 /* How to shift the value to BIT0 of the word. */
214 shift_to_word = total_length - (word_offset + word_length);
216 /* How to shift the value to the field within the word. */
217 if (CGEN_INSN_LSB0_P)
218 shift_within_word = start + 1 - length;
220 shift_within_word = word_length - start - length;
222 /* The total SHIFT, then mask in the value. */
223 shift = shift_to_word + shift_within_word;
224 *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift);
227 #else /* ! CGEN_INT_INSN_P */
230 unsigned char *bufp = (unsigned char *) buffer + word_offset / 8;
232 insert_1 (cd, value, start, length, word_length, bufp);
235 #endif /* ! CGEN_INT_INSN_P */
240 /* Default insn builder (insert handler).
241 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
242 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
243 recorded in host byte order, otherwise BUFFER is an array of bytes
244 and the value is recorded in target byte order).
245 The result is an error message or NULL if success. */
248 insert_insn_normal (CGEN_CPU_DESC cd,
249 const CGEN_INSN * insn,
250 CGEN_FIELDS * fields,
251 CGEN_INSN_BYTES_PTR buffer,
254 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
256 const CGEN_SYNTAX_CHAR_TYPE * syn;
258 CGEN_INIT_INSERT (cd);
259 value = CGEN_INSN_BASE_VALUE (insn);
261 /* If we're recording insns as numbers (rather than a string of bytes),
262 target byte order handling is deferred until later. */
266 put_insn_int_value (cd, buffer, cd->base_insn_bitsize,
267 CGEN_FIELDS_BITSIZE (fields), value);
271 cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
272 (unsigned) CGEN_FIELDS_BITSIZE (fields)),
275 #endif /* ! CGEN_INT_INSN_P */
277 /* ??? It would be better to scan the format's fields.
278 Still need to be able to insert a value based on the operand though;
279 e.g. storing a branch displacement that got resolved later.
280 Needs more thought first. */
282 for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn)
286 if (CGEN_SYNTAX_CHAR_P (* syn))
289 errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
299 /* Cover function to store an insn value into an integral insn. Must go here
300 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
303 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
304 CGEN_INSN_BYTES_PTR buf,
309 /* For architectures with insns smaller than the base-insn-bitsize,
310 length may be too big. */
311 if (length > insn_length)
315 int shift = insn_length - length;
316 /* Written this way to avoid undefined behaviour. */
317 CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1;
319 *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
324 /* Operand extraction. */
326 #if ! CGEN_INT_INSN_P
328 /* Subroutine of extract_normal.
329 Ensure sufficient bytes are cached in EX_INFO.
330 OFFSET is the offset in bytes from the start of the insn of the value.
331 BYTES is the length of the needed value.
332 Returns 1 for success, 0 for failure. */
334 static CGEN_INLINE int
335 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
336 CGEN_EXTRACT_INFO *ex_info,
341 /* It's doubtful that the middle part has already been fetched so
342 we don't optimize that case. kiss. */
344 disassemble_info *info = (disassemble_info *) ex_info->dis_info;
346 /* First do a quick check. */
347 mask = (1 << bytes) - 1;
348 if (((ex_info->valid >> offset) & mask) == mask)
351 /* Search for the first byte we need to read. */
352 for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1)
353 if (! (mask & ex_info->valid))
361 status = (*info->read_memory_func)
362 (pc, ex_info->insn_bytes + offset, bytes, info);
366 (*info->memory_error_func) (status, pc, info);
370 ex_info->valid |= ((1 << bytes) - 1) << offset;
376 /* Subroutine of extract_normal. */
378 static CGEN_INLINE long
379 extract_1 (CGEN_CPU_DESC cd,
380 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
385 bfd_vma pc ATTRIBUTE_UNUSED)
390 x = cgen_get_insn_value (cd, bufp, word_length);
392 if (CGEN_INSN_LSB0_P)
393 shift = (start + 1) - length;
395 shift = (word_length - (start + length));
399 #endif /* ! CGEN_INT_INSN_P */
401 /* Default extraction routine.
403 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
404 or sometimes less for cases like the m32r where the base insn size is 32
405 but some insns are 16 bits.
406 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
407 but for generality we take a bitmask of all of them.
408 WORD_OFFSET is the offset in bits from the start of the insn of the value.
409 WORD_LENGTH is the length of the word in bits in which the value resides.
410 START is the starting bit number in the word, architecture origin.
411 LENGTH is the length of VALUE in bits.
412 TOTAL_LENGTH is the total length of the insn in bits.
414 Returns 1 for success, 0 for failure. */
416 /* ??? The return code isn't properly used. wip. */
418 /* ??? This doesn't handle bfd_vma's. Create another function when
422 extract_normal (CGEN_CPU_DESC cd,
423 #if ! CGEN_INT_INSN_P
424 CGEN_EXTRACT_INFO *ex_info,
426 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
428 CGEN_INSN_INT insn_value,
430 unsigned int word_offset,
433 unsigned int word_length,
434 unsigned int total_length,
435 #if ! CGEN_INT_INSN_P
438 bfd_vma pc ATTRIBUTE_UNUSED,
444 /* If LENGTH is zero, this operand doesn't contribute to the value
445 so give it a standard value of zero. */
452 if (word_length > 8 * sizeof (CGEN_INSN_INT))
455 /* For architectures with insns smaller than the insn-base-bitsize,
456 word_length may be too big. */
457 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
459 if (word_offset + word_length > total_length)
460 word_length = total_length - word_offset;
463 /* Does the value reside in INSN_VALUE, and at the right alignment? */
465 if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length))
467 if (CGEN_INSN_LSB0_P)
468 value = insn_value >> ((word_offset + start + 1) - length);
470 value = insn_value >> (total_length - ( word_offset + start + length));
473 #if ! CGEN_INT_INSN_P
477 unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
479 if (word_length > 8 * sizeof (CGEN_INSN_INT))
482 if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
485 value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc);
488 #endif /* ! CGEN_INT_INSN_P */
490 /* Written this way to avoid undefined behaviour. */
491 mask = (((1L << (length - 1)) - 1) << 1) | 1;
495 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
496 && (value & (1L << (length - 1))))
504 /* Default insn extractor.
506 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
507 The extracted fields are stored in FIELDS.
508 EX_INFO is used to handle reading variable length insns.
509 Return the length of the insn in bits, or 0 if no match,
510 or -1 if an error occurs fetching data (memory_error_func will have
514 extract_insn_normal (CGEN_CPU_DESC cd,
515 const CGEN_INSN *insn,
516 CGEN_EXTRACT_INFO *ex_info,
517 CGEN_INSN_INT insn_value,
521 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
522 const CGEN_SYNTAX_CHAR_TYPE *syn;
524 CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn);
526 CGEN_INIT_EXTRACT (cd);
528 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
532 if (CGEN_SYNTAX_CHAR_P (*syn))
535 length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
536 ex_info, insn_value, fields, pc);
541 /* We recognized and successfully extracted this insn. */
542 return CGEN_INSN_BITSIZE (insn);
545 /* Machine generated code added here. */
547 const char * mep_cgen_insert_operand
548 (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
550 /* Main entry point for operand insertion.
552 This function is basically just a big switch statement. Earlier versions
553 used tables to look up the function to use, but
554 - if the table contains both assembler and disassembler functions then
555 the disassembler contains much of the assembler and vice-versa,
556 - there's a lot of inlining possibilities as things grow,
557 - using a switch statement avoids the function call overhead.
559 This function could be moved into `parse_insn_normal', but keeping it
560 separate makes clear the interface between `parse_insn_normal' and each of
561 the handlers. It's also needed by GAS to insert operands that couldn't be
562 resolved during parsing. */
565 mep_cgen_insert_operand (CGEN_CPU_DESC cd,
567 CGEN_FIELDS * fields,
568 CGEN_INSN_BYTES_PTR buffer,
569 bfd_vma pc ATTRIBUTE_UNUSED)
571 const char * errmsg = NULL;
572 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
576 case MEP_OPERAND_ADDR24A4 :
579 FLD (f_24u8a4n_hi) = ((UINT) (FLD (f_24u8a4n)) >> (8));
580 FLD (f_24u8a4n_lo) = ((UINT) (((FLD (f_24u8a4n)) & (252))) >> (2));
582 errmsg = insert_normal (cd, fields->f_24u8a4n_hi, 0, 0, 16, 16, 32, total_length, buffer);
585 errmsg = insert_normal (cd, fields->f_24u8a4n_lo, 0, 0, 8, 6, 32, total_length, buffer);
590 case MEP_OPERAND_C5RMUIMM20 :
593 FLD (f_c5_rm) = ((UINT) (FLD (f_c5_rmuimm20)) >> (16));
594 FLD (f_c5_16u16) = ((FLD (f_c5_rmuimm20)) & (65535));
596 errmsg = insert_normal (cd, fields->f_c5_rm, 0, 0, 8, 4, 32, total_length, buffer);
599 errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer);
604 case MEP_OPERAND_C5RNMUIMM24 :
607 FLD (f_c5_rnm) = ((UINT) (FLD (f_c5_rnmuimm24)) >> (16));
608 FLD (f_c5_16u16) = ((FLD (f_c5_rnmuimm24)) & (65535));
610 errmsg = insert_normal (cd, fields->f_c5_rnm, 0, 0, 4, 8, 32, total_length, buffer);
613 errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer);
618 case MEP_OPERAND_CALLNUM :
621 FLD (f_5) = ((((UINT) (FLD (f_callnum)) >> (3))) & (1));
622 FLD (f_6) = ((((UINT) (FLD (f_callnum)) >> (2))) & (1));
623 FLD (f_7) = ((((UINT) (FLD (f_callnum)) >> (1))) & (1));
624 FLD (f_11) = ((FLD (f_callnum)) & (1));
626 errmsg = insert_normal (cd, fields->f_5, 0, 0, 5, 1, 32, total_length, buffer);
629 errmsg = insert_normal (cd, fields->f_6, 0, 0, 6, 1, 32, total_length, buffer);
632 errmsg = insert_normal (cd, fields->f_7, 0, 0, 7, 1, 32, total_length, buffer);
635 errmsg = insert_normal (cd, fields->f_11, 0, 0, 11, 1, 32, total_length, buffer);
640 case MEP_OPERAND_CCCC :
641 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
643 case MEP_OPERAND_CCRN :
646 FLD (f_ccrn_hi) = ((((UINT) (FLD (f_ccrn)) >> (4))) & (3));
647 FLD (f_ccrn_lo) = ((FLD (f_ccrn)) & (15));
649 errmsg = insert_normal (cd, fields->f_ccrn_hi, 0, 0, 28, 2, 32, total_length, buffer);
652 errmsg = insert_normal (cd, fields->f_ccrn_lo, 0, 0, 4, 4, 32, total_length, buffer);
657 case MEP_OPERAND_CDISP10 :
659 long value = fields->f_cdisp10;
660 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)));
661 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
664 case MEP_OPERAND_CDISP10A2 :
666 long value = fields->f_cdisp10;
667 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)));
668 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
671 case MEP_OPERAND_CDISP10A4 :
673 long value = fields->f_cdisp10;
674 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)));
675 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
678 case MEP_OPERAND_CDISP10A8 :
680 long value = fields->f_cdisp10;
681 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)));
682 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, buffer);
685 case MEP_OPERAND_CDISP12 :
686 errmsg = insert_normal (cd, fields->f_12s20, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 12, 32, total_length, buffer);
688 case MEP_OPERAND_CIMM4 :
689 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
691 case MEP_OPERAND_CIMM5 :
692 errmsg = insert_normal (cd, fields->f_5u24, 0, 0, 24, 5, 32, total_length, buffer);
694 case MEP_OPERAND_CODE16 :
695 errmsg = insert_normal (cd, fields->f_16u16, 0, 0, 16, 16, 32, total_length, buffer);
697 case MEP_OPERAND_CODE24 :
700 FLD (f_24u4n_hi) = ((UINT) (FLD (f_24u4n)) >> (16));
701 FLD (f_24u4n_lo) = ((FLD (f_24u4n)) & (65535));
703 errmsg = insert_normal (cd, fields->f_24u4n_hi, 0, 0, 4, 8, 32, total_length, buffer);
706 errmsg = insert_normal (cd, fields->f_24u4n_lo, 0, 0, 16, 16, 32, total_length, buffer);
711 case MEP_OPERAND_CP_FLAG :
713 case MEP_OPERAND_CRN :
714 errmsg = insert_normal (cd, fields->f_crn, 0, 0, 4, 4, 32, total_length, buffer);
716 case MEP_OPERAND_CRN64 :
717 errmsg = insert_normal (cd, fields->f_crn, 0, 0, 4, 4, 32, total_length, buffer);
719 case MEP_OPERAND_CRNX :
722 FLD (f_crnx_lo) = ((FLD (f_crnx)) & (15));
723 FLD (f_crnx_hi) = ((UINT) (FLD (f_crnx)) >> (4));
725 errmsg = insert_normal (cd, fields->f_crnx_hi, 0, 0, 28, 1, 32, total_length, buffer);
728 errmsg = insert_normal (cd, fields->f_crnx_lo, 0, 0, 4, 4, 32, total_length, buffer);
733 case MEP_OPERAND_CRNX64 :
736 FLD (f_crnx_lo) = ((FLD (f_crnx)) & (15));
737 FLD (f_crnx_hi) = ((UINT) (FLD (f_crnx)) >> (4));
739 errmsg = insert_normal (cd, fields->f_crnx_hi, 0, 0, 28, 1, 32, total_length, buffer);
742 errmsg = insert_normal (cd, fields->f_crnx_lo, 0, 0, 4, 4, 32, total_length, buffer);
747 case MEP_OPERAND_CROC :
748 errmsg = insert_normal (cd, fields->f_ivc2_5u7, 0, 0, 7, 5, 32, total_length, buffer);
750 case MEP_OPERAND_CROP :
751 errmsg = insert_normal (cd, fields->f_ivc2_5u23, 0, 0, 23, 5, 32, total_length, buffer);
753 case MEP_OPERAND_CRPC :
754 errmsg = insert_normal (cd, fields->f_ivc2_5u26, 0, 0, 26, 5, 32, total_length, buffer);
756 case MEP_OPERAND_CRPP :
757 errmsg = insert_normal (cd, fields->f_ivc2_5u18, 0, 0, 18, 5, 32, total_length, buffer);
759 case MEP_OPERAND_CRQC :
760 errmsg = insert_normal (cd, fields->f_ivc2_5u21, 0, 0, 21, 5, 32, total_length, buffer);
762 case MEP_OPERAND_CRQP :
763 errmsg = insert_normal (cd, fields->f_ivc2_5u13, 0, 0, 13, 5, 32, total_length, buffer);
765 case MEP_OPERAND_CSRN :
768 FLD (f_csrn_lo) = ((FLD (f_csrn)) & (15));
769 FLD (f_csrn_hi) = ((UINT) (FLD (f_csrn)) >> (4));
771 errmsg = insert_normal (cd, fields->f_csrn_hi, 0, 0, 15, 1, 32, total_length, buffer);
774 errmsg = insert_normal (cd, fields->f_csrn_lo, 0, 0, 8, 4, 32, total_length, buffer);
779 case MEP_OPERAND_CSRN_IDX :
782 FLD (f_csrn_lo) = ((FLD (f_csrn)) & (15));
783 FLD (f_csrn_hi) = ((UINT) (FLD (f_csrn)) >> (4));
785 errmsg = insert_normal (cd, fields->f_csrn_hi, 0, 0, 15, 1, 32, total_length, buffer);
788 errmsg = insert_normal (cd, fields->f_csrn_lo, 0, 0, 8, 4, 32, total_length, buffer);
793 case MEP_OPERAND_DBG :
795 case MEP_OPERAND_DEPC :
797 case MEP_OPERAND_EPC :
799 case MEP_OPERAND_EXC :
801 case MEP_OPERAND_HI :
803 case MEP_OPERAND_IMM16P0 :
806 FLD (f_ivc2_8u0) = ((((UINT) (FLD (f_ivc2_imm16p0)) >> (8))) & (255));
807 FLD (f_ivc2_8u20) = ((FLD (f_ivc2_imm16p0)) & (255));
809 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
812 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
817 case MEP_OPERAND_IMM3P12 :
818 errmsg = insert_normal (cd, fields->f_ivc2_3u12, 0, 0, 12, 3, 32, total_length, buffer);
820 case MEP_OPERAND_IMM3P25 :
821 errmsg = insert_normal (cd, fields->f_ivc2_3u25, 0, 0, 25, 3, 32, total_length, buffer);
823 case MEP_OPERAND_IMM3P4 :
824 errmsg = insert_normal (cd, fields->f_ivc2_3u4, 0, 0, 4, 3, 32, total_length, buffer);
826 case MEP_OPERAND_IMM3P5 :
827 errmsg = insert_normal (cd, fields->f_ivc2_3u5, 0, 0, 5, 3, 32, total_length, buffer);
829 case MEP_OPERAND_IMM3P9 :
830 errmsg = insert_normal (cd, fields->f_ivc2_3u9, 0, 0, 9, 3, 32, total_length, buffer);
832 case MEP_OPERAND_IMM4P10 :
833 errmsg = insert_normal (cd, fields->f_ivc2_4u10, 0, 0, 10, 4, 32, total_length, buffer);
835 case MEP_OPERAND_IMM4P4 :
836 errmsg = insert_normal (cd, fields->f_ivc2_4u4, 0, 0, 4, 4, 32, total_length, buffer);
838 case MEP_OPERAND_IMM4P8 :
839 errmsg = insert_normal (cd, fields->f_ivc2_4u8, 0, 0, 8, 4, 32, total_length, buffer);
841 case MEP_OPERAND_IMM5P23 :
842 errmsg = insert_normal (cd, fields->f_ivc2_5u23, 0, 0, 23, 5, 32, total_length, buffer);
844 case MEP_OPERAND_IMM5P3 :
845 errmsg = insert_normal (cd, fields->f_ivc2_5u3, 0, 0, 3, 5, 32, total_length, buffer);
847 case MEP_OPERAND_IMM5P7 :
848 errmsg = insert_normal (cd, fields->f_ivc2_5u7, 0, 0, 7, 5, 32, total_length, buffer);
850 case MEP_OPERAND_IMM5P8 :
851 errmsg = insert_normal (cd, fields->f_ivc2_5u8, 0, 0, 8, 5, 32, total_length, buffer);
853 case MEP_OPERAND_IMM6P2 :
854 errmsg = insert_normal (cd, fields->f_ivc2_6u2, 0, 0, 2, 6, 32, total_length, buffer);
856 case MEP_OPERAND_IMM6P6 :
857 errmsg = insert_normal (cd, fields->f_ivc2_6u6, 0, 0, 6, 6, 32, total_length, buffer);
859 case MEP_OPERAND_IMM8P0 :
860 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
862 case MEP_OPERAND_IMM8P20 :
863 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
865 case MEP_OPERAND_IMM8P4 :
866 errmsg = insert_normal (cd, fields->f_ivc2_8u4, 0, 0, 4, 8, 32, total_length, buffer);
868 case MEP_OPERAND_IVC_X_0_2 :
869 errmsg = insert_normal (cd, fields->f_ivc2_2u0, 0, 0, 0, 2, 32, total_length, buffer);
871 case MEP_OPERAND_IVC_X_0_3 :
872 errmsg = insert_normal (cd, fields->f_ivc2_3u0, 0, 0, 0, 3, 32, total_length, buffer);
874 case MEP_OPERAND_IVC_X_0_4 :
875 errmsg = insert_normal (cd, fields->f_ivc2_4u0, 0, 0, 0, 4, 32, total_length, buffer);
877 case MEP_OPERAND_IVC_X_0_5 :
878 errmsg = insert_normal (cd, fields->f_ivc2_5u0, 0, 0, 0, 5, 32, total_length, buffer);
880 case MEP_OPERAND_IVC_X_6_1 :
881 errmsg = insert_normal (cd, fields->f_ivc2_1u6, 0, 0, 6, 1, 32, total_length, buffer);
883 case MEP_OPERAND_IVC_X_6_2 :
884 errmsg = insert_normal (cd, fields->f_ivc2_2u6, 0, 0, 6, 2, 32, total_length, buffer);
886 case MEP_OPERAND_IVC_X_6_3 :
887 errmsg = insert_normal (cd, fields->f_ivc2_3u6, 0, 0, 6, 3, 32, total_length, buffer);
889 case MEP_OPERAND_IVC2_ACC0_0 :
891 case MEP_OPERAND_IVC2_ACC0_1 :
893 case MEP_OPERAND_IVC2_ACC0_2 :
895 case MEP_OPERAND_IVC2_ACC0_3 :
897 case MEP_OPERAND_IVC2_ACC0_4 :
899 case MEP_OPERAND_IVC2_ACC0_5 :
901 case MEP_OPERAND_IVC2_ACC0_6 :
903 case MEP_OPERAND_IVC2_ACC0_7 :
905 case MEP_OPERAND_IVC2_ACC1_0 :
907 case MEP_OPERAND_IVC2_ACC1_1 :
909 case MEP_OPERAND_IVC2_ACC1_2 :
911 case MEP_OPERAND_IVC2_ACC1_3 :
913 case MEP_OPERAND_IVC2_ACC1_4 :
915 case MEP_OPERAND_IVC2_ACC1_5 :
917 case MEP_OPERAND_IVC2_ACC1_6 :
919 case MEP_OPERAND_IVC2_ACC1_7 :
921 case MEP_OPERAND_IVC2_CC :
923 case MEP_OPERAND_IVC2_COFA0 :
925 case MEP_OPERAND_IVC2_COFA1 :
927 case MEP_OPERAND_IVC2_COFR0 :
929 case MEP_OPERAND_IVC2_COFR1 :
931 case MEP_OPERAND_IVC2_CSAR0 :
933 case MEP_OPERAND_IVC2_CSAR1 :
935 case MEP_OPERAND_IVC2C3CCRN :
938 FLD (f_ivc2_ccrn_c3hi) = ((((UINT) (FLD (f_ivc2_ccrn_c3)) >> (4))) & (3));
939 FLD (f_ivc2_ccrn_c3lo) = ((FLD (f_ivc2_ccrn_c3)) & (15));
941 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_c3hi, 0, 0, 28, 2, 32, total_length, buffer);
944 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_c3lo, 0, 0, 4, 4, 32, total_length, buffer);
949 case MEP_OPERAND_IVC2CCRN :
952 FLD (f_ivc2_ccrn_h2) = ((((UINT) (FLD (f_ivc2_ccrn)) >> (4))) & (3));
953 FLD (f_ivc2_ccrn_lo) = ((FLD (f_ivc2_ccrn)) & (15));
955 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_h2, 0, 0, 20, 2, 32, total_length, buffer);
958 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_lo, 0, 0, 0, 4, 32, total_length, buffer);
963 case MEP_OPERAND_IVC2CRN :
966 FLD (f_ivc2_ccrn_h1) = ((((UINT) (FLD (f_ivc2_crnx)) >> (4))) & (1));
967 FLD (f_ivc2_ccrn_lo) = ((FLD (f_ivc2_crnx)) & (15));
969 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_h1, 0, 0, 20, 1, 32, total_length, buffer);
972 errmsg = insert_normal (cd, fields->f_ivc2_ccrn_lo, 0, 0, 0, 4, 32, total_length, buffer);
977 case MEP_OPERAND_IVC2RM :
978 errmsg = insert_normal (cd, fields->f_ivc2_crm, 0, 0, 4, 4, 32, total_length, buffer);
980 case MEP_OPERAND_LO :
982 case MEP_OPERAND_LP :
984 case MEP_OPERAND_MB0 :
986 case MEP_OPERAND_MB1 :
988 case MEP_OPERAND_ME0 :
990 case MEP_OPERAND_ME1 :
992 case MEP_OPERAND_NPC :
994 case MEP_OPERAND_OPT :
996 case MEP_OPERAND_PCABS24A2 :
999 FLD (f_24u5a2n_lo) = ((UINT) (((FLD (f_24u5a2n)) & (255))) >> (1));
1000 FLD (f_24u5a2n_hi) = ((UINT) (FLD (f_24u5a2n)) >> (8));
1002 errmsg = insert_normal (cd, fields->f_24u5a2n_hi, 0, 0, 16, 16, 32, total_length, buffer);
1005 errmsg = insert_normal (cd, fields->f_24u5a2n_lo, 0, 0, 5, 7, 32, total_length, buffer);
1010 case MEP_OPERAND_PCREL12A2 :
1012 long value = fields->f_12s4a2;
1013 value = ((SI) (((value) - (pc))) >> (1));
1014 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 4, 11, 32, total_length, buffer);
1017 case MEP_OPERAND_PCREL17A2 :
1019 long value = fields->f_17s16a2;
1020 value = ((SI) (((value) - (pc))) >> (1));
1021 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 16, 16, 32, total_length, buffer);
1024 case MEP_OPERAND_PCREL24A2 :
1027 FLD (f_24s5a2n) = ((FLD (f_24s5a2n)) - (pc));
1028 FLD (f_24s5a2n_lo) = ((UINT) (((FLD (f_24s5a2n)) & (254))) >> (1));
1029 FLD (f_24s5a2n_hi) = ((INT) (FLD (f_24s5a2n)) >> (8));
1031 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);
1034 errmsg = insert_normal (cd, fields->f_24s5a2n_lo, 0|(1<<CGEN_IFLD_PCREL_ADDR), 0, 5, 7, 32, total_length, buffer);
1039 case MEP_OPERAND_PCREL8A2 :
1041 long value = fields->f_8s8a2;
1042 value = ((SI) (((value) - (pc))) >> (1));
1043 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 8, 7, 32, total_length, buffer);
1046 case MEP_OPERAND_PSW :
1048 case MEP_OPERAND_R0 :
1050 case MEP_OPERAND_R1 :
1052 case MEP_OPERAND_RL :
1053 errmsg = insert_normal (cd, fields->f_rl, 0, 0, 12, 4, 32, total_length, buffer);
1055 case MEP_OPERAND_RL5 :
1056 errmsg = insert_normal (cd, fields->f_rl5, 0, 0, 20, 4, 32, total_length, buffer);
1058 case MEP_OPERAND_RM :
1059 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
1061 case MEP_OPERAND_RMA :
1062 errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer);
1064 case MEP_OPERAND_RN :
1065 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1067 case MEP_OPERAND_RN3 :
1068 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1070 case MEP_OPERAND_RN3C :
1071 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1073 case MEP_OPERAND_RN3L :
1074 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1076 case MEP_OPERAND_RN3S :
1077 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1079 case MEP_OPERAND_RN3UC :
1080 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1082 case MEP_OPERAND_RN3UL :
1083 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1085 case MEP_OPERAND_RN3US :
1086 errmsg = insert_normal (cd, fields->f_rn3, 0, 0, 5, 3, 32, total_length, buffer);
1088 case MEP_OPERAND_RNC :
1089 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1091 case MEP_OPERAND_RNL :
1092 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1094 case MEP_OPERAND_RNS :
1095 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1097 case MEP_OPERAND_RNUC :
1098 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1100 case MEP_OPERAND_RNUL :
1101 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1103 case MEP_OPERAND_RNUS :
1104 errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer);
1106 case MEP_OPERAND_SAR :
1108 case MEP_OPERAND_SDISP16 :
1109 errmsg = insert_normal (cd, fields->f_16s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
1111 case MEP_OPERAND_SIMM16 :
1112 errmsg = insert_normal (cd, fields->f_16s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, buffer);
1114 case MEP_OPERAND_SIMM16P0 :
1117 FLD (f_ivc2_8u0) = ((((UINT) (FLD (f_ivc2_simm16p0)) >> (8))) & (255));
1118 FLD (f_ivc2_8u20) = ((FLD (f_ivc2_simm16p0)) & (255));
1120 errmsg = insert_normal (cd, fields->f_ivc2_8u0, 0, 0, 0, 8, 32, total_length, buffer);
1123 errmsg = insert_normal (cd, fields->f_ivc2_8u20, 0, 0, 20, 8, 32, total_length, buffer);
1128 case MEP_OPERAND_SIMM6 :
1129 errmsg = insert_normal (cd, fields->f_6s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 6, 32, total_length, buffer);
1131 case MEP_OPERAND_SIMM8 :
1132 errmsg = insert_normal (cd, fields->f_8s8, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, buffer);
1134 case MEP_OPERAND_SIMM8P0 :
1135 errmsg = insert_normal (cd, fields->f_ivc2_8s0, 0|(1<<CGEN_IFLD_SIGNED), 0, 0, 8, 32, total_length, buffer);
1137 case MEP_OPERAND_SIMM8P20 :
1138 errmsg = insert_normal (cd, fields->f_ivc2_8s20, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 8, 32, total_length, buffer);
1140 case MEP_OPERAND_SIMM8P4 :
1141 errmsg = insert_normal (cd, fields->f_ivc2_8s4, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 32, total_length, buffer);
1143 case MEP_OPERAND_SP :
1145 case MEP_OPERAND_SPR :
1147 case MEP_OPERAND_TP :
1149 case MEP_OPERAND_TPR :
1151 case MEP_OPERAND_UDISP2 :
1152 errmsg = insert_normal (cd, fields->f_2u6, 0, 0, 6, 2, 32, total_length, buffer);
1154 case MEP_OPERAND_UDISP7 :
1155 errmsg = insert_normal (cd, fields->f_7u9, 0, 0, 9, 7, 32, total_length, buffer);
1157 case MEP_OPERAND_UDISP7A2 :
1159 long value = fields->f_7u9a2;
1160 value = ((USI) (value) >> (1));
1161 errmsg = insert_normal (cd, value, 0, 0, 9, 6, 32, total_length, buffer);
1164 case MEP_OPERAND_UDISP7A4 :
1166 long value = fields->f_7u9a4;
1167 value = ((USI) (value) >> (2));
1168 errmsg = insert_normal (cd, value, 0, 0, 9, 5, 32, total_length, buffer);
1171 case MEP_OPERAND_UIMM16 :
1172 errmsg = insert_normal (cd, fields->f_16u16, 0, 0, 16, 16, 32, total_length, buffer);
1174 case MEP_OPERAND_UIMM2 :
1175 errmsg = insert_normal (cd, fields->f_2u10, 0, 0, 10, 2, 32, total_length, buffer);
1177 case MEP_OPERAND_UIMM24 :
1180 FLD (f_24u8n_hi) = ((UINT) (FLD (f_24u8n)) >> (8));
1181 FLD (f_24u8n_lo) = ((FLD (f_24u8n)) & (255));
1183 errmsg = insert_normal (cd, fields->f_24u8n_hi, 0, 0, 16, 16, 32, total_length, buffer);
1186 errmsg = insert_normal (cd, fields->f_24u8n_lo, 0, 0, 8, 8, 32, total_length, buffer);
1191 case MEP_OPERAND_UIMM3 :
1192 errmsg = insert_normal (cd, fields->f_3u5, 0, 0, 5, 3, 32, total_length, buffer);
1194 case MEP_OPERAND_UIMM4 :
1195 errmsg = insert_normal (cd, fields->f_4u8, 0, 0, 8, 4, 32, total_length, buffer);
1197 case MEP_OPERAND_UIMM5 :
1198 errmsg = insert_normal (cd, fields->f_5u8, 0, 0, 8, 5, 32, total_length, buffer);
1200 case MEP_OPERAND_UIMM7A4 :
1202 long value = fields->f_7u9a4;
1203 value = ((USI) (value) >> (2));
1204 errmsg = insert_normal (cd, value, 0, 0, 9, 5, 32, total_length, buffer);
1207 case MEP_OPERAND_ZERO :
1211 /* xgettext:c-format */
1212 opcodes_error_handler
1213 (_("internal error: unrecognized field %d while building insn"),
1221 int mep_cgen_extract_operand
1222 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
1224 /* Main entry point for operand extraction.
1225 The result is <= 0 for error, >0 for success.
1226 ??? Actual values aren't well defined right now.
1228 This function is basically just a big switch statement. Earlier versions
1229 used tables to look up the function to use, but
1230 - if the table contains both assembler and disassembler functions then
1231 the disassembler contains much of the assembler and vice-versa,
1232 - there's a lot of inlining possibilities as things grow,
1233 - using a switch statement avoids the function call overhead.
1235 This function could be moved into `print_insn_normal', but keeping it
1236 separate makes clear the interface between `print_insn_normal' and each of
1240 mep_cgen_extract_operand (CGEN_CPU_DESC cd,
1242 CGEN_EXTRACT_INFO *ex_info,
1243 CGEN_INSN_INT insn_value,
1244 CGEN_FIELDS * fields,
1247 /* Assume success (for those operands that are nops). */
1249 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
1253 case MEP_OPERAND_ADDR24A4 :
1255 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8a4n_hi);
1256 if (length <= 0) break;
1257 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 6, 32, total_length, pc, & fields->f_24u8a4n_lo);
1258 if (length <= 0) break;
1259 FLD (f_24u8a4n) = ((((FLD (f_24u8a4n_hi)) << (8))) | (((FLD (f_24u8a4n_lo)) << (2))));
1262 case MEP_OPERAND_C5RMUIMM20 :
1264 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_c5_rm);
1265 if (length <= 0) break;
1266 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1267 if (length <= 0) break;
1269 FLD (f_c5_rmuimm20) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rm)) << (16))));
1273 case MEP_OPERAND_C5RNMUIMM24 :
1275 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_c5_rnm);
1276 if (length <= 0) break;
1277 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1278 if (length <= 0) break;
1280 FLD (f_c5_rnmuimm24) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rnm)) << (16))));
1284 case MEP_OPERAND_CALLNUM :
1286 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_5);
1287 if (length <= 0) break;
1288 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_6);
1289 if (length <= 0) break;
1290 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7);
1291 if (length <= 0) break;
1292 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_11);
1293 if (length <= 0) break;
1294 FLD (f_callnum) = ((((FLD (f_5)) << (3))) | (((((FLD (f_6)) << (2))) | (((((FLD (f_7)) << (1))) | (FLD (f_11)))))));
1297 case MEP_OPERAND_CCCC :
1298 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1300 case MEP_OPERAND_CCRN :
1302 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ccrn_hi);
1303 if (length <= 0) break;
1304 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ccrn_lo);
1305 if (length <= 0) break;
1306 FLD (f_ccrn) = ((((FLD (f_ccrn_hi)) << (4))) | (FLD (f_ccrn_lo)));
1309 case MEP_OPERAND_CDISP10 :
1312 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1313 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)));
1314 fields->f_cdisp10 = value;
1317 case MEP_OPERAND_CDISP10A2 :
1320 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1321 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)));
1322 fields->f_cdisp10 = value;
1325 case MEP_OPERAND_CDISP10A4 :
1328 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1329 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)));
1330 fields->f_cdisp10 = value;
1333 case MEP_OPERAND_CDISP10A8 :
1336 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1337 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)));
1338 fields->f_cdisp10 = value;
1341 case MEP_OPERAND_CDISP12 :
1342 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 12, 32, total_length, pc, & fields->f_12s20);
1344 case MEP_OPERAND_CIMM4 :
1345 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1347 case MEP_OPERAND_CIMM5 :
1348 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 5, 32, total_length, pc, & fields->f_5u24);
1350 case MEP_OPERAND_CODE16 :
1351 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1353 case MEP_OPERAND_CODE24 :
1355 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_24u4n_hi);
1356 if (length <= 0) break;
1357 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u4n_lo);
1358 if (length <= 0) break;
1359 FLD (f_24u4n) = ((((FLD (f_24u4n_hi)) << (16))) | (FLD (f_24u4n_lo)));
1362 case MEP_OPERAND_CP_FLAG :
1364 case MEP_OPERAND_CRN :
1365 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1367 case MEP_OPERAND_CRN64 :
1368 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1370 case MEP_OPERAND_CRNX :
1372 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1373 if (length <= 0) break;
1374 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1375 if (length <= 0) break;
1376 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1379 case MEP_OPERAND_CRNX64 :
1381 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1382 if (length <= 0) break;
1383 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1384 if (length <= 0) break;
1385 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1388 case MEP_OPERAND_CROC :
1389 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1391 case MEP_OPERAND_CROP :
1392 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1394 case MEP_OPERAND_CRPC :
1395 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 5, 32, total_length, pc, & fields->f_ivc2_5u26);
1397 case MEP_OPERAND_CRPP :
1398 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 5, 32, total_length, pc, & fields->f_ivc2_5u18);
1400 case MEP_OPERAND_CRQC :
1401 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 5, 32, total_length, pc, & fields->f_ivc2_5u21);
1403 case MEP_OPERAND_CRQP :
1404 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 5, 32, total_length, pc, & fields->f_ivc2_5u13);
1406 case MEP_OPERAND_CSRN :
1408 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1409 if (length <= 0) break;
1410 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1411 if (length <= 0) break;
1412 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1415 case MEP_OPERAND_CSRN_IDX :
1417 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1418 if (length <= 0) break;
1419 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1420 if (length <= 0) break;
1421 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1424 case MEP_OPERAND_DBG :
1426 case MEP_OPERAND_DEPC :
1428 case MEP_OPERAND_EPC :
1430 case MEP_OPERAND_EXC :
1432 case MEP_OPERAND_HI :
1434 case MEP_OPERAND_IMM16P0 :
1436 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1437 if (length <= 0) break;
1438 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1439 if (length <= 0) break;
1441 FLD (f_ivc2_imm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1445 case MEP_OPERAND_IMM3P12 :
1446 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 3, 32, total_length, pc, & fields->f_ivc2_3u12);
1448 case MEP_OPERAND_IMM3P25 :
1449 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 3, 32, total_length, pc, & fields->f_ivc2_3u25);
1451 case MEP_OPERAND_IMM3P4 :
1452 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 3, 32, total_length, pc, & fields->f_ivc2_3u4);
1454 case MEP_OPERAND_IMM3P5 :
1455 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_ivc2_3u5);
1457 case MEP_OPERAND_IMM3P9 :
1458 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_ivc2_3u9);
1460 case MEP_OPERAND_IMM4P10 :
1461 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 4, 32, total_length, pc, & fields->f_ivc2_4u10);
1463 case MEP_OPERAND_IMM4P4 :
1464 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_4u4);
1466 case MEP_OPERAND_IMM4P8 :
1467 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_ivc2_4u8);
1469 case MEP_OPERAND_IMM5P23 :
1470 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1472 case MEP_OPERAND_IMM5P3 :
1473 length = extract_normal (cd, ex_info, insn_value, 0, 0, 3, 5, 32, total_length, pc, & fields->f_ivc2_5u3);
1475 case MEP_OPERAND_IMM5P7 :
1476 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1478 case MEP_OPERAND_IMM5P8 :
1479 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_ivc2_5u8);
1481 case MEP_OPERAND_IMM6P2 :
1482 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 6, 32, total_length, pc, & fields->f_ivc2_6u2);
1484 case MEP_OPERAND_IMM6P6 :
1485 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 6, 32, total_length, pc, & fields->f_ivc2_6u6);
1487 case MEP_OPERAND_IMM8P0 :
1488 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1490 case MEP_OPERAND_IMM8P20 :
1491 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1493 case MEP_OPERAND_IMM8P4 :
1494 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8u4);
1496 case MEP_OPERAND_IVC_X_0_2 :
1497 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 2, 32, total_length, pc, & fields->f_ivc2_2u0);
1499 case MEP_OPERAND_IVC_X_0_3 :
1500 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 3, 32, total_length, pc, & fields->f_ivc2_3u0);
1502 case MEP_OPERAND_IVC_X_0_4 :
1503 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_4u0);
1505 case MEP_OPERAND_IVC_X_0_5 :
1506 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 5, 32, total_length, pc, & fields->f_ivc2_5u0);
1508 case MEP_OPERAND_IVC_X_6_1 :
1509 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_ivc2_1u6);
1511 case MEP_OPERAND_IVC_X_6_2 :
1512 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_ivc2_2u6);
1514 case MEP_OPERAND_IVC_X_6_3 :
1515 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 3, 32, total_length, pc, & fields->f_ivc2_3u6);
1517 case MEP_OPERAND_IVC2_ACC0_0 :
1519 case MEP_OPERAND_IVC2_ACC0_1 :
1521 case MEP_OPERAND_IVC2_ACC0_2 :
1523 case MEP_OPERAND_IVC2_ACC0_3 :
1525 case MEP_OPERAND_IVC2_ACC0_4 :
1527 case MEP_OPERAND_IVC2_ACC0_5 :
1529 case MEP_OPERAND_IVC2_ACC0_6 :
1531 case MEP_OPERAND_IVC2_ACC0_7 :
1533 case MEP_OPERAND_IVC2_ACC1_0 :
1535 case MEP_OPERAND_IVC2_ACC1_1 :
1537 case MEP_OPERAND_IVC2_ACC1_2 :
1539 case MEP_OPERAND_IVC2_ACC1_3 :
1541 case MEP_OPERAND_IVC2_ACC1_4 :
1543 case MEP_OPERAND_IVC2_ACC1_5 :
1545 case MEP_OPERAND_IVC2_ACC1_6 :
1547 case MEP_OPERAND_IVC2_ACC1_7 :
1549 case MEP_OPERAND_IVC2_CC :
1551 case MEP_OPERAND_IVC2_COFA0 :
1553 case MEP_OPERAND_IVC2_COFA1 :
1555 case MEP_OPERAND_IVC2_COFR0 :
1557 case MEP_OPERAND_IVC2_COFR1 :
1559 case MEP_OPERAND_IVC2_CSAR0 :
1561 case MEP_OPERAND_IVC2_CSAR1 :
1563 case MEP_OPERAND_IVC2C3CCRN :
1565 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_c3hi);
1566 if (length <= 0) break;
1567 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_c3lo);
1568 if (length <= 0) break;
1569 FLD (f_ivc2_ccrn_c3) = ((((FLD (f_ivc2_ccrn_c3hi)) << (4))) | (FLD (f_ivc2_ccrn_c3lo)));
1572 case MEP_OPERAND_IVC2CCRN :
1574 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_h2);
1575 if (length <= 0) break;
1576 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1577 if (length <= 0) break;
1578 FLD (f_ivc2_ccrn) = ((((FLD (f_ivc2_ccrn_h2)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1581 case MEP_OPERAND_IVC2CRN :
1583 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 1, 32, total_length, pc, & fields->f_ivc2_ccrn_h1);
1584 if (length <= 0) break;
1585 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1586 if (length <= 0) break;
1587 FLD (f_ivc2_crnx) = ((((FLD (f_ivc2_ccrn_h1)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1590 case MEP_OPERAND_IVC2RM :
1591 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_crm);
1593 case MEP_OPERAND_LO :
1595 case MEP_OPERAND_LP :
1597 case MEP_OPERAND_MB0 :
1599 case MEP_OPERAND_MB1 :
1601 case MEP_OPERAND_ME0 :
1603 case MEP_OPERAND_ME1 :
1605 case MEP_OPERAND_NPC :
1607 case MEP_OPERAND_OPT :
1609 case MEP_OPERAND_PCABS24A2 :
1611 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u5a2n_hi);
1612 if (length <= 0) break;
1613 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 7, 32, total_length, pc, & fields->f_24u5a2n_lo);
1614 if (length <= 0) break;
1615 FLD (f_24u5a2n) = ((((FLD (f_24u5a2n_hi)) << (8))) | (((FLD (f_24u5a2n_lo)) << (1))));
1618 case MEP_OPERAND_PCREL12A2 :
1621 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);
1622 value = ((((value) << (1))) + (pc));
1623 fields->f_12s4a2 = value;
1626 case MEP_OPERAND_PCREL17A2 :
1629 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);
1630 value = ((((value) << (1))) + (pc));
1631 fields->f_17s16a2 = value;
1634 case MEP_OPERAND_PCREL24A2 :
1636 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);
1637 if (length <= 0) break;
1638 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);
1639 if (length <= 0) break;
1640 FLD (f_24s5a2n) = ((((((FLD (f_24s5a2n_hi)) << (8))) | (((FLD (f_24s5a2n_lo)) << (1))))) + (pc));
1643 case MEP_OPERAND_PCREL8A2 :
1646 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);
1647 value = ((((value) << (1))) + (pc));
1648 fields->f_8s8a2 = value;
1651 case MEP_OPERAND_PSW :
1653 case MEP_OPERAND_R0 :
1655 case MEP_OPERAND_R1 :
1657 case MEP_OPERAND_RL :
1658 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_rl);
1660 case MEP_OPERAND_RL5 :
1661 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 4, 32, total_length, pc, & fields->f_rl5);
1663 case MEP_OPERAND_RM :
1664 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1666 case MEP_OPERAND_RMA :
1667 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1669 case MEP_OPERAND_RN :
1670 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1672 case MEP_OPERAND_RN3 :
1673 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1675 case MEP_OPERAND_RN3C :
1676 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1678 case MEP_OPERAND_RN3L :
1679 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1681 case MEP_OPERAND_RN3S :
1682 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1684 case MEP_OPERAND_RN3UC :
1685 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1687 case MEP_OPERAND_RN3UL :
1688 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1690 case MEP_OPERAND_RN3US :
1691 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1693 case MEP_OPERAND_RNC :
1694 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1696 case MEP_OPERAND_RNL :
1697 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1699 case MEP_OPERAND_RNS :
1700 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1702 case MEP_OPERAND_RNUC :
1703 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1705 case MEP_OPERAND_RNUL :
1706 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1708 case MEP_OPERAND_RNUS :
1709 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1711 case MEP_OPERAND_SAR :
1713 case MEP_OPERAND_SDISP16 :
1714 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1716 case MEP_OPERAND_SIMM16 :
1717 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1719 case MEP_OPERAND_SIMM16P0 :
1721 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1722 if (length <= 0) break;
1723 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1724 if (length <= 0) break;
1726 FLD (f_ivc2_simm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1730 case MEP_OPERAND_SIMM6 :
1731 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 6, 32, total_length, pc, & fields->f_6s8);
1733 case MEP_OPERAND_SIMM8 :
1734 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, pc, & fields->f_8s8);
1736 case MEP_OPERAND_SIMM8P0 :
1737 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8s0);
1739 case MEP_OPERAND_SIMM8P20 :
1740 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8s20);
1742 case MEP_OPERAND_SIMM8P4 :
1743 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8s4);
1745 case MEP_OPERAND_SP :
1747 case MEP_OPERAND_SPR :
1749 case MEP_OPERAND_TP :
1751 case MEP_OPERAND_TPR :
1753 case MEP_OPERAND_UDISP2 :
1754 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_2u6);
1756 case MEP_OPERAND_UDISP7 :
1757 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 7, 32, total_length, pc, & fields->f_7u9);
1759 case MEP_OPERAND_UDISP7A2 :
1762 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 6, 32, total_length, pc, & value);
1763 value = ((value) << (1));
1764 fields->f_7u9a2 = value;
1767 case MEP_OPERAND_UDISP7A4 :
1770 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1771 value = ((value) << (2));
1772 fields->f_7u9a4 = value;
1775 case MEP_OPERAND_UIMM16 :
1776 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1778 case MEP_OPERAND_UIMM2 :
1779 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & fields->f_2u10);
1781 case MEP_OPERAND_UIMM24 :
1783 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8n_hi);
1784 if (length <= 0) break;
1785 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_24u8n_lo);
1786 if (length <= 0) break;
1787 FLD (f_24u8n) = ((((FLD (f_24u8n_hi)) << (8))) | (FLD (f_24u8n_lo)));
1790 case MEP_OPERAND_UIMM3 :
1791 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_3u5);
1793 case MEP_OPERAND_UIMM4 :
1794 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_4u8);
1796 case MEP_OPERAND_UIMM5 :
1797 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_5u8);
1799 case MEP_OPERAND_UIMM7A4 :
1802 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1803 value = ((value) << (2));
1804 fields->f_7u9a4 = value;
1807 case MEP_OPERAND_ZERO :
1811 /* xgettext:c-format */
1812 opcodes_error_handler
1813 (_("internal error: unrecognized field %d while decoding insn"),
1821 cgen_insert_fn * const mep_cgen_insert_handlers[] =
1826 cgen_extract_fn * const mep_cgen_extract_handlers[] =
1828 extract_insn_normal,
1831 int mep_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1832 bfd_vma mep_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1834 /* Getting values from cgen_fields is handled by a collection of functions.
1835 They are distinguished by the type of the VALUE argument they return.
1836 TODO: floating point, inlining support, remove cases where result type
1840 mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1842 const CGEN_FIELDS * fields)
1848 case MEP_OPERAND_ADDR24A4 :
1849 value = fields->f_24u8a4n;
1851 case MEP_OPERAND_C5RMUIMM20 :
1852 value = fields->f_c5_rmuimm20;
1854 case MEP_OPERAND_C5RNMUIMM24 :
1855 value = fields->f_c5_rnmuimm24;
1857 case MEP_OPERAND_CALLNUM :
1858 value = fields->f_callnum;
1860 case MEP_OPERAND_CCCC :
1861 value = fields->f_rm;
1863 case MEP_OPERAND_CCRN :
1864 value = fields->f_ccrn;
1866 case MEP_OPERAND_CDISP10 :
1867 value = fields->f_cdisp10;
1869 case MEP_OPERAND_CDISP10A2 :
1870 value = fields->f_cdisp10;
1872 case MEP_OPERAND_CDISP10A4 :
1873 value = fields->f_cdisp10;
1875 case MEP_OPERAND_CDISP10A8 :
1876 value = fields->f_cdisp10;
1878 case MEP_OPERAND_CDISP12 :
1879 value = fields->f_12s20;
1881 case MEP_OPERAND_CIMM4 :
1882 value = fields->f_rn;
1884 case MEP_OPERAND_CIMM5 :
1885 value = fields->f_5u24;
1887 case MEP_OPERAND_CODE16 :
1888 value = fields->f_16u16;
1890 case MEP_OPERAND_CODE24 :
1891 value = fields->f_24u4n;
1893 case MEP_OPERAND_CP_FLAG :
1896 case MEP_OPERAND_CRN :
1897 value = fields->f_crn;
1899 case MEP_OPERAND_CRN64 :
1900 value = fields->f_crn;
1902 case MEP_OPERAND_CRNX :
1903 value = fields->f_crnx;
1905 case MEP_OPERAND_CRNX64 :
1906 value = fields->f_crnx;
1908 case MEP_OPERAND_CROC :
1909 value = fields->f_ivc2_5u7;
1911 case MEP_OPERAND_CROP :
1912 value = fields->f_ivc2_5u23;
1914 case MEP_OPERAND_CRPC :
1915 value = fields->f_ivc2_5u26;
1917 case MEP_OPERAND_CRPP :
1918 value = fields->f_ivc2_5u18;
1920 case MEP_OPERAND_CRQC :
1921 value = fields->f_ivc2_5u21;
1923 case MEP_OPERAND_CRQP :
1924 value = fields->f_ivc2_5u13;
1926 case MEP_OPERAND_CSRN :
1927 value = fields->f_csrn;
1929 case MEP_OPERAND_CSRN_IDX :
1930 value = fields->f_csrn;
1932 case MEP_OPERAND_DBG :
1935 case MEP_OPERAND_DEPC :
1938 case MEP_OPERAND_EPC :
1941 case MEP_OPERAND_EXC :
1944 case MEP_OPERAND_HI :
1947 case MEP_OPERAND_IMM16P0 :
1948 value = fields->f_ivc2_imm16p0;
1950 case MEP_OPERAND_IMM3P12 :
1951 value = fields->f_ivc2_3u12;
1953 case MEP_OPERAND_IMM3P25 :
1954 value = fields->f_ivc2_3u25;
1956 case MEP_OPERAND_IMM3P4 :
1957 value = fields->f_ivc2_3u4;
1959 case MEP_OPERAND_IMM3P5 :
1960 value = fields->f_ivc2_3u5;
1962 case MEP_OPERAND_IMM3P9 :
1963 value = fields->f_ivc2_3u9;
1965 case MEP_OPERAND_IMM4P10 :
1966 value = fields->f_ivc2_4u10;
1968 case MEP_OPERAND_IMM4P4 :
1969 value = fields->f_ivc2_4u4;
1971 case MEP_OPERAND_IMM4P8 :
1972 value = fields->f_ivc2_4u8;
1974 case MEP_OPERAND_IMM5P23 :
1975 value = fields->f_ivc2_5u23;
1977 case MEP_OPERAND_IMM5P3 :
1978 value = fields->f_ivc2_5u3;
1980 case MEP_OPERAND_IMM5P7 :
1981 value = fields->f_ivc2_5u7;
1983 case MEP_OPERAND_IMM5P8 :
1984 value = fields->f_ivc2_5u8;
1986 case MEP_OPERAND_IMM6P2 :
1987 value = fields->f_ivc2_6u2;
1989 case MEP_OPERAND_IMM6P6 :
1990 value = fields->f_ivc2_6u6;
1992 case MEP_OPERAND_IMM8P0 :
1993 value = fields->f_ivc2_8u0;
1995 case MEP_OPERAND_IMM8P20 :
1996 value = fields->f_ivc2_8u20;
1998 case MEP_OPERAND_IMM8P4 :
1999 value = fields->f_ivc2_8u4;
2001 case MEP_OPERAND_IVC_X_0_2 :
2002 value = fields->f_ivc2_2u0;
2004 case MEP_OPERAND_IVC_X_0_3 :
2005 value = fields->f_ivc2_3u0;
2007 case MEP_OPERAND_IVC_X_0_4 :
2008 value = fields->f_ivc2_4u0;
2010 case MEP_OPERAND_IVC_X_0_5 :
2011 value = fields->f_ivc2_5u0;
2013 case MEP_OPERAND_IVC_X_6_1 :
2014 value = fields->f_ivc2_1u6;
2016 case MEP_OPERAND_IVC_X_6_2 :
2017 value = fields->f_ivc2_2u6;
2019 case MEP_OPERAND_IVC_X_6_3 :
2020 value = fields->f_ivc2_3u6;
2022 case MEP_OPERAND_IVC2_ACC0_0 :
2025 case MEP_OPERAND_IVC2_ACC0_1 :
2028 case MEP_OPERAND_IVC2_ACC0_2 :
2031 case MEP_OPERAND_IVC2_ACC0_3 :
2034 case MEP_OPERAND_IVC2_ACC0_4 :
2037 case MEP_OPERAND_IVC2_ACC0_5 :
2040 case MEP_OPERAND_IVC2_ACC0_6 :
2043 case MEP_OPERAND_IVC2_ACC0_7 :
2046 case MEP_OPERAND_IVC2_ACC1_0 :
2049 case MEP_OPERAND_IVC2_ACC1_1 :
2052 case MEP_OPERAND_IVC2_ACC1_2 :
2055 case MEP_OPERAND_IVC2_ACC1_3 :
2058 case MEP_OPERAND_IVC2_ACC1_4 :
2061 case MEP_OPERAND_IVC2_ACC1_5 :
2064 case MEP_OPERAND_IVC2_ACC1_6 :
2067 case MEP_OPERAND_IVC2_ACC1_7 :
2070 case MEP_OPERAND_IVC2_CC :
2073 case MEP_OPERAND_IVC2_COFA0 :
2076 case MEP_OPERAND_IVC2_COFA1 :
2079 case MEP_OPERAND_IVC2_COFR0 :
2082 case MEP_OPERAND_IVC2_COFR1 :
2085 case MEP_OPERAND_IVC2_CSAR0 :
2088 case MEP_OPERAND_IVC2_CSAR1 :
2091 case MEP_OPERAND_IVC2C3CCRN :
2092 value = fields->f_ivc2_ccrn_c3;
2094 case MEP_OPERAND_IVC2CCRN :
2095 value = fields->f_ivc2_ccrn;
2097 case MEP_OPERAND_IVC2CRN :
2098 value = fields->f_ivc2_crnx;
2100 case MEP_OPERAND_IVC2RM :
2101 value = fields->f_ivc2_crm;
2103 case MEP_OPERAND_LO :
2106 case MEP_OPERAND_LP :
2109 case MEP_OPERAND_MB0 :
2112 case MEP_OPERAND_MB1 :
2115 case MEP_OPERAND_ME0 :
2118 case MEP_OPERAND_ME1 :
2121 case MEP_OPERAND_NPC :
2124 case MEP_OPERAND_OPT :
2127 case MEP_OPERAND_PCABS24A2 :
2128 value = fields->f_24u5a2n;
2130 case MEP_OPERAND_PCREL12A2 :
2131 value = fields->f_12s4a2;
2133 case MEP_OPERAND_PCREL17A2 :
2134 value = fields->f_17s16a2;
2136 case MEP_OPERAND_PCREL24A2 :
2137 value = fields->f_24s5a2n;
2139 case MEP_OPERAND_PCREL8A2 :
2140 value = fields->f_8s8a2;
2142 case MEP_OPERAND_PSW :
2145 case MEP_OPERAND_R0 :
2148 case MEP_OPERAND_R1 :
2151 case MEP_OPERAND_RL :
2152 value = fields->f_rl;
2154 case MEP_OPERAND_RL5 :
2155 value = fields->f_rl5;
2157 case MEP_OPERAND_RM :
2158 value = fields->f_rm;
2160 case MEP_OPERAND_RMA :
2161 value = fields->f_rm;
2163 case MEP_OPERAND_RN :
2164 value = fields->f_rn;
2166 case MEP_OPERAND_RN3 :
2167 value = fields->f_rn3;
2169 case MEP_OPERAND_RN3C :
2170 value = fields->f_rn3;
2172 case MEP_OPERAND_RN3L :
2173 value = fields->f_rn3;
2175 case MEP_OPERAND_RN3S :
2176 value = fields->f_rn3;
2178 case MEP_OPERAND_RN3UC :
2179 value = fields->f_rn3;
2181 case MEP_OPERAND_RN3UL :
2182 value = fields->f_rn3;
2184 case MEP_OPERAND_RN3US :
2185 value = fields->f_rn3;
2187 case MEP_OPERAND_RNC :
2188 value = fields->f_rn;
2190 case MEP_OPERAND_RNL :
2191 value = fields->f_rn;
2193 case MEP_OPERAND_RNS :
2194 value = fields->f_rn;
2196 case MEP_OPERAND_RNUC :
2197 value = fields->f_rn;
2199 case MEP_OPERAND_RNUL :
2200 value = fields->f_rn;
2202 case MEP_OPERAND_RNUS :
2203 value = fields->f_rn;
2205 case MEP_OPERAND_SAR :
2208 case MEP_OPERAND_SDISP16 :
2209 value = fields->f_16s16;
2211 case MEP_OPERAND_SIMM16 :
2212 value = fields->f_16s16;
2214 case MEP_OPERAND_SIMM16P0 :
2215 value = fields->f_ivc2_simm16p0;
2217 case MEP_OPERAND_SIMM6 :
2218 value = fields->f_6s8;
2220 case MEP_OPERAND_SIMM8 :
2221 value = fields->f_8s8;
2223 case MEP_OPERAND_SIMM8P0 :
2224 value = fields->f_ivc2_8s0;
2226 case MEP_OPERAND_SIMM8P20 :
2227 value = fields->f_ivc2_8s20;
2229 case MEP_OPERAND_SIMM8P4 :
2230 value = fields->f_ivc2_8s4;
2232 case MEP_OPERAND_SP :
2235 case MEP_OPERAND_SPR :
2238 case MEP_OPERAND_TP :
2241 case MEP_OPERAND_TPR :
2244 case MEP_OPERAND_UDISP2 :
2245 value = fields->f_2u6;
2247 case MEP_OPERAND_UDISP7 :
2248 value = fields->f_7u9;
2250 case MEP_OPERAND_UDISP7A2 :
2251 value = fields->f_7u9a2;
2253 case MEP_OPERAND_UDISP7A4 :
2254 value = fields->f_7u9a4;
2256 case MEP_OPERAND_UIMM16 :
2257 value = fields->f_16u16;
2259 case MEP_OPERAND_UIMM2 :
2260 value = fields->f_2u10;
2262 case MEP_OPERAND_UIMM24 :
2263 value = fields->f_24u8n;
2265 case MEP_OPERAND_UIMM3 :
2266 value = fields->f_3u5;
2268 case MEP_OPERAND_UIMM4 :
2269 value = fields->f_4u8;
2271 case MEP_OPERAND_UIMM5 :
2272 value = fields->f_5u8;
2274 case MEP_OPERAND_UIMM7A4 :
2275 value = fields->f_7u9a4;
2277 case MEP_OPERAND_ZERO :
2282 /* xgettext:c-format */
2283 opcodes_error_handler
2284 (_("internal error: unrecognized field %d while getting int operand"),
2293 mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2295 const CGEN_FIELDS * fields)
2301 case MEP_OPERAND_ADDR24A4 :
2302 value = fields->f_24u8a4n;
2304 case MEP_OPERAND_C5RMUIMM20 :
2305 value = fields->f_c5_rmuimm20;
2307 case MEP_OPERAND_C5RNMUIMM24 :
2308 value = fields->f_c5_rnmuimm24;
2310 case MEP_OPERAND_CALLNUM :
2311 value = fields->f_callnum;
2313 case MEP_OPERAND_CCCC :
2314 value = fields->f_rm;
2316 case MEP_OPERAND_CCRN :
2317 value = fields->f_ccrn;
2319 case MEP_OPERAND_CDISP10 :
2320 value = fields->f_cdisp10;
2322 case MEP_OPERAND_CDISP10A2 :
2323 value = fields->f_cdisp10;
2325 case MEP_OPERAND_CDISP10A4 :
2326 value = fields->f_cdisp10;
2328 case MEP_OPERAND_CDISP10A8 :
2329 value = fields->f_cdisp10;
2331 case MEP_OPERAND_CDISP12 :
2332 value = fields->f_12s20;
2334 case MEP_OPERAND_CIMM4 :
2335 value = fields->f_rn;
2337 case MEP_OPERAND_CIMM5 :
2338 value = fields->f_5u24;
2340 case MEP_OPERAND_CODE16 :
2341 value = fields->f_16u16;
2343 case MEP_OPERAND_CODE24 :
2344 value = fields->f_24u4n;
2346 case MEP_OPERAND_CP_FLAG :
2349 case MEP_OPERAND_CRN :
2350 value = fields->f_crn;
2352 case MEP_OPERAND_CRN64 :
2353 value = fields->f_crn;
2355 case MEP_OPERAND_CRNX :
2356 value = fields->f_crnx;
2358 case MEP_OPERAND_CRNX64 :
2359 value = fields->f_crnx;
2361 case MEP_OPERAND_CROC :
2362 value = fields->f_ivc2_5u7;
2364 case MEP_OPERAND_CROP :
2365 value = fields->f_ivc2_5u23;
2367 case MEP_OPERAND_CRPC :
2368 value = fields->f_ivc2_5u26;
2370 case MEP_OPERAND_CRPP :
2371 value = fields->f_ivc2_5u18;
2373 case MEP_OPERAND_CRQC :
2374 value = fields->f_ivc2_5u21;
2376 case MEP_OPERAND_CRQP :
2377 value = fields->f_ivc2_5u13;
2379 case MEP_OPERAND_CSRN :
2380 value = fields->f_csrn;
2382 case MEP_OPERAND_CSRN_IDX :
2383 value = fields->f_csrn;
2385 case MEP_OPERAND_DBG :
2388 case MEP_OPERAND_DEPC :
2391 case MEP_OPERAND_EPC :
2394 case MEP_OPERAND_EXC :
2397 case MEP_OPERAND_HI :
2400 case MEP_OPERAND_IMM16P0 :
2401 value = fields->f_ivc2_imm16p0;
2403 case MEP_OPERAND_IMM3P12 :
2404 value = fields->f_ivc2_3u12;
2406 case MEP_OPERAND_IMM3P25 :
2407 value = fields->f_ivc2_3u25;
2409 case MEP_OPERAND_IMM3P4 :
2410 value = fields->f_ivc2_3u4;
2412 case MEP_OPERAND_IMM3P5 :
2413 value = fields->f_ivc2_3u5;
2415 case MEP_OPERAND_IMM3P9 :
2416 value = fields->f_ivc2_3u9;
2418 case MEP_OPERAND_IMM4P10 :
2419 value = fields->f_ivc2_4u10;
2421 case MEP_OPERAND_IMM4P4 :
2422 value = fields->f_ivc2_4u4;
2424 case MEP_OPERAND_IMM4P8 :
2425 value = fields->f_ivc2_4u8;
2427 case MEP_OPERAND_IMM5P23 :
2428 value = fields->f_ivc2_5u23;
2430 case MEP_OPERAND_IMM5P3 :
2431 value = fields->f_ivc2_5u3;
2433 case MEP_OPERAND_IMM5P7 :
2434 value = fields->f_ivc2_5u7;
2436 case MEP_OPERAND_IMM5P8 :
2437 value = fields->f_ivc2_5u8;
2439 case MEP_OPERAND_IMM6P2 :
2440 value = fields->f_ivc2_6u2;
2442 case MEP_OPERAND_IMM6P6 :
2443 value = fields->f_ivc2_6u6;
2445 case MEP_OPERAND_IMM8P0 :
2446 value = fields->f_ivc2_8u0;
2448 case MEP_OPERAND_IMM8P20 :
2449 value = fields->f_ivc2_8u20;
2451 case MEP_OPERAND_IMM8P4 :
2452 value = fields->f_ivc2_8u4;
2454 case MEP_OPERAND_IVC_X_0_2 :
2455 value = fields->f_ivc2_2u0;
2457 case MEP_OPERAND_IVC_X_0_3 :
2458 value = fields->f_ivc2_3u0;
2460 case MEP_OPERAND_IVC_X_0_4 :
2461 value = fields->f_ivc2_4u0;
2463 case MEP_OPERAND_IVC_X_0_5 :
2464 value = fields->f_ivc2_5u0;
2466 case MEP_OPERAND_IVC_X_6_1 :
2467 value = fields->f_ivc2_1u6;
2469 case MEP_OPERAND_IVC_X_6_2 :
2470 value = fields->f_ivc2_2u6;
2472 case MEP_OPERAND_IVC_X_6_3 :
2473 value = fields->f_ivc2_3u6;
2475 case MEP_OPERAND_IVC2_ACC0_0 :
2478 case MEP_OPERAND_IVC2_ACC0_1 :
2481 case MEP_OPERAND_IVC2_ACC0_2 :
2484 case MEP_OPERAND_IVC2_ACC0_3 :
2487 case MEP_OPERAND_IVC2_ACC0_4 :
2490 case MEP_OPERAND_IVC2_ACC0_5 :
2493 case MEP_OPERAND_IVC2_ACC0_6 :
2496 case MEP_OPERAND_IVC2_ACC0_7 :
2499 case MEP_OPERAND_IVC2_ACC1_0 :
2502 case MEP_OPERAND_IVC2_ACC1_1 :
2505 case MEP_OPERAND_IVC2_ACC1_2 :
2508 case MEP_OPERAND_IVC2_ACC1_3 :
2511 case MEP_OPERAND_IVC2_ACC1_4 :
2514 case MEP_OPERAND_IVC2_ACC1_5 :
2517 case MEP_OPERAND_IVC2_ACC1_6 :
2520 case MEP_OPERAND_IVC2_ACC1_7 :
2523 case MEP_OPERAND_IVC2_CC :
2526 case MEP_OPERAND_IVC2_COFA0 :
2529 case MEP_OPERAND_IVC2_COFA1 :
2532 case MEP_OPERAND_IVC2_COFR0 :
2535 case MEP_OPERAND_IVC2_COFR1 :
2538 case MEP_OPERAND_IVC2_CSAR0 :
2541 case MEP_OPERAND_IVC2_CSAR1 :
2544 case MEP_OPERAND_IVC2C3CCRN :
2545 value = fields->f_ivc2_ccrn_c3;
2547 case MEP_OPERAND_IVC2CCRN :
2548 value = fields->f_ivc2_ccrn;
2550 case MEP_OPERAND_IVC2CRN :
2551 value = fields->f_ivc2_crnx;
2553 case MEP_OPERAND_IVC2RM :
2554 value = fields->f_ivc2_crm;
2556 case MEP_OPERAND_LO :
2559 case MEP_OPERAND_LP :
2562 case MEP_OPERAND_MB0 :
2565 case MEP_OPERAND_MB1 :
2568 case MEP_OPERAND_ME0 :
2571 case MEP_OPERAND_ME1 :
2574 case MEP_OPERAND_NPC :
2577 case MEP_OPERAND_OPT :
2580 case MEP_OPERAND_PCABS24A2 :
2581 value = fields->f_24u5a2n;
2583 case MEP_OPERAND_PCREL12A2 :
2584 value = fields->f_12s4a2;
2586 case MEP_OPERAND_PCREL17A2 :
2587 value = fields->f_17s16a2;
2589 case MEP_OPERAND_PCREL24A2 :
2590 value = fields->f_24s5a2n;
2592 case MEP_OPERAND_PCREL8A2 :
2593 value = fields->f_8s8a2;
2595 case MEP_OPERAND_PSW :
2598 case MEP_OPERAND_R0 :
2601 case MEP_OPERAND_R1 :
2604 case MEP_OPERAND_RL :
2605 value = fields->f_rl;
2607 case MEP_OPERAND_RL5 :
2608 value = fields->f_rl5;
2610 case MEP_OPERAND_RM :
2611 value = fields->f_rm;
2613 case MEP_OPERAND_RMA :
2614 value = fields->f_rm;
2616 case MEP_OPERAND_RN :
2617 value = fields->f_rn;
2619 case MEP_OPERAND_RN3 :
2620 value = fields->f_rn3;
2622 case MEP_OPERAND_RN3C :
2623 value = fields->f_rn3;
2625 case MEP_OPERAND_RN3L :
2626 value = fields->f_rn3;
2628 case MEP_OPERAND_RN3S :
2629 value = fields->f_rn3;
2631 case MEP_OPERAND_RN3UC :
2632 value = fields->f_rn3;
2634 case MEP_OPERAND_RN3UL :
2635 value = fields->f_rn3;
2637 case MEP_OPERAND_RN3US :
2638 value = fields->f_rn3;
2640 case MEP_OPERAND_RNC :
2641 value = fields->f_rn;
2643 case MEP_OPERAND_RNL :
2644 value = fields->f_rn;
2646 case MEP_OPERAND_RNS :
2647 value = fields->f_rn;
2649 case MEP_OPERAND_RNUC :
2650 value = fields->f_rn;
2652 case MEP_OPERAND_RNUL :
2653 value = fields->f_rn;
2655 case MEP_OPERAND_RNUS :
2656 value = fields->f_rn;
2658 case MEP_OPERAND_SAR :
2661 case MEP_OPERAND_SDISP16 :
2662 value = fields->f_16s16;
2664 case MEP_OPERAND_SIMM16 :
2665 value = fields->f_16s16;
2667 case MEP_OPERAND_SIMM16P0 :
2668 value = fields->f_ivc2_simm16p0;
2670 case MEP_OPERAND_SIMM6 :
2671 value = fields->f_6s8;
2673 case MEP_OPERAND_SIMM8 :
2674 value = fields->f_8s8;
2676 case MEP_OPERAND_SIMM8P0 :
2677 value = fields->f_ivc2_8s0;
2679 case MEP_OPERAND_SIMM8P20 :
2680 value = fields->f_ivc2_8s20;
2682 case MEP_OPERAND_SIMM8P4 :
2683 value = fields->f_ivc2_8s4;
2685 case MEP_OPERAND_SP :
2688 case MEP_OPERAND_SPR :
2691 case MEP_OPERAND_TP :
2694 case MEP_OPERAND_TPR :
2697 case MEP_OPERAND_UDISP2 :
2698 value = fields->f_2u6;
2700 case MEP_OPERAND_UDISP7 :
2701 value = fields->f_7u9;
2703 case MEP_OPERAND_UDISP7A2 :
2704 value = fields->f_7u9a2;
2706 case MEP_OPERAND_UDISP7A4 :
2707 value = fields->f_7u9a4;
2709 case MEP_OPERAND_UIMM16 :
2710 value = fields->f_16u16;
2712 case MEP_OPERAND_UIMM2 :
2713 value = fields->f_2u10;
2715 case MEP_OPERAND_UIMM24 :
2716 value = fields->f_24u8n;
2718 case MEP_OPERAND_UIMM3 :
2719 value = fields->f_3u5;
2721 case MEP_OPERAND_UIMM4 :
2722 value = fields->f_4u8;
2724 case MEP_OPERAND_UIMM5 :
2725 value = fields->f_5u8;
2727 case MEP_OPERAND_UIMM7A4 :
2728 value = fields->f_7u9a4;
2730 case MEP_OPERAND_ZERO :
2735 /* xgettext:c-format */
2736 opcodes_error_handler
2737 (_("internal error: unrecognized field %d while getting vma operand"),
2745 void mep_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
2746 void mep_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
2748 /* Stuffing values in cgen_fields is handled by a collection of functions.
2749 They are distinguished by the type of the VALUE argument they accept.
2750 TODO: floating point, inlining support, remove cases where argument type
2754 mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2756 CGEN_FIELDS * fields,
2761 case MEP_OPERAND_ADDR24A4 :
2762 fields->f_24u8a4n = value;
2764 case MEP_OPERAND_C5RMUIMM20 :
2765 fields->f_c5_rmuimm20 = value;
2767 case MEP_OPERAND_C5RNMUIMM24 :
2768 fields->f_c5_rnmuimm24 = value;
2770 case MEP_OPERAND_CALLNUM :
2771 fields->f_callnum = value;
2773 case MEP_OPERAND_CCCC :
2774 fields->f_rm = value;
2776 case MEP_OPERAND_CCRN :
2777 fields->f_ccrn = value;
2779 case MEP_OPERAND_CDISP10 :
2780 fields->f_cdisp10 = value;
2782 case MEP_OPERAND_CDISP10A2 :
2783 fields->f_cdisp10 = value;
2785 case MEP_OPERAND_CDISP10A4 :
2786 fields->f_cdisp10 = value;
2788 case MEP_OPERAND_CDISP10A8 :
2789 fields->f_cdisp10 = value;
2791 case MEP_OPERAND_CDISP12 :
2792 fields->f_12s20 = value;
2794 case MEP_OPERAND_CIMM4 :
2795 fields->f_rn = value;
2797 case MEP_OPERAND_CIMM5 :
2798 fields->f_5u24 = value;
2800 case MEP_OPERAND_CODE16 :
2801 fields->f_16u16 = value;
2803 case MEP_OPERAND_CODE24 :
2804 fields->f_24u4n = value;
2806 case MEP_OPERAND_CP_FLAG :
2808 case MEP_OPERAND_CRN :
2809 fields->f_crn = value;
2811 case MEP_OPERAND_CRN64 :
2812 fields->f_crn = value;
2814 case MEP_OPERAND_CRNX :
2815 fields->f_crnx = value;
2817 case MEP_OPERAND_CRNX64 :
2818 fields->f_crnx = value;
2820 case MEP_OPERAND_CROC :
2821 fields->f_ivc2_5u7 = value;
2823 case MEP_OPERAND_CROP :
2824 fields->f_ivc2_5u23 = value;
2826 case MEP_OPERAND_CRPC :
2827 fields->f_ivc2_5u26 = value;
2829 case MEP_OPERAND_CRPP :
2830 fields->f_ivc2_5u18 = value;
2832 case MEP_OPERAND_CRQC :
2833 fields->f_ivc2_5u21 = value;
2835 case MEP_OPERAND_CRQP :
2836 fields->f_ivc2_5u13 = value;
2838 case MEP_OPERAND_CSRN :
2839 fields->f_csrn = value;
2841 case MEP_OPERAND_CSRN_IDX :
2842 fields->f_csrn = value;
2844 case MEP_OPERAND_DBG :
2846 case MEP_OPERAND_DEPC :
2848 case MEP_OPERAND_EPC :
2850 case MEP_OPERAND_EXC :
2852 case MEP_OPERAND_HI :
2854 case MEP_OPERAND_IMM16P0 :
2855 fields->f_ivc2_imm16p0 = value;
2857 case MEP_OPERAND_IMM3P12 :
2858 fields->f_ivc2_3u12 = value;
2860 case MEP_OPERAND_IMM3P25 :
2861 fields->f_ivc2_3u25 = value;
2863 case MEP_OPERAND_IMM3P4 :
2864 fields->f_ivc2_3u4 = value;
2866 case MEP_OPERAND_IMM3P5 :
2867 fields->f_ivc2_3u5 = value;
2869 case MEP_OPERAND_IMM3P9 :
2870 fields->f_ivc2_3u9 = value;
2872 case MEP_OPERAND_IMM4P10 :
2873 fields->f_ivc2_4u10 = value;
2875 case MEP_OPERAND_IMM4P4 :
2876 fields->f_ivc2_4u4 = value;
2878 case MEP_OPERAND_IMM4P8 :
2879 fields->f_ivc2_4u8 = value;
2881 case MEP_OPERAND_IMM5P23 :
2882 fields->f_ivc2_5u23 = value;
2884 case MEP_OPERAND_IMM5P3 :
2885 fields->f_ivc2_5u3 = value;
2887 case MEP_OPERAND_IMM5P7 :
2888 fields->f_ivc2_5u7 = value;
2890 case MEP_OPERAND_IMM5P8 :
2891 fields->f_ivc2_5u8 = value;
2893 case MEP_OPERAND_IMM6P2 :
2894 fields->f_ivc2_6u2 = value;
2896 case MEP_OPERAND_IMM6P6 :
2897 fields->f_ivc2_6u6 = value;
2899 case MEP_OPERAND_IMM8P0 :
2900 fields->f_ivc2_8u0 = value;
2902 case MEP_OPERAND_IMM8P20 :
2903 fields->f_ivc2_8u20 = value;
2905 case MEP_OPERAND_IMM8P4 :
2906 fields->f_ivc2_8u4 = value;
2908 case MEP_OPERAND_IVC_X_0_2 :
2909 fields->f_ivc2_2u0 = value;
2911 case MEP_OPERAND_IVC_X_0_3 :
2912 fields->f_ivc2_3u0 = value;
2914 case MEP_OPERAND_IVC_X_0_4 :
2915 fields->f_ivc2_4u0 = value;
2917 case MEP_OPERAND_IVC_X_0_5 :
2918 fields->f_ivc2_5u0 = value;
2920 case MEP_OPERAND_IVC_X_6_1 :
2921 fields->f_ivc2_1u6 = value;
2923 case MEP_OPERAND_IVC_X_6_2 :
2924 fields->f_ivc2_2u6 = value;
2926 case MEP_OPERAND_IVC_X_6_3 :
2927 fields->f_ivc2_3u6 = value;
2929 case MEP_OPERAND_IVC2_ACC0_0 :
2931 case MEP_OPERAND_IVC2_ACC0_1 :
2933 case MEP_OPERAND_IVC2_ACC0_2 :
2935 case MEP_OPERAND_IVC2_ACC0_3 :
2937 case MEP_OPERAND_IVC2_ACC0_4 :
2939 case MEP_OPERAND_IVC2_ACC0_5 :
2941 case MEP_OPERAND_IVC2_ACC0_6 :
2943 case MEP_OPERAND_IVC2_ACC0_7 :
2945 case MEP_OPERAND_IVC2_ACC1_0 :
2947 case MEP_OPERAND_IVC2_ACC1_1 :
2949 case MEP_OPERAND_IVC2_ACC1_2 :
2951 case MEP_OPERAND_IVC2_ACC1_3 :
2953 case MEP_OPERAND_IVC2_ACC1_4 :
2955 case MEP_OPERAND_IVC2_ACC1_5 :
2957 case MEP_OPERAND_IVC2_ACC1_6 :
2959 case MEP_OPERAND_IVC2_ACC1_7 :
2961 case MEP_OPERAND_IVC2_CC :
2963 case MEP_OPERAND_IVC2_COFA0 :
2965 case MEP_OPERAND_IVC2_COFA1 :
2967 case MEP_OPERAND_IVC2_COFR0 :
2969 case MEP_OPERAND_IVC2_COFR1 :
2971 case MEP_OPERAND_IVC2_CSAR0 :
2973 case MEP_OPERAND_IVC2_CSAR1 :
2975 case MEP_OPERAND_IVC2C3CCRN :
2976 fields->f_ivc2_ccrn_c3 = value;
2978 case MEP_OPERAND_IVC2CCRN :
2979 fields->f_ivc2_ccrn = value;
2981 case MEP_OPERAND_IVC2CRN :
2982 fields->f_ivc2_crnx = value;
2984 case MEP_OPERAND_IVC2RM :
2985 fields->f_ivc2_crm = value;
2987 case MEP_OPERAND_LO :
2989 case MEP_OPERAND_LP :
2991 case MEP_OPERAND_MB0 :
2993 case MEP_OPERAND_MB1 :
2995 case MEP_OPERAND_ME0 :
2997 case MEP_OPERAND_ME1 :
2999 case MEP_OPERAND_NPC :
3001 case MEP_OPERAND_OPT :
3003 case MEP_OPERAND_PCABS24A2 :
3004 fields->f_24u5a2n = value;
3006 case MEP_OPERAND_PCREL12A2 :
3007 fields->f_12s4a2 = value;
3009 case MEP_OPERAND_PCREL17A2 :
3010 fields->f_17s16a2 = value;
3012 case MEP_OPERAND_PCREL24A2 :
3013 fields->f_24s5a2n = value;
3015 case MEP_OPERAND_PCREL8A2 :
3016 fields->f_8s8a2 = value;
3018 case MEP_OPERAND_PSW :
3020 case MEP_OPERAND_R0 :
3022 case MEP_OPERAND_R1 :
3024 case MEP_OPERAND_RL :
3025 fields->f_rl = value;
3027 case MEP_OPERAND_RL5 :
3028 fields->f_rl5 = value;
3030 case MEP_OPERAND_RM :
3031 fields->f_rm = value;
3033 case MEP_OPERAND_RMA :
3034 fields->f_rm = value;
3036 case MEP_OPERAND_RN :
3037 fields->f_rn = value;
3039 case MEP_OPERAND_RN3 :
3040 fields->f_rn3 = value;
3042 case MEP_OPERAND_RN3C :
3043 fields->f_rn3 = value;
3045 case MEP_OPERAND_RN3L :
3046 fields->f_rn3 = value;
3048 case MEP_OPERAND_RN3S :
3049 fields->f_rn3 = value;
3051 case MEP_OPERAND_RN3UC :
3052 fields->f_rn3 = value;
3054 case MEP_OPERAND_RN3UL :
3055 fields->f_rn3 = value;
3057 case MEP_OPERAND_RN3US :
3058 fields->f_rn3 = value;
3060 case MEP_OPERAND_RNC :
3061 fields->f_rn = value;
3063 case MEP_OPERAND_RNL :
3064 fields->f_rn = value;
3066 case MEP_OPERAND_RNS :
3067 fields->f_rn = value;
3069 case MEP_OPERAND_RNUC :
3070 fields->f_rn = value;
3072 case MEP_OPERAND_RNUL :
3073 fields->f_rn = value;
3075 case MEP_OPERAND_RNUS :
3076 fields->f_rn = value;
3078 case MEP_OPERAND_SAR :
3080 case MEP_OPERAND_SDISP16 :
3081 fields->f_16s16 = value;
3083 case MEP_OPERAND_SIMM16 :
3084 fields->f_16s16 = value;
3086 case MEP_OPERAND_SIMM16P0 :
3087 fields->f_ivc2_simm16p0 = value;
3089 case MEP_OPERAND_SIMM6 :
3090 fields->f_6s8 = value;
3092 case MEP_OPERAND_SIMM8 :
3093 fields->f_8s8 = value;
3095 case MEP_OPERAND_SIMM8P0 :
3096 fields->f_ivc2_8s0 = value;
3098 case MEP_OPERAND_SIMM8P20 :
3099 fields->f_ivc2_8s20 = value;
3101 case MEP_OPERAND_SIMM8P4 :
3102 fields->f_ivc2_8s4 = value;
3104 case MEP_OPERAND_SP :
3106 case MEP_OPERAND_SPR :
3108 case MEP_OPERAND_TP :
3110 case MEP_OPERAND_TPR :
3112 case MEP_OPERAND_UDISP2 :
3113 fields->f_2u6 = value;
3115 case MEP_OPERAND_UDISP7 :
3116 fields->f_7u9 = value;
3118 case MEP_OPERAND_UDISP7A2 :
3119 fields->f_7u9a2 = value;
3121 case MEP_OPERAND_UDISP7A4 :
3122 fields->f_7u9a4 = value;
3124 case MEP_OPERAND_UIMM16 :
3125 fields->f_16u16 = value;
3127 case MEP_OPERAND_UIMM2 :
3128 fields->f_2u10 = value;
3130 case MEP_OPERAND_UIMM24 :
3131 fields->f_24u8n = value;
3133 case MEP_OPERAND_UIMM3 :
3134 fields->f_3u5 = value;
3136 case MEP_OPERAND_UIMM4 :
3137 fields->f_4u8 = value;
3139 case MEP_OPERAND_UIMM5 :
3140 fields->f_5u8 = value;
3142 case MEP_OPERAND_UIMM7A4 :
3143 fields->f_7u9a4 = value;
3145 case MEP_OPERAND_ZERO :
3149 /* xgettext:c-format */
3150 opcodes_error_handler
3151 (_("internal error: unrecognized field %d while setting int operand"),
3158 mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
3160 CGEN_FIELDS * fields,
3165 case MEP_OPERAND_ADDR24A4 :
3166 fields->f_24u8a4n = value;
3168 case MEP_OPERAND_C5RMUIMM20 :
3169 fields->f_c5_rmuimm20 = value;
3171 case MEP_OPERAND_C5RNMUIMM24 :
3172 fields->f_c5_rnmuimm24 = value;
3174 case MEP_OPERAND_CALLNUM :
3175 fields->f_callnum = value;
3177 case MEP_OPERAND_CCCC :
3178 fields->f_rm = value;
3180 case MEP_OPERAND_CCRN :
3181 fields->f_ccrn = value;
3183 case MEP_OPERAND_CDISP10 :
3184 fields->f_cdisp10 = value;
3186 case MEP_OPERAND_CDISP10A2 :
3187 fields->f_cdisp10 = value;
3189 case MEP_OPERAND_CDISP10A4 :
3190 fields->f_cdisp10 = value;
3192 case MEP_OPERAND_CDISP10A8 :
3193 fields->f_cdisp10 = value;
3195 case MEP_OPERAND_CDISP12 :
3196 fields->f_12s20 = value;
3198 case MEP_OPERAND_CIMM4 :
3199 fields->f_rn = value;
3201 case MEP_OPERAND_CIMM5 :
3202 fields->f_5u24 = value;
3204 case MEP_OPERAND_CODE16 :
3205 fields->f_16u16 = value;
3207 case MEP_OPERAND_CODE24 :
3208 fields->f_24u4n = value;
3210 case MEP_OPERAND_CP_FLAG :
3212 case MEP_OPERAND_CRN :
3213 fields->f_crn = value;
3215 case MEP_OPERAND_CRN64 :
3216 fields->f_crn = value;
3218 case MEP_OPERAND_CRNX :
3219 fields->f_crnx = value;
3221 case MEP_OPERAND_CRNX64 :
3222 fields->f_crnx = value;
3224 case MEP_OPERAND_CROC :
3225 fields->f_ivc2_5u7 = value;
3227 case MEP_OPERAND_CROP :
3228 fields->f_ivc2_5u23 = value;
3230 case MEP_OPERAND_CRPC :
3231 fields->f_ivc2_5u26 = value;
3233 case MEP_OPERAND_CRPP :
3234 fields->f_ivc2_5u18 = value;
3236 case MEP_OPERAND_CRQC :
3237 fields->f_ivc2_5u21 = value;
3239 case MEP_OPERAND_CRQP :
3240 fields->f_ivc2_5u13 = value;
3242 case MEP_OPERAND_CSRN :
3243 fields->f_csrn = value;
3245 case MEP_OPERAND_CSRN_IDX :
3246 fields->f_csrn = value;
3248 case MEP_OPERAND_DBG :
3250 case MEP_OPERAND_DEPC :
3252 case MEP_OPERAND_EPC :
3254 case MEP_OPERAND_EXC :
3256 case MEP_OPERAND_HI :
3258 case MEP_OPERAND_IMM16P0 :
3259 fields->f_ivc2_imm16p0 = value;
3261 case MEP_OPERAND_IMM3P12 :
3262 fields->f_ivc2_3u12 = value;
3264 case MEP_OPERAND_IMM3P25 :
3265 fields->f_ivc2_3u25 = value;
3267 case MEP_OPERAND_IMM3P4 :
3268 fields->f_ivc2_3u4 = value;
3270 case MEP_OPERAND_IMM3P5 :
3271 fields->f_ivc2_3u5 = value;
3273 case MEP_OPERAND_IMM3P9 :
3274 fields->f_ivc2_3u9 = value;
3276 case MEP_OPERAND_IMM4P10 :
3277 fields->f_ivc2_4u10 = value;
3279 case MEP_OPERAND_IMM4P4 :
3280 fields->f_ivc2_4u4 = value;
3282 case MEP_OPERAND_IMM4P8 :
3283 fields->f_ivc2_4u8 = value;
3285 case MEP_OPERAND_IMM5P23 :
3286 fields->f_ivc2_5u23 = value;
3288 case MEP_OPERAND_IMM5P3 :
3289 fields->f_ivc2_5u3 = value;
3291 case MEP_OPERAND_IMM5P7 :
3292 fields->f_ivc2_5u7 = value;
3294 case MEP_OPERAND_IMM5P8 :
3295 fields->f_ivc2_5u8 = value;
3297 case MEP_OPERAND_IMM6P2 :
3298 fields->f_ivc2_6u2 = value;
3300 case MEP_OPERAND_IMM6P6 :
3301 fields->f_ivc2_6u6 = value;
3303 case MEP_OPERAND_IMM8P0 :
3304 fields->f_ivc2_8u0 = value;
3306 case MEP_OPERAND_IMM8P20 :
3307 fields->f_ivc2_8u20 = value;
3309 case MEP_OPERAND_IMM8P4 :
3310 fields->f_ivc2_8u4 = value;
3312 case MEP_OPERAND_IVC_X_0_2 :
3313 fields->f_ivc2_2u0 = value;
3315 case MEP_OPERAND_IVC_X_0_3 :
3316 fields->f_ivc2_3u0 = value;
3318 case MEP_OPERAND_IVC_X_0_4 :
3319 fields->f_ivc2_4u0 = value;
3321 case MEP_OPERAND_IVC_X_0_5 :
3322 fields->f_ivc2_5u0 = value;
3324 case MEP_OPERAND_IVC_X_6_1 :
3325 fields->f_ivc2_1u6 = value;
3327 case MEP_OPERAND_IVC_X_6_2 :
3328 fields->f_ivc2_2u6 = value;
3330 case MEP_OPERAND_IVC_X_6_3 :
3331 fields->f_ivc2_3u6 = value;
3333 case MEP_OPERAND_IVC2_ACC0_0 :
3335 case MEP_OPERAND_IVC2_ACC0_1 :
3337 case MEP_OPERAND_IVC2_ACC0_2 :
3339 case MEP_OPERAND_IVC2_ACC0_3 :
3341 case MEP_OPERAND_IVC2_ACC0_4 :
3343 case MEP_OPERAND_IVC2_ACC0_5 :
3345 case MEP_OPERAND_IVC2_ACC0_6 :
3347 case MEP_OPERAND_IVC2_ACC0_7 :
3349 case MEP_OPERAND_IVC2_ACC1_0 :
3351 case MEP_OPERAND_IVC2_ACC1_1 :
3353 case MEP_OPERAND_IVC2_ACC1_2 :
3355 case MEP_OPERAND_IVC2_ACC1_3 :
3357 case MEP_OPERAND_IVC2_ACC1_4 :
3359 case MEP_OPERAND_IVC2_ACC1_5 :
3361 case MEP_OPERAND_IVC2_ACC1_6 :
3363 case MEP_OPERAND_IVC2_ACC1_7 :
3365 case MEP_OPERAND_IVC2_CC :
3367 case MEP_OPERAND_IVC2_COFA0 :
3369 case MEP_OPERAND_IVC2_COFA1 :
3371 case MEP_OPERAND_IVC2_COFR0 :
3373 case MEP_OPERAND_IVC2_COFR1 :
3375 case MEP_OPERAND_IVC2_CSAR0 :
3377 case MEP_OPERAND_IVC2_CSAR1 :
3379 case MEP_OPERAND_IVC2C3CCRN :
3380 fields->f_ivc2_ccrn_c3 = value;
3382 case MEP_OPERAND_IVC2CCRN :
3383 fields->f_ivc2_ccrn = value;
3385 case MEP_OPERAND_IVC2CRN :
3386 fields->f_ivc2_crnx = value;
3388 case MEP_OPERAND_IVC2RM :
3389 fields->f_ivc2_crm = value;
3391 case MEP_OPERAND_LO :
3393 case MEP_OPERAND_LP :
3395 case MEP_OPERAND_MB0 :
3397 case MEP_OPERAND_MB1 :
3399 case MEP_OPERAND_ME0 :
3401 case MEP_OPERAND_ME1 :
3403 case MEP_OPERAND_NPC :
3405 case MEP_OPERAND_OPT :
3407 case MEP_OPERAND_PCABS24A2 :
3408 fields->f_24u5a2n = value;
3410 case MEP_OPERAND_PCREL12A2 :
3411 fields->f_12s4a2 = value;
3413 case MEP_OPERAND_PCREL17A2 :
3414 fields->f_17s16a2 = value;
3416 case MEP_OPERAND_PCREL24A2 :
3417 fields->f_24s5a2n = value;
3419 case MEP_OPERAND_PCREL8A2 :
3420 fields->f_8s8a2 = value;
3422 case MEP_OPERAND_PSW :
3424 case MEP_OPERAND_R0 :
3426 case MEP_OPERAND_R1 :
3428 case MEP_OPERAND_RL :
3429 fields->f_rl = value;
3431 case MEP_OPERAND_RL5 :
3432 fields->f_rl5 = value;
3434 case MEP_OPERAND_RM :
3435 fields->f_rm = value;
3437 case MEP_OPERAND_RMA :
3438 fields->f_rm = value;
3440 case MEP_OPERAND_RN :
3441 fields->f_rn = value;
3443 case MEP_OPERAND_RN3 :
3444 fields->f_rn3 = value;
3446 case MEP_OPERAND_RN3C :
3447 fields->f_rn3 = value;
3449 case MEP_OPERAND_RN3L :
3450 fields->f_rn3 = value;
3452 case MEP_OPERAND_RN3S :
3453 fields->f_rn3 = value;
3455 case MEP_OPERAND_RN3UC :
3456 fields->f_rn3 = value;
3458 case MEP_OPERAND_RN3UL :
3459 fields->f_rn3 = value;
3461 case MEP_OPERAND_RN3US :
3462 fields->f_rn3 = value;
3464 case MEP_OPERAND_RNC :
3465 fields->f_rn = value;
3467 case MEP_OPERAND_RNL :
3468 fields->f_rn = value;
3470 case MEP_OPERAND_RNS :
3471 fields->f_rn = value;
3473 case MEP_OPERAND_RNUC :
3474 fields->f_rn = value;
3476 case MEP_OPERAND_RNUL :
3477 fields->f_rn = value;
3479 case MEP_OPERAND_RNUS :
3480 fields->f_rn = value;
3482 case MEP_OPERAND_SAR :
3484 case MEP_OPERAND_SDISP16 :
3485 fields->f_16s16 = value;
3487 case MEP_OPERAND_SIMM16 :
3488 fields->f_16s16 = value;
3490 case MEP_OPERAND_SIMM16P0 :
3491 fields->f_ivc2_simm16p0 = value;
3493 case MEP_OPERAND_SIMM6 :
3494 fields->f_6s8 = value;
3496 case MEP_OPERAND_SIMM8 :
3497 fields->f_8s8 = value;
3499 case MEP_OPERAND_SIMM8P0 :
3500 fields->f_ivc2_8s0 = value;
3502 case MEP_OPERAND_SIMM8P20 :
3503 fields->f_ivc2_8s20 = value;
3505 case MEP_OPERAND_SIMM8P4 :
3506 fields->f_ivc2_8s4 = value;
3508 case MEP_OPERAND_SP :
3510 case MEP_OPERAND_SPR :
3512 case MEP_OPERAND_TP :
3514 case MEP_OPERAND_TPR :
3516 case MEP_OPERAND_UDISP2 :
3517 fields->f_2u6 = value;
3519 case MEP_OPERAND_UDISP7 :
3520 fields->f_7u9 = value;
3522 case MEP_OPERAND_UDISP7A2 :
3523 fields->f_7u9a2 = value;
3525 case MEP_OPERAND_UDISP7A4 :
3526 fields->f_7u9a4 = value;
3528 case MEP_OPERAND_UIMM16 :
3529 fields->f_16u16 = value;
3531 case MEP_OPERAND_UIMM2 :
3532 fields->f_2u10 = value;
3534 case MEP_OPERAND_UIMM24 :
3535 fields->f_24u8n = value;
3537 case MEP_OPERAND_UIMM3 :
3538 fields->f_3u5 = value;
3540 case MEP_OPERAND_UIMM4 :
3541 fields->f_4u8 = value;
3543 case MEP_OPERAND_UIMM5 :
3544 fields->f_5u8 = value;
3546 case MEP_OPERAND_UIMM7A4 :
3547 fields->f_7u9a4 = value;
3549 case MEP_OPERAND_ZERO :
3553 /* xgettext:c-format */
3554 opcodes_error_handler
3555 (_("internal error: unrecognized field %d while setting vma operand"),
3561 /* Function to call before using the instruction builder tables. */
3564 mep_cgen_init_ibld_table (CGEN_CPU_DESC cd)
3566 cd->insert_handlers = & mep_cgen_insert_handlers[0];
3567 cd->extract_handlers = & mep_cgen_extract_handlers[0];
3569 cd->insert_operand = mep_cgen_insert_operand;
3570 cd->extract_operand = mep_cgen_extract_operand;
3572 cd->get_int_operand = mep_cgen_get_int_operand;
3573 cd->set_int_operand = mep_cgen_set_int_operand;
3574 cd->get_vma_operand = mep_cgen_get_vma_operand;
3575 cd->set_vma_operand = mep_cgen_set_vma_operand;