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-2017 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 fprintf (stderr, _("Unrecognized field %d while building insn.\n"),
1220 int mep_cgen_extract_operand
1221 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
1223 /* Main entry point for operand extraction.
1224 The result is <= 0 for error, >0 for success.
1225 ??? Actual values aren't well defined right now.
1227 This function is basically just a big switch statement. Earlier versions
1228 used tables to look up the function to use, but
1229 - if the table contains both assembler and disassembler functions then
1230 the disassembler contains much of the assembler and vice-versa,
1231 - there's a lot of inlining possibilities as things grow,
1232 - using a switch statement avoids the function call overhead.
1234 This function could be moved into `print_insn_normal', but keeping it
1235 separate makes clear the interface between `print_insn_normal' and each of
1239 mep_cgen_extract_operand (CGEN_CPU_DESC cd,
1241 CGEN_EXTRACT_INFO *ex_info,
1242 CGEN_INSN_INT insn_value,
1243 CGEN_FIELDS * fields,
1246 /* Assume success (for those operands that are nops). */
1248 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
1252 case MEP_OPERAND_ADDR24A4 :
1254 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8a4n_hi);
1255 if (length <= 0) break;
1256 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 6, 32, total_length, pc, & fields->f_24u8a4n_lo);
1257 if (length <= 0) break;
1258 FLD (f_24u8a4n) = ((((FLD (f_24u8a4n_hi)) << (8))) | (((FLD (f_24u8a4n_lo)) << (2))));
1261 case MEP_OPERAND_C5RMUIMM20 :
1263 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_c5_rm);
1264 if (length <= 0) break;
1265 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1266 if (length <= 0) break;
1268 FLD (f_c5_rmuimm20) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rm)) << (16))));
1272 case MEP_OPERAND_C5RNMUIMM24 :
1274 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_c5_rnm);
1275 if (length <= 0) break;
1276 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16);
1277 if (length <= 0) break;
1279 FLD (f_c5_rnmuimm24) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rnm)) << (16))));
1283 case MEP_OPERAND_CALLNUM :
1285 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_5);
1286 if (length <= 0) break;
1287 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_6);
1288 if (length <= 0) break;
1289 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_7);
1290 if (length <= 0) break;
1291 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 1, 32, total_length, pc, & fields->f_11);
1292 if (length <= 0) break;
1293 FLD (f_callnum) = ((((FLD (f_5)) << (3))) | (((((FLD (f_6)) << (2))) | (((((FLD (f_7)) << (1))) | (FLD (f_11)))))));
1296 case MEP_OPERAND_CCCC :
1297 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1299 case MEP_OPERAND_CCRN :
1301 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ccrn_hi);
1302 if (length <= 0) break;
1303 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ccrn_lo);
1304 if (length <= 0) break;
1305 FLD (f_ccrn) = ((((FLD (f_ccrn_hi)) << (4))) | (FLD (f_ccrn_lo)));
1308 case MEP_OPERAND_CDISP10 :
1311 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1312 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)));
1313 fields->f_cdisp10 = value;
1316 case MEP_OPERAND_CDISP10A2 :
1319 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1320 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)));
1321 fields->f_cdisp10 = value;
1324 case MEP_OPERAND_CDISP10A4 :
1327 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1328 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)));
1329 fields->f_cdisp10 = value;
1332 case MEP_OPERAND_CDISP10A8 :
1335 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 22, 10, 32, total_length, pc, & value);
1336 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)));
1337 fields->f_cdisp10 = value;
1340 case MEP_OPERAND_CDISP12 :
1341 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 12, 32, total_length, pc, & fields->f_12s20);
1343 case MEP_OPERAND_CIMM4 :
1344 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1346 case MEP_OPERAND_CIMM5 :
1347 length = extract_normal (cd, ex_info, insn_value, 0, 0, 24, 5, 32, total_length, pc, & fields->f_5u24);
1349 case MEP_OPERAND_CODE16 :
1350 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1352 case MEP_OPERAND_CODE24 :
1354 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_24u4n_hi);
1355 if (length <= 0) break;
1356 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u4n_lo);
1357 if (length <= 0) break;
1358 FLD (f_24u4n) = ((((FLD (f_24u4n_hi)) << (16))) | (FLD (f_24u4n_lo)));
1361 case MEP_OPERAND_CP_FLAG :
1363 case MEP_OPERAND_CRN :
1364 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1366 case MEP_OPERAND_CRN64 :
1367 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crn);
1369 case MEP_OPERAND_CRNX :
1371 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1372 if (length <= 0) break;
1373 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1374 if (length <= 0) break;
1375 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1378 case MEP_OPERAND_CRNX64 :
1380 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 1, 32, total_length, pc, & fields->f_crnx_hi);
1381 if (length <= 0) break;
1382 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_crnx_lo);
1383 if (length <= 0) break;
1384 FLD (f_crnx) = ((((FLD (f_crnx_hi)) << (4))) | (FLD (f_crnx_lo)));
1387 case MEP_OPERAND_CROC :
1388 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1390 case MEP_OPERAND_CROP :
1391 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1393 case MEP_OPERAND_CRPC :
1394 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 5, 32, total_length, pc, & fields->f_ivc2_5u26);
1396 case MEP_OPERAND_CRPP :
1397 length = extract_normal (cd, ex_info, insn_value, 0, 0, 18, 5, 32, total_length, pc, & fields->f_ivc2_5u18);
1399 case MEP_OPERAND_CRQC :
1400 length = extract_normal (cd, ex_info, insn_value, 0, 0, 21, 5, 32, total_length, pc, & fields->f_ivc2_5u21);
1402 case MEP_OPERAND_CRQP :
1403 length = extract_normal (cd, ex_info, insn_value, 0, 0, 13, 5, 32, total_length, pc, & fields->f_ivc2_5u13);
1405 case MEP_OPERAND_CSRN :
1407 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1408 if (length <= 0) break;
1409 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1410 if (length <= 0) break;
1411 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1414 case MEP_OPERAND_CSRN_IDX :
1416 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & fields->f_csrn_hi);
1417 if (length <= 0) break;
1418 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_csrn_lo);
1419 if (length <= 0) break;
1420 FLD (f_csrn) = ((((FLD (f_csrn_hi)) << (4))) | (FLD (f_csrn_lo)));
1423 case MEP_OPERAND_DBG :
1425 case MEP_OPERAND_DEPC :
1427 case MEP_OPERAND_EPC :
1429 case MEP_OPERAND_EXC :
1431 case MEP_OPERAND_HI :
1433 case MEP_OPERAND_IMM16P0 :
1435 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1436 if (length <= 0) break;
1437 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1438 if (length <= 0) break;
1440 FLD (f_ivc2_imm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1444 case MEP_OPERAND_IMM3P12 :
1445 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 3, 32, total_length, pc, & fields->f_ivc2_3u12);
1447 case MEP_OPERAND_IMM3P25 :
1448 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 3, 32, total_length, pc, & fields->f_ivc2_3u25);
1450 case MEP_OPERAND_IMM3P4 :
1451 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 3, 32, total_length, pc, & fields->f_ivc2_3u4);
1453 case MEP_OPERAND_IMM3P5 :
1454 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_ivc2_3u5);
1456 case MEP_OPERAND_IMM3P9 :
1457 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 3, 32, total_length, pc, & fields->f_ivc2_3u9);
1459 case MEP_OPERAND_IMM4P10 :
1460 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 4, 32, total_length, pc, & fields->f_ivc2_4u10);
1462 case MEP_OPERAND_IMM4P4 :
1463 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_4u4);
1465 case MEP_OPERAND_IMM4P8 :
1466 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_ivc2_4u8);
1468 case MEP_OPERAND_IMM5P23 :
1469 length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 5, 32, total_length, pc, & fields->f_ivc2_5u23);
1471 case MEP_OPERAND_IMM5P3 :
1472 length = extract_normal (cd, ex_info, insn_value, 0, 0, 3, 5, 32, total_length, pc, & fields->f_ivc2_5u3);
1474 case MEP_OPERAND_IMM5P7 :
1475 length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 5, 32, total_length, pc, & fields->f_ivc2_5u7);
1477 case MEP_OPERAND_IMM5P8 :
1478 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_ivc2_5u8);
1480 case MEP_OPERAND_IMM6P2 :
1481 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 6, 32, total_length, pc, & fields->f_ivc2_6u2);
1483 case MEP_OPERAND_IMM6P6 :
1484 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 6, 32, total_length, pc, & fields->f_ivc2_6u6);
1486 case MEP_OPERAND_IMM8P0 :
1487 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1489 case MEP_OPERAND_IMM8P20 :
1490 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1492 case MEP_OPERAND_IMM8P4 :
1493 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8u4);
1495 case MEP_OPERAND_IVC_X_0_2 :
1496 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 2, 32, total_length, pc, & fields->f_ivc2_2u0);
1498 case MEP_OPERAND_IVC_X_0_3 :
1499 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 3, 32, total_length, pc, & fields->f_ivc2_3u0);
1501 case MEP_OPERAND_IVC_X_0_4 :
1502 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_4u0);
1504 case MEP_OPERAND_IVC_X_0_5 :
1505 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 5, 32, total_length, pc, & fields->f_ivc2_5u0);
1507 case MEP_OPERAND_IVC_X_6_1 :
1508 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_ivc2_1u6);
1510 case MEP_OPERAND_IVC_X_6_2 :
1511 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_ivc2_2u6);
1513 case MEP_OPERAND_IVC_X_6_3 :
1514 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 3, 32, total_length, pc, & fields->f_ivc2_3u6);
1516 case MEP_OPERAND_IVC2_ACC0_0 :
1518 case MEP_OPERAND_IVC2_ACC0_1 :
1520 case MEP_OPERAND_IVC2_ACC0_2 :
1522 case MEP_OPERAND_IVC2_ACC0_3 :
1524 case MEP_OPERAND_IVC2_ACC0_4 :
1526 case MEP_OPERAND_IVC2_ACC0_5 :
1528 case MEP_OPERAND_IVC2_ACC0_6 :
1530 case MEP_OPERAND_IVC2_ACC0_7 :
1532 case MEP_OPERAND_IVC2_ACC1_0 :
1534 case MEP_OPERAND_IVC2_ACC1_1 :
1536 case MEP_OPERAND_IVC2_ACC1_2 :
1538 case MEP_OPERAND_IVC2_ACC1_3 :
1540 case MEP_OPERAND_IVC2_ACC1_4 :
1542 case MEP_OPERAND_IVC2_ACC1_5 :
1544 case MEP_OPERAND_IVC2_ACC1_6 :
1546 case MEP_OPERAND_IVC2_ACC1_7 :
1548 case MEP_OPERAND_IVC2_CC :
1550 case MEP_OPERAND_IVC2_COFA0 :
1552 case MEP_OPERAND_IVC2_COFA1 :
1554 case MEP_OPERAND_IVC2_COFR0 :
1556 case MEP_OPERAND_IVC2_COFR1 :
1558 case MEP_OPERAND_IVC2_CSAR0 :
1560 case MEP_OPERAND_IVC2_CSAR1 :
1562 case MEP_OPERAND_IVC2C3CCRN :
1564 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_c3hi);
1565 if (length <= 0) break;
1566 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_c3lo);
1567 if (length <= 0) break;
1568 FLD (f_ivc2_ccrn_c3) = ((((FLD (f_ivc2_ccrn_c3hi)) << (4))) | (FLD (f_ivc2_ccrn_c3lo)));
1571 case MEP_OPERAND_IVC2CCRN :
1573 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 2, 32, total_length, pc, & fields->f_ivc2_ccrn_h2);
1574 if (length <= 0) break;
1575 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1576 if (length <= 0) break;
1577 FLD (f_ivc2_ccrn) = ((((FLD (f_ivc2_ccrn_h2)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1580 case MEP_OPERAND_IVC2CRN :
1582 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 1, 32, total_length, pc, & fields->f_ivc2_ccrn_h1);
1583 if (length <= 0) break;
1584 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 4, 32, total_length, pc, & fields->f_ivc2_ccrn_lo);
1585 if (length <= 0) break;
1586 FLD (f_ivc2_crnx) = ((((FLD (f_ivc2_ccrn_h1)) << (4))) | (FLD (f_ivc2_ccrn_lo)));
1589 case MEP_OPERAND_IVC2RM :
1590 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_ivc2_crm);
1592 case MEP_OPERAND_LO :
1594 case MEP_OPERAND_LP :
1596 case MEP_OPERAND_MB0 :
1598 case MEP_OPERAND_MB1 :
1600 case MEP_OPERAND_ME0 :
1602 case MEP_OPERAND_ME1 :
1604 case MEP_OPERAND_NPC :
1606 case MEP_OPERAND_OPT :
1608 case MEP_OPERAND_PCABS24A2 :
1610 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u5a2n_hi);
1611 if (length <= 0) break;
1612 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 7, 32, total_length, pc, & fields->f_24u5a2n_lo);
1613 if (length <= 0) break;
1614 FLD (f_24u5a2n) = ((((FLD (f_24u5a2n_hi)) << (8))) | (((FLD (f_24u5a2n_lo)) << (1))));
1617 case MEP_OPERAND_PCREL12A2 :
1620 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);
1621 value = ((((value) << (1))) + (pc));
1622 fields->f_12s4a2 = value;
1625 case MEP_OPERAND_PCREL17A2 :
1628 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);
1629 value = ((((value) << (1))) + (pc));
1630 fields->f_17s16a2 = value;
1633 case MEP_OPERAND_PCREL24A2 :
1635 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);
1636 if (length <= 0) break;
1637 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);
1638 if (length <= 0) break;
1639 FLD (f_24s5a2n) = ((((((FLD (f_24s5a2n_hi)) << (8))) | (((FLD (f_24s5a2n_lo)) << (1))))) + (pc));
1642 case MEP_OPERAND_PCREL8A2 :
1645 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);
1646 value = ((((value) << (1))) + (pc));
1647 fields->f_8s8a2 = value;
1650 case MEP_OPERAND_PSW :
1652 case MEP_OPERAND_R0 :
1654 case MEP_OPERAND_R1 :
1656 case MEP_OPERAND_RL :
1657 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_rl);
1659 case MEP_OPERAND_RL5 :
1660 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 4, 32, total_length, pc, & fields->f_rl5);
1662 case MEP_OPERAND_RM :
1663 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1665 case MEP_OPERAND_RMA :
1666 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm);
1668 case MEP_OPERAND_RN :
1669 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1671 case MEP_OPERAND_RN3 :
1672 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1674 case MEP_OPERAND_RN3C :
1675 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1677 case MEP_OPERAND_RN3L :
1678 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1680 case MEP_OPERAND_RN3S :
1681 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1683 case MEP_OPERAND_RN3UC :
1684 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1686 case MEP_OPERAND_RN3UL :
1687 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1689 case MEP_OPERAND_RN3US :
1690 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_rn3);
1692 case MEP_OPERAND_RNC :
1693 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1695 case MEP_OPERAND_RNL :
1696 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1698 case MEP_OPERAND_RNS :
1699 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1701 case MEP_OPERAND_RNUC :
1702 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1704 case MEP_OPERAND_RNUL :
1705 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1707 case MEP_OPERAND_RNUS :
1708 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn);
1710 case MEP_OPERAND_SAR :
1712 case MEP_OPERAND_SDISP16 :
1713 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1715 case MEP_OPERAND_SIMM16 :
1716 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 16, 16, 32, total_length, pc, & fields->f_16s16);
1718 case MEP_OPERAND_SIMM16P0 :
1720 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8u0);
1721 if (length <= 0) break;
1722 length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8u20);
1723 if (length <= 0) break;
1725 FLD (f_ivc2_simm16p0) = ((FLD (f_ivc2_8u20)) | (((FLD (f_ivc2_8u0)) << (8))));
1729 case MEP_OPERAND_SIMM6 :
1730 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 6, 32, total_length, pc, & fields->f_6s8);
1732 case MEP_OPERAND_SIMM8 :
1733 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 8, 8, 32, total_length, pc, & fields->f_8s8);
1735 case MEP_OPERAND_SIMM8P0 :
1736 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 0, 8, 32, total_length, pc, & fields->f_ivc2_8s0);
1738 case MEP_OPERAND_SIMM8P20 :
1739 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 20, 8, 32, total_length, pc, & fields->f_ivc2_8s20);
1741 case MEP_OPERAND_SIMM8P4 :
1742 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 8, 32, total_length, pc, & fields->f_ivc2_8s4);
1744 case MEP_OPERAND_SP :
1746 case MEP_OPERAND_SPR :
1748 case MEP_OPERAND_TP :
1750 case MEP_OPERAND_TPR :
1752 case MEP_OPERAND_UDISP2 :
1753 length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 2, 32, total_length, pc, & fields->f_2u6);
1755 case MEP_OPERAND_UDISP7 :
1756 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 7, 32, total_length, pc, & fields->f_7u9);
1758 case MEP_OPERAND_UDISP7A2 :
1761 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 6, 32, total_length, pc, & value);
1762 value = ((value) << (1));
1763 fields->f_7u9a2 = value;
1766 case MEP_OPERAND_UDISP7A4 :
1769 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1770 value = ((value) << (2));
1771 fields->f_7u9a4 = value;
1774 case MEP_OPERAND_UIMM16 :
1775 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_16u16);
1777 case MEP_OPERAND_UIMM2 :
1778 length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 2, 32, total_length, pc, & fields->f_2u10);
1780 case MEP_OPERAND_UIMM24 :
1782 length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_24u8n_hi);
1783 if (length <= 0) break;
1784 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 8, 32, total_length, pc, & fields->f_24u8n_lo);
1785 if (length <= 0) break;
1786 FLD (f_24u8n) = ((((FLD (f_24u8n_hi)) << (8))) | (FLD (f_24u8n_lo)));
1789 case MEP_OPERAND_UIMM3 :
1790 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 3, 32, total_length, pc, & fields->f_3u5);
1792 case MEP_OPERAND_UIMM4 :
1793 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_4u8);
1795 case MEP_OPERAND_UIMM5 :
1796 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 5, 32, total_length, pc, & fields->f_5u8);
1798 case MEP_OPERAND_UIMM7A4 :
1801 length = extract_normal (cd, ex_info, insn_value, 0, 0, 9, 5, 32, total_length, pc, & value);
1802 value = ((value) << (2));
1803 fields->f_7u9a4 = value;
1806 case MEP_OPERAND_ZERO :
1810 /* xgettext:c-format */
1811 fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"),
1819 cgen_insert_fn * const mep_cgen_insert_handlers[] =
1824 cgen_extract_fn * const mep_cgen_extract_handlers[] =
1826 extract_insn_normal,
1829 int mep_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1830 bfd_vma mep_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1832 /* Getting values from cgen_fields is handled by a collection of functions.
1833 They are distinguished by the type of the VALUE argument they return.
1834 TODO: floating point, inlining support, remove cases where result type
1838 mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1840 const CGEN_FIELDS * fields)
1846 case MEP_OPERAND_ADDR24A4 :
1847 value = fields->f_24u8a4n;
1849 case MEP_OPERAND_C5RMUIMM20 :
1850 value = fields->f_c5_rmuimm20;
1852 case MEP_OPERAND_C5RNMUIMM24 :
1853 value = fields->f_c5_rnmuimm24;
1855 case MEP_OPERAND_CALLNUM :
1856 value = fields->f_callnum;
1858 case MEP_OPERAND_CCCC :
1859 value = fields->f_rm;
1861 case MEP_OPERAND_CCRN :
1862 value = fields->f_ccrn;
1864 case MEP_OPERAND_CDISP10 :
1865 value = fields->f_cdisp10;
1867 case MEP_OPERAND_CDISP10A2 :
1868 value = fields->f_cdisp10;
1870 case MEP_OPERAND_CDISP10A4 :
1871 value = fields->f_cdisp10;
1873 case MEP_OPERAND_CDISP10A8 :
1874 value = fields->f_cdisp10;
1876 case MEP_OPERAND_CDISP12 :
1877 value = fields->f_12s20;
1879 case MEP_OPERAND_CIMM4 :
1880 value = fields->f_rn;
1882 case MEP_OPERAND_CIMM5 :
1883 value = fields->f_5u24;
1885 case MEP_OPERAND_CODE16 :
1886 value = fields->f_16u16;
1888 case MEP_OPERAND_CODE24 :
1889 value = fields->f_24u4n;
1891 case MEP_OPERAND_CP_FLAG :
1894 case MEP_OPERAND_CRN :
1895 value = fields->f_crn;
1897 case MEP_OPERAND_CRN64 :
1898 value = fields->f_crn;
1900 case MEP_OPERAND_CRNX :
1901 value = fields->f_crnx;
1903 case MEP_OPERAND_CRNX64 :
1904 value = fields->f_crnx;
1906 case MEP_OPERAND_CROC :
1907 value = fields->f_ivc2_5u7;
1909 case MEP_OPERAND_CROP :
1910 value = fields->f_ivc2_5u23;
1912 case MEP_OPERAND_CRPC :
1913 value = fields->f_ivc2_5u26;
1915 case MEP_OPERAND_CRPP :
1916 value = fields->f_ivc2_5u18;
1918 case MEP_OPERAND_CRQC :
1919 value = fields->f_ivc2_5u21;
1921 case MEP_OPERAND_CRQP :
1922 value = fields->f_ivc2_5u13;
1924 case MEP_OPERAND_CSRN :
1925 value = fields->f_csrn;
1927 case MEP_OPERAND_CSRN_IDX :
1928 value = fields->f_csrn;
1930 case MEP_OPERAND_DBG :
1933 case MEP_OPERAND_DEPC :
1936 case MEP_OPERAND_EPC :
1939 case MEP_OPERAND_EXC :
1942 case MEP_OPERAND_HI :
1945 case MEP_OPERAND_IMM16P0 :
1946 value = fields->f_ivc2_imm16p0;
1948 case MEP_OPERAND_IMM3P12 :
1949 value = fields->f_ivc2_3u12;
1951 case MEP_OPERAND_IMM3P25 :
1952 value = fields->f_ivc2_3u25;
1954 case MEP_OPERAND_IMM3P4 :
1955 value = fields->f_ivc2_3u4;
1957 case MEP_OPERAND_IMM3P5 :
1958 value = fields->f_ivc2_3u5;
1960 case MEP_OPERAND_IMM3P9 :
1961 value = fields->f_ivc2_3u9;
1963 case MEP_OPERAND_IMM4P10 :
1964 value = fields->f_ivc2_4u10;
1966 case MEP_OPERAND_IMM4P4 :
1967 value = fields->f_ivc2_4u4;
1969 case MEP_OPERAND_IMM4P8 :
1970 value = fields->f_ivc2_4u8;
1972 case MEP_OPERAND_IMM5P23 :
1973 value = fields->f_ivc2_5u23;
1975 case MEP_OPERAND_IMM5P3 :
1976 value = fields->f_ivc2_5u3;
1978 case MEP_OPERAND_IMM5P7 :
1979 value = fields->f_ivc2_5u7;
1981 case MEP_OPERAND_IMM5P8 :
1982 value = fields->f_ivc2_5u8;
1984 case MEP_OPERAND_IMM6P2 :
1985 value = fields->f_ivc2_6u2;
1987 case MEP_OPERAND_IMM6P6 :
1988 value = fields->f_ivc2_6u6;
1990 case MEP_OPERAND_IMM8P0 :
1991 value = fields->f_ivc2_8u0;
1993 case MEP_OPERAND_IMM8P20 :
1994 value = fields->f_ivc2_8u20;
1996 case MEP_OPERAND_IMM8P4 :
1997 value = fields->f_ivc2_8u4;
1999 case MEP_OPERAND_IVC_X_0_2 :
2000 value = fields->f_ivc2_2u0;
2002 case MEP_OPERAND_IVC_X_0_3 :
2003 value = fields->f_ivc2_3u0;
2005 case MEP_OPERAND_IVC_X_0_4 :
2006 value = fields->f_ivc2_4u0;
2008 case MEP_OPERAND_IVC_X_0_5 :
2009 value = fields->f_ivc2_5u0;
2011 case MEP_OPERAND_IVC_X_6_1 :
2012 value = fields->f_ivc2_1u6;
2014 case MEP_OPERAND_IVC_X_6_2 :
2015 value = fields->f_ivc2_2u6;
2017 case MEP_OPERAND_IVC_X_6_3 :
2018 value = fields->f_ivc2_3u6;
2020 case MEP_OPERAND_IVC2_ACC0_0 :
2023 case MEP_OPERAND_IVC2_ACC0_1 :
2026 case MEP_OPERAND_IVC2_ACC0_2 :
2029 case MEP_OPERAND_IVC2_ACC0_3 :
2032 case MEP_OPERAND_IVC2_ACC0_4 :
2035 case MEP_OPERAND_IVC2_ACC0_5 :
2038 case MEP_OPERAND_IVC2_ACC0_6 :
2041 case MEP_OPERAND_IVC2_ACC0_7 :
2044 case MEP_OPERAND_IVC2_ACC1_0 :
2047 case MEP_OPERAND_IVC2_ACC1_1 :
2050 case MEP_OPERAND_IVC2_ACC1_2 :
2053 case MEP_OPERAND_IVC2_ACC1_3 :
2056 case MEP_OPERAND_IVC2_ACC1_4 :
2059 case MEP_OPERAND_IVC2_ACC1_5 :
2062 case MEP_OPERAND_IVC2_ACC1_6 :
2065 case MEP_OPERAND_IVC2_ACC1_7 :
2068 case MEP_OPERAND_IVC2_CC :
2071 case MEP_OPERAND_IVC2_COFA0 :
2074 case MEP_OPERAND_IVC2_COFA1 :
2077 case MEP_OPERAND_IVC2_COFR0 :
2080 case MEP_OPERAND_IVC2_COFR1 :
2083 case MEP_OPERAND_IVC2_CSAR0 :
2086 case MEP_OPERAND_IVC2_CSAR1 :
2089 case MEP_OPERAND_IVC2C3CCRN :
2090 value = fields->f_ivc2_ccrn_c3;
2092 case MEP_OPERAND_IVC2CCRN :
2093 value = fields->f_ivc2_ccrn;
2095 case MEP_OPERAND_IVC2CRN :
2096 value = fields->f_ivc2_crnx;
2098 case MEP_OPERAND_IVC2RM :
2099 value = fields->f_ivc2_crm;
2101 case MEP_OPERAND_LO :
2104 case MEP_OPERAND_LP :
2107 case MEP_OPERAND_MB0 :
2110 case MEP_OPERAND_MB1 :
2113 case MEP_OPERAND_ME0 :
2116 case MEP_OPERAND_ME1 :
2119 case MEP_OPERAND_NPC :
2122 case MEP_OPERAND_OPT :
2125 case MEP_OPERAND_PCABS24A2 :
2126 value = fields->f_24u5a2n;
2128 case MEP_OPERAND_PCREL12A2 :
2129 value = fields->f_12s4a2;
2131 case MEP_OPERAND_PCREL17A2 :
2132 value = fields->f_17s16a2;
2134 case MEP_OPERAND_PCREL24A2 :
2135 value = fields->f_24s5a2n;
2137 case MEP_OPERAND_PCREL8A2 :
2138 value = fields->f_8s8a2;
2140 case MEP_OPERAND_PSW :
2143 case MEP_OPERAND_R0 :
2146 case MEP_OPERAND_R1 :
2149 case MEP_OPERAND_RL :
2150 value = fields->f_rl;
2152 case MEP_OPERAND_RL5 :
2153 value = fields->f_rl5;
2155 case MEP_OPERAND_RM :
2156 value = fields->f_rm;
2158 case MEP_OPERAND_RMA :
2159 value = fields->f_rm;
2161 case MEP_OPERAND_RN :
2162 value = fields->f_rn;
2164 case MEP_OPERAND_RN3 :
2165 value = fields->f_rn3;
2167 case MEP_OPERAND_RN3C :
2168 value = fields->f_rn3;
2170 case MEP_OPERAND_RN3L :
2171 value = fields->f_rn3;
2173 case MEP_OPERAND_RN3S :
2174 value = fields->f_rn3;
2176 case MEP_OPERAND_RN3UC :
2177 value = fields->f_rn3;
2179 case MEP_OPERAND_RN3UL :
2180 value = fields->f_rn3;
2182 case MEP_OPERAND_RN3US :
2183 value = fields->f_rn3;
2185 case MEP_OPERAND_RNC :
2186 value = fields->f_rn;
2188 case MEP_OPERAND_RNL :
2189 value = fields->f_rn;
2191 case MEP_OPERAND_RNS :
2192 value = fields->f_rn;
2194 case MEP_OPERAND_RNUC :
2195 value = fields->f_rn;
2197 case MEP_OPERAND_RNUL :
2198 value = fields->f_rn;
2200 case MEP_OPERAND_RNUS :
2201 value = fields->f_rn;
2203 case MEP_OPERAND_SAR :
2206 case MEP_OPERAND_SDISP16 :
2207 value = fields->f_16s16;
2209 case MEP_OPERAND_SIMM16 :
2210 value = fields->f_16s16;
2212 case MEP_OPERAND_SIMM16P0 :
2213 value = fields->f_ivc2_simm16p0;
2215 case MEP_OPERAND_SIMM6 :
2216 value = fields->f_6s8;
2218 case MEP_OPERAND_SIMM8 :
2219 value = fields->f_8s8;
2221 case MEP_OPERAND_SIMM8P0 :
2222 value = fields->f_ivc2_8s0;
2224 case MEP_OPERAND_SIMM8P20 :
2225 value = fields->f_ivc2_8s20;
2227 case MEP_OPERAND_SIMM8P4 :
2228 value = fields->f_ivc2_8s4;
2230 case MEP_OPERAND_SP :
2233 case MEP_OPERAND_SPR :
2236 case MEP_OPERAND_TP :
2239 case MEP_OPERAND_TPR :
2242 case MEP_OPERAND_UDISP2 :
2243 value = fields->f_2u6;
2245 case MEP_OPERAND_UDISP7 :
2246 value = fields->f_7u9;
2248 case MEP_OPERAND_UDISP7A2 :
2249 value = fields->f_7u9a2;
2251 case MEP_OPERAND_UDISP7A4 :
2252 value = fields->f_7u9a4;
2254 case MEP_OPERAND_UIMM16 :
2255 value = fields->f_16u16;
2257 case MEP_OPERAND_UIMM2 :
2258 value = fields->f_2u10;
2260 case MEP_OPERAND_UIMM24 :
2261 value = fields->f_24u8n;
2263 case MEP_OPERAND_UIMM3 :
2264 value = fields->f_3u5;
2266 case MEP_OPERAND_UIMM4 :
2267 value = fields->f_4u8;
2269 case MEP_OPERAND_UIMM5 :
2270 value = fields->f_5u8;
2272 case MEP_OPERAND_UIMM7A4 :
2273 value = fields->f_7u9a4;
2275 case MEP_OPERAND_ZERO :
2280 /* xgettext:c-format */
2281 fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"),
2290 mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2292 const CGEN_FIELDS * fields)
2298 case MEP_OPERAND_ADDR24A4 :
2299 value = fields->f_24u8a4n;
2301 case MEP_OPERAND_C5RMUIMM20 :
2302 value = fields->f_c5_rmuimm20;
2304 case MEP_OPERAND_C5RNMUIMM24 :
2305 value = fields->f_c5_rnmuimm24;
2307 case MEP_OPERAND_CALLNUM :
2308 value = fields->f_callnum;
2310 case MEP_OPERAND_CCCC :
2311 value = fields->f_rm;
2313 case MEP_OPERAND_CCRN :
2314 value = fields->f_ccrn;
2316 case MEP_OPERAND_CDISP10 :
2317 value = fields->f_cdisp10;
2319 case MEP_OPERAND_CDISP10A2 :
2320 value = fields->f_cdisp10;
2322 case MEP_OPERAND_CDISP10A4 :
2323 value = fields->f_cdisp10;
2325 case MEP_OPERAND_CDISP10A8 :
2326 value = fields->f_cdisp10;
2328 case MEP_OPERAND_CDISP12 :
2329 value = fields->f_12s20;
2331 case MEP_OPERAND_CIMM4 :
2332 value = fields->f_rn;
2334 case MEP_OPERAND_CIMM5 :
2335 value = fields->f_5u24;
2337 case MEP_OPERAND_CODE16 :
2338 value = fields->f_16u16;
2340 case MEP_OPERAND_CODE24 :
2341 value = fields->f_24u4n;
2343 case MEP_OPERAND_CP_FLAG :
2346 case MEP_OPERAND_CRN :
2347 value = fields->f_crn;
2349 case MEP_OPERAND_CRN64 :
2350 value = fields->f_crn;
2352 case MEP_OPERAND_CRNX :
2353 value = fields->f_crnx;
2355 case MEP_OPERAND_CRNX64 :
2356 value = fields->f_crnx;
2358 case MEP_OPERAND_CROC :
2359 value = fields->f_ivc2_5u7;
2361 case MEP_OPERAND_CROP :
2362 value = fields->f_ivc2_5u23;
2364 case MEP_OPERAND_CRPC :
2365 value = fields->f_ivc2_5u26;
2367 case MEP_OPERAND_CRPP :
2368 value = fields->f_ivc2_5u18;
2370 case MEP_OPERAND_CRQC :
2371 value = fields->f_ivc2_5u21;
2373 case MEP_OPERAND_CRQP :
2374 value = fields->f_ivc2_5u13;
2376 case MEP_OPERAND_CSRN :
2377 value = fields->f_csrn;
2379 case MEP_OPERAND_CSRN_IDX :
2380 value = fields->f_csrn;
2382 case MEP_OPERAND_DBG :
2385 case MEP_OPERAND_DEPC :
2388 case MEP_OPERAND_EPC :
2391 case MEP_OPERAND_EXC :
2394 case MEP_OPERAND_HI :
2397 case MEP_OPERAND_IMM16P0 :
2398 value = fields->f_ivc2_imm16p0;
2400 case MEP_OPERAND_IMM3P12 :
2401 value = fields->f_ivc2_3u12;
2403 case MEP_OPERAND_IMM3P25 :
2404 value = fields->f_ivc2_3u25;
2406 case MEP_OPERAND_IMM3P4 :
2407 value = fields->f_ivc2_3u4;
2409 case MEP_OPERAND_IMM3P5 :
2410 value = fields->f_ivc2_3u5;
2412 case MEP_OPERAND_IMM3P9 :
2413 value = fields->f_ivc2_3u9;
2415 case MEP_OPERAND_IMM4P10 :
2416 value = fields->f_ivc2_4u10;
2418 case MEP_OPERAND_IMM4P4 :
2419 value = fields->f_ivc2_4u4;
2421 case MEP_OPERAND_IMM4P8 :
2422 value = fields->f_ivc2_4u8;
2424 case MEP_OPERAND_IMM5P23 :
2425 value = fields->f_ivc2_5u23;
2427 case MEP_OPERAND_IMM5P3 :
2428 value = fields->f_ivc2_5u3;
2430 case MEP_OPERAND_IMM5P7 :
2431 value = fields->f_ivc2_5u7;
2433 case MEP_OPERAND_IMM5P8 :
2434 value = fields->f_ivc2_5u8;
2436 case MEP_OPERAND_IMM6P2 :
2437 value = fields->f_ivc2_6u2;
2439 case MEP_OPERAND_IMM6P6 :
2440 value = fields->f_ivc2_6u6;
2442 case MEP_OPERAND_IMM8P0 :
2443 value = fields->f_ivc2_8u0;
2445 case MEP_OPERAND_IMM8P20 :
2446 value = fields->f_ivc2_8u20;
2448 case MEP_OPERAND_IMM8P4 :
2449 value = fields->f_ivc2_8u4;
2451 case MEP_OPERAND_IVC_X_0_2 :
2452 value = fields->f_ivc2_2u0;
2454 case MEP_OPERAND_IVC_X_0_3 :
2455 value = fields->f_ivc2_3u0;
2457 case MEP_OPERAND_IVC_X_0_4 :
2458 value = fields->f_ivc2_4u0;
2460 case MEP_OPERAND_IVC_X_0_5 :
2461 value = fields->f_ivc2_5u0;
2463 case MEP_OPERAND_IVC_X_6_1 :
2464 value = fields->f_ivc2_1u6;
2466 case MEP_OPERAND_IVC_X_6_2 :
2467 value = fields->f_ivc2_2u6;
2469 case MEP_OPERAND_IVC_X_6_3 :
2470 value = fields->f_ivc2_3u6;
2472 case MEP_OPERAND_IVC2_ACC0_0 :
2475 case MEP_OPERAND_IVC2_ACC0_1 :
2478 case MEP_OPERAND_IVC2_ACC0_2 :
2481 case MEP_OPERAND_IVC2_ACC0_3 :
2484 case MEP_OPERAND_IVC2_ACC0_4 :
2487 case MEP_OPERAND_IVC2_ACC0_5 :
2490 case MEP_OPERAND_IVC2_ACC0_6 :
2493 case MEP_OPERAND_IVC2_ACC0_7 :
2496 case MEP_OPERAND_IVC2_ACC1_0 :
2499 case MEP_OPERAND_IVC2_ACC1_1 :
2502 case MEP_OPERAND_IVC2_ACC1_2 :
2505 case MEP_OPERAND_IVC2_ACC1_3 :
2508 case MEP_OPERAND_IVC2_ACC1_4 :
2511 case MEP_OPERAND_IVC2_ACC1_5 :
2514 case MEP_OPERAND_IVC2_ACC1_6 :
2517 case MEP_OPERAND_IVC2_ACC1_7 :
2520 case MEP_OPERAND_IVC2_CC :
2523 case MEP_OPERAND_IVC2_COFA0 :
2526 case MEP_OPERAND_IVC2_COFA1 :
2529 case MEP_OPERAND_IVC2_COFR0 :
2532 case MEP_OPERAND_IVC2_COFR1 :
2535 case MEP_OPERAND_IVC2_CSAR0 :
2538 case MEP_OPERAND_IVC2_CSAR1 :
2541 case MEP_OPERAND_IVC2C3CCRN :
2542 value = fields->f_ivc2_ccrn_c3;
2544 case MEP_OPERAND_IVC2CCRN :
2545 value = fields->f_ivc2_ccrn;
2547 case MEP_OPERAND_IVC2CRN :
2548 value = fields->f_ivc2_crnx;
2550 case MEP_OPERAND_IVC2RM :
2551 value = fields->f_ivc2_crm;
2553 case MEP_OPERAND_LO :
2556 case MEP_OPERAND_LP :
2559 case MEP_OPERAND_MB0 :
2562 case MEP_OPERAND_MB1 :
2565 case MEP_OPERAND_ME0 :
2568 case MEP_OPERAND_ME1 :
2571 case MEP_OPERAND_NPC :
2574 case MEP_OPERAND_OPT :
2577 case MEP_OPERAND_PCABS24A2 :
2578 value = fields->f_24u5a2n;
2580 case MEP_OPERAND_PCREL12A2 :
2581 value = fields->f_12s4a2;
2583 case MEP_OPERAND_PCREL17A2 :
2584 value = fields->f_17s16a2;
2586 case MEP_OPERAND_PCREL24A2 :
2587 value = fields->f_24s5a2n;
2589 case MEP_OPERAND_PCREL8A2 :
2590 value = fields->f_8s8a2;
2592 case MEP_OPERAND_PSW :
2595 case MEP_OPERAND_R0 :
2598 case MEP_OPERAND_R1 :
2601 case MEP_OPERAND_RL :
2602 value = fields->f_rl;
2604 case MEP_OPERAND_RL5 :
2605 value = fields->f_rl5;
2607 case MEP_OPERAND_RM :
2608 value = fields->f_rm;
2610 case MEP_OPERAND_RMA :
2611 value = fields->f_rm;
2613 case MEP_OPERAND_RN :
2614 value = fields->f_rn;
2616 case MEP_OPERAND_RN3 :
2617 value = fields->f_rn3;
2619 case MEP_OPERAND_RN3C :
2620 value = fields->f_rn3;
2622 case MEP_OPERAND_RN3L :
2623 value = fields->f_rn3;
2625 case MEP_OPERAND_RN3S :
2626 value = fields->f_rn3;
2628 case MEP_OPERAND_RN3UC :
2629 value = fields->f_rn3;
2631 case MEP_OPERAND_RN3UL :
2632 value = fields->f_rn3;
2634 case MEP_OPERAND_RN3US :
2635 value = fields->f_rn3;
2637 case MEP_OPERAND_RNC :
2638 value = fields->f_rn;
2640 case MEP_OPERAND_RNL :
2641 value = fields->f_rn;
2643 case MEP_OPERAND_RNS :
2644 value = fields->f_rn;
2646 case MEP_OPERAND_RNUC :
2647 value = fields->f_rn;
2649 case MEP_OPERAND_RNUL :
2650 value = fields->f_rn;
2652 case MEP_OPERAND_RNUS :
2653 value = fields->f_rn;
2655 case MEP_OPERAND_SAR :
2658 case MEP_OPERAND_SDISP16 :
2659 value = fields->f_16s16;
2661 case MEP_OPERAND_SIMM16 :
2662 value = fields->f_16s16;
2664 case MEP_OPERAND_SIMM16P0 :
2665 value = fields->f_ivc2_simm16p0;
2667 case MEP_OPERAND_SIMM6 :
2668 value = fields->f_6s8;
2670 case MEP_OPERAND_SIMM8 :
2671 value = fields->f_8s8;
2673 case MEP_OPERAND_SIMM8P0 :
2674 value = fields->f_ivc2_8s0;
2676 case MEP_OPERAND_SIMM8P20 :
2677 value = fields->f_ivc2_8s20;
2679 case MEP_OPERAND_SIMM8P4 :
2680 value = fields->f_ivc2_8s4;
2682 case MEP_OPERAND_SP :
2685 case MEP_OPERAND_SPR :
2688 case MEP_OPERAND_TP :
2691 case MEP_OPERAND_TPR :
2694 case MEP_OPERAND_UDISP2 :
2695 value = fields->f_2u6;
2697 case MEP_OPERAND_UDISP7 :
2698 value = fields->f_7u9;
2700 case MEP_OPERAND_UDISP7A2 :
2701 value = fields->f_7u9a2;
2703 case MEP_OPERAND_UDISP7A4 :
2704 value = fields->f_7u9a4;
2706 case MEP_OPERAND_UIMM16 :
2707 value = fields->f_16u16;
2709 case MEP_OPERAND_UIMM2 :
2710 value = fields->f_2u10;
2712 case MEP_OPERAND_UIMM24 :
2713 value = fields->f_24u8n;
2715 case MEP_OPERAND_UIMM3 :
2716 value = fields->f_3u5;
2718 case MEP_OPERAND_UIMM4 :
2719 value = fields->f_4u8;
2721 case MEP_OPERAND_UIMM5 :
2722 value = fields->f_5u8;
2724 case MEP_OPERAND_UIMM7A4 :
2725 value = fields->f_7u9a4;
2727 case MEP_OPERAND_ZERO :
2732 /* xgettext:c-format */
2733 fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"),
2741 void mep_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
2742 void mep_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
2744 /* Stuffing values in cgen_fields is handled by a collection of functions.
2745 They are distinguished by the type of the VALUE argument they accept.
2746 TODO: floating point, inlining support, remove cases where argument type
2750 mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
2752 CGEN_FIELDS * fields,
2757 case MEP_OPERAND_ADDR24A4 :
2758 fields->f_24u8a4n = value;
2760 case MEP_OPERAND_C5RMUIMM20 :
2761 fields->f_c5_rmuimm20 = value;
2763 case MEP_OPERAND_C5RNMUIMM24 :
2764 fields->f_c5_rnmuimm24 = value;
2766 case MEP_OPERAND_CALLNUM :
2767 fields->f_callnum = value;
2769 case MEP_OPERAND_CCCC :
2770 fields->f_rm = value;
2772 case MEP_OPERAND_CCRN :
2773 fields->f_ccrn = value;
2775 case MEP_OPERAND_CDISP10 :
2776 fields->f_cdisp10 = value;
2778 case MEP_OPERAND_CDISP10A2 :
2779 fields->f_cdisp10 = value;
2781 case MEP_OPERAND_CDISP10A4 :
2782 fields->f_cdisp10 = value;
2784 case MEP_OPERAND_CDISP10A8 :
2785 fields->f_cdisp10 = value;
2787 case MEP_OPERAND_CDISP12 :
2788 fields->f_12s20 = value;
2790 case MEP_OPERAND_CIMM4 :
2791 fields->f_rn = value;
2793 case MEP_OPERAND_CIMM5 :
2794 fields->f_5u24 = value;
2796 case MEP_OPERAND_CODE16 :
2797 fields->f_16u16 = value;
2799 case MEP_OPERAND_CODE24 :
2800 fields->f_24u4n = value;
2802 case MEP_OPERAND_CP_FLAG :
2804 case MEP_OPERAND_CRN :
2805 fields->f_crn = value;
2807 case MEP_OPERAND_CRN64 :
2808 fields->f_crn = value;
2810 case MEP_OPERAND_CRNX :
2811 fields->f_crnx = value;
2813 case MEP_OPERAND_CRNX64 :
2814 fields->f_crnx = value;
2816 case MEP_OPERAND_CROC :
2817 fields->f_ivc2_5u7 = value;
2819 case MEP_OPERAND_CROP :
2820 fields->f_ivc2_5u23 = value;
2822 case MEP_OPERAND_CRPC :
2823 fields->f_ivc2_5u26 = value;
2825 case MEP_OPERAND_CRPP :
2826 fields->f_ivc2_5u18 = value;
2828 case MEP_OPERAND_CRQC :
2829 fields->f_ivc2_5u21 = value;
2831 case MEP_OPERAND_CRQP :
2832 fields->f_ivc2_5u13 = value;
2834 case MEP_OPERAND_CSRN :
2835 fields->f_csrn = value;
2837 case MEP_OPERAND_CSRN_IDX :
2838 fields->f_csrn = value;
2840 case MEP_OPERAND_DBG :
2842 case MEP_OPERAND_DEPC :
2844 case MEP_OPERAND_EPC :
2846 case MEP_OPERAND_EXC :
2848 case MEP_OPERAND_HI :
2850 case MEP_OPERAND_IMM16P0 :
2851 fields->f_ivc2_imm16p0 = value;
2853 case MEP_OPERAND_IMM3P12 :
2854 fields->f_ivc2_3u12 = value;
2856 case MEP_OPERAND_IMM3P25 :
2857 fields->f_ivc2_3u25 = value;
2859 case MEP_OPERAND_IMM3P4 :
2860 fields->f_ivc2_3u4 = value;
2862 case MEP_OPERAND_IMM3P5 :
2863 fields->f_ivc2_3u5 = value;
2865 case MEP_OPERAND_IMM3P9 :
2866 fields->f_ivc2_3u9 = value;
2868 case MEP_OPERAND_IMM4P10 :
2869 fields->f_ivc2_4u10 = value;
2871 case MEP_OPERAND_IMM4P4 :
2872 fields->f_ivc2_4u4 = value;
2874 case MEP_OPERAND_IMM4P8 :
2875 fields->f_ivc2_4u8 = value;
2877 case MEP_OPERAND_IMM5P23 :
2878 fields->f_ivc2_5u23 = value;
2880 case MEP_OPERAND_IMM5P3 :
2881 fields->f_ivc2_5u3 = value;
2883 case MEP_OPERAND_IMM5P7 :
2884 fields->f_ivc2_5u7 = value;
2886 case MEP_OPERAND_IMM5P8 :
2887 fields->f_ivc2_5u8 = value;
2889 case MEP_OPERAND_IMM6P2 :
2890 fields->f_ivc2_6u2 = value;
2892 case MEP_OPERAND_IMM6P6 :
2893 fields->f_ivc2_6u6 = value;
2895 case MEP_OPERAND_IMM8P0 :
2896 fields->f_ivc2_8u0 = value;
2898 case MEP_OPERAND_IMM8P20 :
2899 fields->f_ivc2_8u20 = value;
2901 case MEP_OPERAND_IMM8P4 :
2902 fields->f_ivc2_8u4 = value;
2904 case MEP_OPERAND_IVC_X_0_2 :
2905 fields->f_ivc2_2u0 = value;
2907 case MEP_OPERAND_IVC_X_0_3 :
2908 fields->f_ivc2_3u0 = value;
2910 case MEP_OPERAND_IVC_X_0_4 :
2911 fields->f_ivc2_4u0 = value;
2913 case MEP_OPERAND_IVC_X_0_5 :
2914 fields->f_ivc2_5u0 = value;
2916 case MEP_OPERAND_IVC_X_6_1 :
2917 fields->f_ivc2_1u6 = value;
2919 case MEP_OPERAND_IVC_X_6_2 :
2920 fields->f_ivc2_2u6 = value;
2922 case MEP_OPERAND_IVC_X_6_3 :
2923 fields->f_ivc2_3u6 = value;
2925 case MEP_OPERAND_IVC2_ACC0_0 :
2927 case MEP_OPERAND_IVC2_ACC0_1 :
2929 case MEP_OPERAND_IVC2_ACC0_2 :
2931 case MEP_OPERAND_IVC2_ACC0_3 :
2933 case MEP_OPERAND_IVC2_ACC0_4 :
2935 case MEP_OPERAND_IVC2_ACC0_5 :
2937 case MEP_OPERAND_IVC2_ACC0_6 :
2939 case MEP_OPERAND_IVC2_ACC0_7 :
2941 case MEP_OPERAND_IVC2_ACC1_0 :
2943 case MEP_OPERAND_IVC2_ACC1_1 :
2945 case MEP_OPERAND_IVC2_ACC1_2 :
2947 case MEP_OPERAND_IVC2_ACC1_3 :
2949 case MEP_OPERAND_IVC2_ACC1_4 :
2951 case MEP_OPERAND_IVC2_ACC1_5 :
2953 case MEP_OPERAND_IVC2_ACC1_6 :
2955 case MEP_OPERAND_IVC2_ACC1_7 :
2957 case MEP_OPERAND_IVC2_CC :
2959 case MEP_OPERAND_IVC2_COFA0 :
2961 case MEP_OPERAND_IVC2_COFA1 :
2963 case MEP_OPERAND_IVC2_COFR0 :
2965 case MEP_OPERAND_IVC2_COFR1 :
2967 case MEP_OPERAND_IVC2_CSAR0 :
2969 case MEP_OPERAND_IVC2_CSAR1 :
2971 case MEP_OPERAND_IVC2C3CCRN :
2972 fields->f_ivc2_ccrn_c3 = value;
2974 case MEP_OPERAND_IVC2CCRN :
2975 fields->f_ivc2_ccrn = value;
2977 case MEP_OPERAND_IVC2CRN :
2978 fields->f_ivc2_crnx = value;
2980 case MEP_OPERAND_IVC2RM :
2981 fields->f_ivc2_crm = value;
2983 case MEP_OPERAND_LO :
2985 case MEP_OPERAND_LP :
2987 case MEP_OPERAND_MB0 :
2989 case MEP_OPERAND_MB1 :
2991 case MEP_OPERAND_ME0 :
2993 case MEP_OPERAND_ME1 :
2995 case MEP_OPERAND_NPC :
2997 case MEP_OPERAND_OPT :
2999 case MEP_OPERAND_PCABS24A2 :
3000 fields->f_24u5a2n = value;
3002 case MEP_OPERAND_PCREL12A2 :
3003 fields->f_12s4a2 = value;
3005 case MEP_OPERAND_PCREL17A2 :
3006 fields->f_17s16a2 = value;
3008 case MEP_OPERAND_PCREL24A2 :
3009 fields->f_24s5a2n = value;
3011 case MEP_OPERAND_PCREL8A2 :
3012 fields->f_8s8a2 = value;
3014 case MEP_OPERAND_PSW :
3016 case MEP_OPERAND_R0 :
3018 case MEP_OPERAND_R1 :
3020 case MEP_OPERAND_RL :
3021 fields->f_rl = value;
3023 case MEP_OPERAND_RL5 :
3024 fields->f_rl5 = value;
3026 case MEP_OPERAND_RM :
3027 fields->f_rm = value;
3029 case MEP_OPERAND_RMA :
3030 fields->f_rm = value;
3032 case MEP_OPERAND_RN :
3033 fields->f_rn = value;
3035 case MEP_OPERAND_RN3 :
3036 fields->f_rn3 = value;
3038 case MEP_OPERAND_RN3C :
3039 fields->f_rn3 = value;
3041 case MEP_OPERAND_RN3L :
3042 fields->f_rn3 = value;
3044 case MEP_OPERAND_RN3S :
3045 fields->f_rn3 = value;
3047 case MEP_OPERAND_RN3UC :
3048 fields->f_rn3 = value;
3050 case MEP_OPERAND_RN3UL :
3051 fields->f_rn3 = value;
3053 case MEP_OPERAND_RN3US :
3054 fields->f_rn3 = value;
3056 case MEP_OPERAND_RNC :
3057 fields->f_rn = value;
3059 case MEP_OPERAND_RNL :
3060 fields->f_rn = value;
3062 case MEP_OPERAND_RNS :
3063 fields->f_rn = value;
3065 case MEP_OPERAND_RNUC :
3066 fields->f_rn = value;
3068 case MEP_OPERAND_RNUL :
3069 fields->f_rn = value;
3071 case MEP_OPERAND_RNUS :
3072 fields->f_rn = value;
3074 case MEP_OPERAND_SAR :
3076 case MEP_OPERAND_SDISP16 :
3077 fields->f_16s16 = value;
3079 case MEP_OPERAND_SIMM16 :
3080 fields->f_16s16 = value;
3082 case MEP_OPERAND_SIMM16P0 :
3083 fields->f_ivc2_simm16p0 = value;
3085 case MEP_OPERAND_SIMM6 :
3086 fields->f_6s8 = value;
3088 case MEP_OPERAND_SIMM8 :
3089 fields->f_8s8 = value;
3091 case MEP_OPERAND_SIMM8P0 :
3092 fields->f_ivc2_8s0 = value;
3094 case MEP_OPERAND_SIMM8P20 :
3095 fields->f_ivc2_8s20 = value;
3097 case MEP_OPERAND_SIMM8P4 :
3098 fields->f_ivc2_8s4 = value;
3100 case MEP_OPERAND_SP :
3102 case MEP_OPERAND_SPR :
3104 case MEP_OPERAND_TP :
3106 case MEP_OPERAND_TPR :
3108 case MEP_OPERAND_UDISP2 :
3109 fields->f_2u6 = value;
3111 case MEP_OPERAND_UDISP7 :
3112 fields->f_7u9 = value;
3114 case MEP_OPERAND_UDISP7A2 :
3115 fields->f_7u9a2 = value;
3117 case MEP_OPERAND_UDISP7A4 :
3118 fields->f_7u9a4 = value;
3120 case MEP_OPERAND_UIMM16 :
3121 fields->f_16u16 = value;
3123 case MEP_OPERAND_UIMM2 :
3124 fields->f_2u10 = value;
3126 case MEP_OPERAND_UIMM24 :
3127 fields->f_24u8n = value;
3129 case MEP_OPERAND_UIMM3 :
3130 fields->f_3u5 = value;
3132 case MEP_OPERAND_UIMM4 :
3133 fields->f_4u8 = value;
3135 case MEP_OPERAND_UIMM5 :
3136 fields->f_5u8 = value;
3138 case MEP_OPERAND_UIMM7A4 :
3139 fields->f_7u9a4 = value;
3141 case MEP_OPERAND_ZERO :
3145 /* xgettext:c-format */
3146 fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"),
3153 mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
3155 CGEN_FIELDS * fields,
3160 case MEP_OPERAND_ADDR24A4 :
3161 fields->f_24u8a4n = value;
3163 case MEP_OPERAND_C5RMUIMM20 :
3164 fields->f_c5_rmuimm20 = value;
3166 case MEP_OPERAND_C5RNMUIMM24 :
3167 fields->f_c5_rnmuimm24 = value;
3169 case MEP_OPERAND_CALLNUM :
3170 fields->f_callnum = value;
3172 case MEP_OPERAND_CCCC :
3173 fields->f_rm = value;
3175 case MEP_OPERAND_CCRN :
3176 fields->f_ccrn = value;
3178 case MEP_OPERAND_CDISP10 :
3179 fields->f_cdisp10 = value;
3181 case MEP_OPERAND_CDISP10A2 :
3182 fields->f_cdisp10 = value;
3184 case MEP_OPERAND_CDISP10A4 :
3185 fields->f_cdisp10 = value;
3187 case MEP_OPERAND_CDISP10A8 :
3188 fields->f_cdisp10 = value;
3190 case MEP_OPERAND_CDISP12 :
3191 fields->f_12s20 = value;
3193 case MEP_OPERAND_CIMM4 :
3194 fields->f_rn = value;
3196 case MEP_OPERAND_CIMM5 :
3197 fields->f_5u24 = value;
3199 case MEP_OPERAND_CODE16 :
3200 fields->f_16u16 = value;
3202 case MEP_OPERAND_CODE24 :
3203 fields->f_24u4n = value;
3205 case MEP_OPERAND_CP_FLAG :
3207 case MEP_OPERAND_CRN :
3208 fields->f_crn = value;
3210 case MEP_OPERAND_CRN64 :
3211 fields->f_crn = value;
3213 case MEP_OPERAND_CRNX :
3214 fields->f_crnx = value;
3216 case MEP_OPERAND_CRNX64 :
3217 fields->f_crnx = value;
3219 case MEP_OPERAND_CROC :
3220 fields->f_ivc2_5u7 = value;
3222 case MEP_OPERAND_CROP :
3223 fields->f_ivc2_5u23 = value;
3225 case MEP_OPERAND_CRPC :
3226 fields->f_ivc2_5u26 = value;
3228 case MEP_OPERAND_CRPP :
3229 fields->f_ivc2_5u18 = value;
3231 case MEP_OPERAND_CRQC :
3232 fields->f_ivc2_5u21 = value;
3234 case MEP_OPERAND_CRQP :
3235 fields->f_ivc2_5u13 = value;
3237 case MEP_OPERAND_CSRN :
3238 fields->f_csrn = value;
3240 case MEP_OPERAND_CSRN_IDX :
3241 fields->f_csrn = value;
3243 case MEP_OPERAND_DBG :
3245 case MEP_OPERAND_DEPC :
3247 case MEP_OPERAND_EPC :
3249 case MEP_OPERAND_EXC :
3251 case MEP_OPERAND_HI :
3253 case MEP_OPERAND_IMM16P0 :
3254 fields->f_ivc2_imm16p0 = value;
3256 case MEP_OPERAND_IMM3P12 :
3257 fields->f_ivc2_3u12 = value;
3259 case MEP_OPERAND_IMM3P25 :
3260 fields->f_ivc2_3u25 = value;
3262 case MEP_OPERAND_IMM3P4 :
3263 fields->f_ivc2_3u4 = value;
3265 case MEP_OPERAND_IMM3P5 :
3266 fields->f_ivc2_3u5 = value;
3268 case MEP_OPERAND_IMM3P9 :
3269 fields->f_ivc2_3u9 = value;
3271 case MEP_OPERAND_IMM4P10 :
3272 fields->f_ivc2_4u10 = value;
3274 case MEP_OPERAND_IMM4P4 :
3275 fields->f_ivc2_4u4 = value;
3277 case MEP_OPERAND_IMM4P8 :
3278 fields->f_ivc2_4u8 = value;
3280 case MEP_OPERAND_IMM5P23 :
3281 fields->f_ivc2_5u23 = value;
3283 case MEP_OPERAND_IMM5P3 :
3284 fields->f_ivc2_5u3 = value;
3286 case MEP_OPERAND_IMM5P7 :
3287 fields->f_ivc2_5u7 = value;
3289 case MEP_OPERAND_IMM5P8 :
3290 fields->f_ivc2_5u8 = value;
3292 case MEP_OPERAND_IMM6P2 :
3293 fields->f_ivc2_6u2 = value;
3295 case MEP_OPERAND_IMM6P6 :
3296 fields->f_ivc2_6u6 = value;
3298 case MEP_OPERAND_IMM8P0 :
3299 fields->f_ivc2_8u0 = value;
3301 case MEP_OPERAND_IMM8P20 :
3302 fields->f_ivc2_8u20 = value;
3304 case MEP_OPERAND_IMM8P4 :
3305 fields->f_ivc2_8u4 = value;
3307 case MEP_OPERAND_IVC_X_0_2 :
3308 fields->f_ivc2_2u0 = value;
3310 case MEP_OPERAND_IVC_X_0_3 :
3311 fields->f_ivc2_3u0 = value;
3313 case MEP_OPERAND_IVC_X_0_4 :
3314 fields->f_ivc2_4u0 = value;
3316 case MEP_OPERAND_IVC_X_0_5 :
3317 fields->f_ivc2_5u0 = value;
3319 case MEP_OPERAND_IVC_X_6_1 :
3320 fields->f_ivc2_1u6 = value;
3322 case MEP_OPERAND_IVC_X_6_2 :
3323 fields->f_ivc2_2u6 = value;
3325 case MEP_OPERAND_IVC_X_6_3 :
3326 fields->f_ivc2_3u6 = value;
3328 case MEP_OPERAND_IVC2_ACC0_0 :
3330 case MEP_OPERAND_IVC2_ACC0_1 :
3332 case MEP_OPERAND_IVC2_ACC0_2 :
3334 case MEP_OPERAND_IVC2_ACC0_3 :
3336 case MEP_OPERAND_IVC2_ACC0_4 :
3338 case MEP_OPERAND_IVC2_ACC0_5 :
3340 case MEP_OPERAND_IVC2_ACC0_6 :
3342 case MEP_OPERAND_IVC2_ACC0_7 :
3344 case MEP_OPERAND_IVC2_ACC1_0 :
3346 case MEP_OPERAND_IVC2_ACC1_1 :
3348 case MEP_OPERAND_IVC2_ACC1_2 :
3350 case MEP_OPERAND_IVC2_ACC1_3 :
3352 case MEP_OPERAND_IVC2_ACC1_4 :
3354 case MEP_OPERAND_IVC2_ACC1_5 :
3356 case MEP_OPERAND_IVC2_ACC1_6 :
3358 case MEP_OPERAND_IVC2_ACC1_7 :
3360 case MEP_OPERAND_IVC2_CC :
3362 case MEP_OPERAND_IVC2_COFA0 :
3364 case MEP_OPERAND_IVC2_COFA1 :
3366 case MEP_OPERAND_IVC2_COFR0 :
3368 case MEP_OPERAND_IVC2_COFR1 :
3370 case MEP_OPERAND_IVC2_CSAR0 :
3372 case MEP_OPERAND_IVC2_CSAR1 :
3374 case MEP_OPERAND_IVC2C3CCRN :
3375 fields->f_ivc2_ccrn_c3 = value;
3377 case MEP_OPERAND_IVC2CCRN :
3378 fields->f_ivc2_ccrn = value;
3380 case MEP_OPERAND_IVC2CRN :
3381 fields->f_ivc2_crnx = value;
3383 case MEP_OPERAND_IVC2RM :
3384 fields->f_ivc2_crm = value;
3386 case MEP_OPERAND_LO :
3388 case MEP_OPERAND_LP :
3390 case MEP_OPERAND_MB0 :
3392 case MEP_OPERAND_MB1 :
3394 case MEP_OPERAND_ME0 :
3396 case MEP_OPERAND_ME1 :
3398 case MEP_OPERAND_NPC :
3400 case MEP_OPERAND_OPT :
3402 case MEP_OPERAND_PCABS24A2 :
3403 fields->f_24u5a2n = value;
3405 case MEP_OPERAND_PCREL12A2 :
3406 fields->f_12s4a2 = value;
3408 case MEP_OPERAND_PCREL17A2 :
3409 fields->f_17s16a2 = value;
3411 case MEP_OPERAND_PCREL24A2 :
3412 fields->f_24s5a2n = value;
3414 case MEP_OPERAND_PCREL8A2 :
3415 fields->f_8s8a2 = value;
3417 case MEP_OPERAND_PSW :
3419 case MEP_OPERAND_R0 :
3421 case MEP_OPERAND_R1 :
3423 case MEP_OPERAND_RL :
3424 fields->f_rl = value;
3426 case MEP_OPERAND_RL5 :
3427 fields->f_rl5 = value;
3429 case MEP_OPERAND_RM :
3430 fields->f_rm = value;
3432 case MEP_OPERAND_RMA :
3433 fields->f_rm = value;
3435 case MEP_OPERAND_RN :
3436 fields->f_rn = value;
3438 case MEP_OPERAND_RN3 :
3439 fields->f_rn3 = value;
3441 case MEP_OPERAND_RN3C :
3442 fields->f_rn3 = value;
3444 case MEP_OPERAND_RN3L :
3445 fields->f_rn3 = value;
3447 case MEP_OPERAND_RN3S :
3448 fields->f_rn3 = value;
3450 case MEP_OPERAND_RN3UC :
3451 fields->f_rn3 = value;
3453 case MEP_OPERAND_RN3UL :
3454 fields->f_rn3 = value;
3456 case MEP_OPERAND_RN3US :
3457 fields->f_rn3 = value;
3459 case MEP_OPERAND_RNC :
3460 fields->f_rn = value;
3462 case MEP_OPERAND_RNL :
3463 fields->f_rn = value;
3465 case MEP_OPERAND_RNS :
3466 fields->f_rn = value;
3468 case MEP_OPERAND_RNUC :
3469 fields->f_rn = value;
3471 case MEP_OPERAND_RNUL :
3472 fields->f_rn = value;
3474 case MEP_OPERAND_RNUS :
3475 fields->f_rn = value;
3477 case MEP_OPERAND_SAR :
3479 case MEP_OPERAND_SDISP16 :
3480 fields->f_16s16 = value;
3482 case MEP_OPERAND_SIMM16 :
3483 fields->f_16s16 = value;
3485 case MEP_OPERAND_SIMM16P0 :
3486 fields->f_ivc2_simm16p0 = value;
3488 case MEP_OPERAND_SIMM6 :
3489 fields->f_6s8 = value;
3491 case MEP_OPERAND_SIMM8 :
3492 fields->f_8s8 = value;
3494 case MEP_OPERAND_SIMM8P0 :
3495 fields->f_ivc2_8s0 = value;
3497 case MEP_OPERAND_SIMM8P20 :
3498 fields->f_ivc2_8s20 = value;
3500 case MEP_OPERAND_SIMM8P4 :
3501 fields->f_ivc2_8s4 = value;
3503 case MEP_OPERAND_SP :
3505 case MEP_OPERAND_SPR :
3507 case MEP_OPERAND_TP :
3509 case MEP_OPERAND_TPR :
3511 case MEP_OPERAND_UDISP2 :
3512 fields->f_2u6 = value;
3514 case MEP_OPERAND_UDISP7 :
3515 fields->f_7u9 = value;
3517 case MEP_OPERAND_UDISP7A2 :
3518 fields->f_7u9a2 = value;
3520 case MEP_OPERAND_UDISP7A4 :
3521 fields->f_7u9a4 = value;
3523 case MEP_OPERAND_UIMM16 :
3524 fields->f_16u16 = value;
3526 case MEP_OPERAND_UIMM2 :
3527 fields->f_2u10 = value;
3529 case MEP_OPERAND_UIMM24 :
3530 fields->f_24u8n = value;
3532 case MEP_OPERAND_UIMM3 :
3533 fields->f_3u5 = value;
3535 case MEP_OPERAND_UIMM4 :
3536 fields->f_4u8 = value;
3538 case MEP_OPERAND_UIMM5 :
3539 fields->f_5u8 = value;
3541 case MEP_OPERAND_UIMM7A4 :
3542 fields->f_7u9a4 = value;
3544 case MEP_OPERAND_ZERO :
3548 /* xgettext:c-format */
3549 fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"),
3555 /* Function to call before using the instruction builder tables. */
3558 mep_cgen_init_ibld_table (CGEN_CPU_DESC cd)
3560 cd->insert_handlers = & mep_cgen_insert_handlers[0];
3561 cd->extract_handlers = & mep_cgen_extract_handlers[0];
3563 cd->insert_operand = mep_cgen_insert_operand;
3564 cd->extract_operand = mep_cgen_extract_operand;
3566 cd->get_int_operand = mep_cgen_get_int_operand;
3567 cd->set_int_operand = mep_cgen_set_int_operand;
3568 cd->get_vma_operand = mep_cgen_get_vma_operand;
3569 cd->set_vma_operand = mep_cgen_set_vma_operand;