1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 /* Instruction building/extraction support for frv. -*- 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-2020 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, cd->endian);
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, cd->endian);
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)),
273 value, cd->insn_endian);
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, cd->endian);
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)
488 value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc);
491 #endif /* ! CGEN_INT_INSN_P */
493 /* Written this way to avoid undefined behaviour. */
494 mask = (((1L << (length - 1)) - 1) << 1) | 1;
498 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
499 && (value & (1L << (length - 1))))
507 /* Default insn extractor.
509 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
510 The extracted fields are stored in FIELDS.
511 EX_INFO is used to handle reading variable length insns.
512 Return the length of the insn in bits, or 0 if no match,
513 or -1 if an error occurs fetching data (memory_error_func will have
517 extract_insn_normal (CGEN_CPU_DESC cd,
518 const CGEN_INSN *insn,
519 CGEN_EXTRACT_INFO *ex_info,
520 CGEN_INSN_INT insn_value,
524 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
525 const CGEN_SYNTAX_CHAR_TYPE *syn;
527 CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn);
529 CGEN_INIT_EXTRACT (cd);
531 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
535 if (CGEN_SYNTAX_CHAR_P (*syn))
538 length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
539 ex_info, insn_value, fields, pc);
544 /* We recognized and successfully extracted this insn. */
545 return CGEN_INSN_BITSIZE (insn);
548 /* Machine generated code added here. */
550 const char * frv_cgen_insert_operand
551 (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
553 /* Main entry point for operand insertion.
555 This function is basically just a big switch statement. Earlier versions
556 used tables to look up the function to use, but
557 - if the table contains both assembler and disassembler functions then
558 the disassembler contains much of the assembler and vice-versa,
559 - there's a lot of inlining possibilities as things grow,
560 - using a switch statement avoids the function call overhead.
562 This function could be moved into `parse_insn_normal', but keeping it
563 separate makes clear the interface between `parse_insn_normal' and each of
564 the handlers. It's also needed by GAS to insert operands that couldn't be
565 resolved during parsing. */
568 frv_cgen_insert_operand (CGEN_CPU_DESC cd,
570 CGEN_FIELDS * fields,
571 CGEN_INSN_BYTES_PTR buffer,
572 bfd_vma pc ATTRIBUTE_UNUSED)
574 const char * errmsg = NULL;
575 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
579 case FRV_OPERAND_A0 :
580 errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
582 case FRV_OPERAND_A1 :
583 errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
585 case FRV_OPERAND_ACC40SI :
586 errmsg = insert_normal (cd, fields->f_ACC40Si, 0, 0, 17, 6, 32, total_length, buffer);
588 case FRV_OPERAND_ACC40SK :
589 errmsg = insert_normal (cd, fields->f_ACC40Sk, 0, 0, 30, 6, 32, total_length, buffer);
591 case FRV_OPERAND_ACC40UI :
592 errmsg = insert_normal (cd, fields->f_ACC40Ui, 0, 0, 17, 6, 32, total_length, buffer);
594 case FRV_OPERAND_ACC40UK :
595 errmsg = insert_normal (cd, fields->f_ACC40Uk, 0, 0, 30, 6, 32, total_length, buffer);
597 case FRV_OPERAND_ACCGI :
598 errmsg = insert_normal (cd, fields->f_ACCGi, 0, 0, 17, 6, 32, total_length, buffer);
600 case FRV_OPERAND_ACCGK :
601 errmsg = insert_normal (cd, fields->f_ACCGk, 0, 0, 30, 6, 32, total_length, buffer);
603 case FRV_OPERAND_CCI :
604 errmsg = insert_normal (cd, fields->f_CCi, 0, 0, 11, 3, 32, total_length, buffer);
606 case FRV_OPERAND_CPRDOUBLEK :
607 errmsg = insert_normal (cd, fields->f_CPRk, 0, 0, 30, 6, 32, total_length, buffer);
609 case FRV_OPERAND_CPRI :
610 errmsg = insert_normal (cd, fields->f_CPRi, 0, 0, 17, 6, 32, total_length, buffer);
612 case FRV_OPERAND_CPRJ :
613 errmsg = insert_normal (cd, fields->f_CPRj, 0, 0, 5, 6, 32, total_length, buffer);
615 case FRV_OPERAND_CPRK :
616 errmsg = insert_normal (cd, fields->f_CPRk, 0, 0, 30, 6, 32, total_length, buffer);
618 case FRV_OPERAND_CRI :
619 errmsg = insert_normal (cd, fields->f_CRi, 0, 0, 14, 3, 32, total_length, buffer);
621 case FRV_OPERAND_CRJ :
622 errmsg = insert_normal (cd, fields->f_CRj, 0, 0, 2, 3, 32, total_length, buffer);
624 case FRV_OPERAND_CRJ_FLOAT :
625 errmsg = insert_normal (cd, fields->f_CRj_float, 0, 0, 26, 2, 32, total_length, buffer);
627 case FRV_OPERAND_CRJ_INT :
629 long value = fields->f_CRj_int;
630 value = ((value) - (4));
631 errmsg = insert_normal (cd, value, 0, 0, 26, 2, 32, total_length, buffer);
634 case FRV_OPERAND_CRK :
635 errmsg = insert_normal (cd, fields->f_CRk, 0, 0, 27, 3, 32, total_length, buffer);
637 case FRV_OPERAND_FCCI_1 :
638 errmsg = insert_normal (cd, fields->f_FCCi_1, 0, 0, 11, 2, 32, total_length, buffer);
640 case FRV_OPERAND_FCCI_2 :
641 errmsg = insert_normal (cd, fields->f_FCCi_2, 0, 0, 26, 2, 32, total_length, buffer);
643 case FRV_OPERAND_FCCI_3 :
644 errmsg = insert_normal (cd, fields->f_FCCi_3, 0, 0, 1, 2, 32, total_length, buffer);
646 case FRV_OPERAND_FCCK :
647 errmsg = insert_normal (cd, fields->f_FCCk, 0, 0, 26, 2, 32, total_length, buffer);
649 case FRV_OPERAND_FRDOUBLEI :
650 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
652 case FRV_OPERAND_FRDOUBLEJ :
653 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
655 case FRV_OPERAND_FRDOUBLEK :
656 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
658 case FRV_OPERAND_FRI :
659 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
661 case FRV_OPERAND_FRINTI :
662 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
664 case FRV_OPERAND_FRINTIEVEN :
665 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
667 case FRV_OPERAND_FRINTJ :
668 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
670 case FRV_OPERAND_FRINTJEVEN :
671 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
673 case FRV_OPERAND_FRINTK :
674 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
676 case FRV_OPERAND_FRINTKEVEN :
677 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
679 case FRV_OPERAND_FRJ :
680 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
682 case FRV_OPERAND_FRK :
683 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
685 case FRV_OPERAND_FRKHI :
686 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
688 case FRV_OPERAND_FRKLO :
689 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
691 case FRV_OPERAND_GRDOUBLEK :
692 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
694 case FRV_OPERAND_GRI :
695 errmsg = insert_normal (cd, fields->f_GRi, 0, 0, 17, 6, 32, total_length, buffer);
697 case FRV_OPERAND_GRJ :
698 errmsg = insert_normal (cd, fields->f_GRj, 0, 0, 5, 6, 32, total_length, buffer);
700 case FRV_OPERAND_GRK :
701 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
703 case FRV_OPERAND_GRKHI :
704 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
706 case FRV_OPERAND_GRKLO :
707 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
709 case FRV_OPERAND_ICCI_1 :
710 errmsg = insert_normal (cd, fields->f_ICCi_1, 0, 0, 11, 2, 32, total_length, buffer);
712 case FRV_OPERAND_ICCI_2 :
713 errmsg = insert_normal (cd, fields->f_ICCi_2, 0, 0, 26, 2, 32, total_length, buffer);
715 case FRV_OPERAND_ICCI_3 :
716 errmsg = insert_normal (cd, fields->f_ICCi_3, 0, 0, 1, 2, 32, total_length, buffer);
718 case FRV_OPERAND_LI :
719 errmsg = insert_normal (cd, fields->f_LI, 0, 0, 25, 1, 32, total_length, buffer);
721 case FRV_OPERAND_LRAD :
722 errmsg = insert_normal (cd, fields->f_LRAD, 0, 0, 4, 1, 32, total_length, buffer);
724 case FRV_OPERAND_LRAE :
725 errmsg = insert_normal (cd, fields->f_LRAE, 0, 0, 5, 1, 32, total_length, buffer);
727 case FRV_OPERAND_LRAS :
728 errmsg = insert_normal (cd, fields->f_LRAS, 0, 0, 3, 1, 32, total_length, buffer);
730 case FRV_OPERAND_TLBPRL :
731 errmsg = insert_normal (cd, fields->f_TLBPRL, 0, 0, 25, 1, 32, total_length, buffer);
733 case FRV_OPERAND_TLBPROPX :
734 errmsg = insert_normal (cd, fields->f_TLBPRopx, 0, 0, 28, 3, 32, total_length, buffer);
736 case FRV_OPERAND_AE :
737 errmsg = insert_normal (cd, fields->f_ae, 0, 0, 25, 1, 32, total_length, buffer);
739 case FRV_OPERAND_CALLANN :
740 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
742 case FRV_OPERAND_CCOND :
743 errmsg = insert_normal (cd, fields->f_ccond, 0, 0, 12, 1, 32, total_length, buffer);
745 case FRV_OPERAND_COND :
746 errmsg = insert_normal (cd, fields->f_cond, 0, 0, 8, 1, 32, total_length, buffer);
748 case FRV_OPERAND_D12 :
749 errmsg = insert_normal (cd, fields->f_d12, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, buffer);
751 case FRV_OPERAND_DEBUG :
752 errmsg = insert_normal (cd, fields->f_debug, 0, 0, 25, 1, 32, total_length, buffer);
754 case FRV_OPERAND_EIR :
755 errmsg = insert_normal (cd, fields->f_eir, 0, 0, 17, 6, 32, total_length, buffer);
757 case FRV_OPERAND_HINT :
758 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
760 case FRV_OPERAND_HINT_NOT_TAKEN :
761 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
763 case FRV_OPERAND_HINT_TAKEN :
764 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
766 case FRV_OPERAND_LABEL16 :
768 long value = fields->f_label16;
769 value = ((SI) (((value) - (pc))) >> (2));
770 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, buffer);
773 case FRV_OPERAND_LABEL24 :
776 FLD (f_labelH6) = ((SI) (((FLD (f_label24)) - (pc))) >> (20));
777 FLD (f_labelL18) = ((((UINT) (((FLD (f_label24)) - (pc))) >> (2))) & (262143));
779 errmsg = insert_normal (cd, fields->f_labelH6, 0|(1<<CGEN_IFLD_SIGNED), 0, 30, 6, 32, total_length, buffer);
782 errmsg = insert_normal (cd, fields->f_labelL18, 0, 0, 17, 18, 32, total_length, buffer);
787 case FRV_OPERAND_LDANN :
788 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
790 case FRV_OPERAND_LDDANN :
791 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
793 case FRV_OPERAND_LOCK :
794 errmsg = insert_normal (cd, fields->f_lock, 0, 0, 25, 1, 32, total_length, buffer);
796 case FRV_OPERAND_PACK :
797 errmsg = insert_normal (cd, fields->f_pack, 0, 0, 31, 1, 32, total_length, buffer);
799 case FRV_OPERAND_S10 :
800 errmsg = insert_normal (cd, fields->f_s10, 0|(1<<CGEN_IFLD_SIGNED), 0, 9, 10, 32, total_length, buffer);
802 case FRV_OPERAND_S12 :
803 errmsg = insert_normal (cd, fields->f_d12, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, buffer);
805 case FRV_OPERAND_S16 :
806 errmsg = insert_normal (cd, fields->f_s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, buffer);
808 case FRV_OPERAND_S5 :
809 errmsg = insert_normal (cd, fields->f_s5, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 5, 32, total_length, buffer);
811 case FRV_OPERAND_S6 :
812 errmsg = insert_normal (cd, fields->f_s6, 0|(1<<CGEN_IFLD_SIGNED), 0, 5, 6, 32, total_length, buffer);
814 case FRV_OPERAND_S6_1 :
815 errmsg = insert_normal (cd, fields->f_s6_1, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 6, 32, total_length, buffer);
817 case FRV_OPERAND_SLO16 :
818 errmsg = insert_normal (cd, fields->f_s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, buffer);
820 case FRV_OPERAND_SPR :
823 FLD (f_spr_h) = ((UINT) (FLD (f_spr)) >> (6));
824 FLD (f_spr_l) = ((FLD (f_spr)) & (63));
826 errmsg = insert_normal (cd, fields->f_spr_h, 0, 0, 30, 6, 32, total_length, buffer);
829 errmsg = insert_normal (cd, fields->f_spr_l, 0, 0, 17, 6, 32, total_length, buffer);
834 case FRV_OPERAND_U12 :
837 FLD (f_u12_h) = ((SI) (FLD (f_u12)) >> (6));
838 FLD (f_u12_l) = ((FLD (f_u12)) & (63));
840 errmsg = insert_normal (cd, fields->f_u12_h, 0|(1<<CGEN_IFLD_SIGNED), 0, 17, 6, 32, total_length, buffer);
843 errmsg = insert_normal (cd, fields->f_u12_l, 0, 0, 5, 6, 32, total_length, buffer);
848 case FRV_OPERAND_U16 :
849 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
851 case FRV_OPERAND_U6 :
852 errmsg = insert_normal (cd, fields->f_u6, 0, 0, 5, 6, 32, total_length, buffer);
854 case FRV_OPERAND_UHI16 :
855 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
857 case FRV_OPERAND_ULO16 :
858 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
862 /* xgettext:c-format */
863 opcodes_error_handler
864 (_("internal error: unrecognized field %d while building insn"),
872 int frv_cgen_extract_operand
873 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
875 /* Main entry point for operand extraction.
876 The result is <= 0 for error, >0 for success.
877 ??? Actual values aren't well defined right now.
879 This function is basically just a big switch statement. Earlier versions
880 used tables to look up the function to use, but
881 - if the table contains both assembler and disassembler functions then
882 the disassembler contains much of the assembler and vice-versa,
883 - there's a lot of inlining possibilities as things grow,
884 - using a switch statement avoids the function call overhead.
886 This function could be moved into `print_insn_normal', but keeping it
887 separate makes clear the interface between `print_insn_normal' and each of
891 frv_cgen_extract_operand (CGEN_CPU_DESC cd,
893 CGEN_EXTRACT_INFO *ex_info,
894 CGEN_INSN_INT insn_value,
895 CGEN_FIELDS * fields,
898 /* Assume success (for those operands that are nops). */
900 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
904 case FRV_OPERAND_A0 :
905 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
907 case FRV_OPERAND_A1 :
908 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
910 case FRV_OPERAND_ACC40SI :
911 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACC40Si);
913 case FRV_OPERAND_ACC40SK :
914 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACC40Sk);
916 case FRV_OPERAND_ACC40UI :
917 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACC40Ui);
919 case FRV_OPERAND_ACC40UK :
920 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACC40Uk);
922 case FRV_OPERAND_ACCGI :
923 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACCGi);
925 case FRV_OPERAND_ACCGK :
926 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACCGk);
928 case FRV_OPERAND_CCI :
929 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 3, 32, total_length, pc, & fields->f_CCi);
931 case FRV_OPERAND_CPRDOUBLEK :
932 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_CPRk);
934 case FRV_OPERAND_CPRI :
935 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_CPRi);
937 case FRV_OPERAND_CPRJ :
938 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_CPRj);
940 case FRV_OPERAND_CPRK :
941 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_CPRk);
943 case FRV_OPERAND_CRI :
944 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_CRi);
946 case FRV_OPERAND_CRJ :
947 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 3, 32, total_length, pc, & fields->f_CRj);
949 case FRV_OPERAND_CRJ_FLOAT :
950 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_CRj_float);
952 case FRV_OPERAND_CRJ_INT :
955 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & value);
956 value = ((value) + (4));
957 fields->f_CRj_int = value;
960 case FRV_OPERAND_CRK :
961 length = extract_normal (cd, ex_info, insn_value, 0, 0, 27, 3, 32, total_length, pc, & fields->f_CRk);
963 case FRV_OPERAND_FCCI_1 :
964 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 2, 32, total_length, pc, & fields->f_FCCi_1);
966 case FRV_OPERAND_FCCI_2 :
967 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_FCCi_2);
969 case FRV_OPERAND_FCCI_3 :
970 length = extract_normal (cd, ex_info, insn_value, 0, 0, 1, 2, 32, total_length, pc, & fields->f_FCCi_3);
972 case FRV_OPERAND_FCCK :
973 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_FCCk);
975 case FRV_OPERAND_FRDOUBLEI :
976 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
978 case FRV_OPERAND_FRDOUBLEJ :
979 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
981 case FRV_OPERAND_FRDOUBLEK :
982 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
984 case FRV_OPERAND_FRI :
985 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
987 case FRV_OPERAND_FRINTI :
988 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
990 case FRV_OPERAND_FRINTIEVEN :
991 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
993 case FRV_OPERAND_FRINTJ :
994 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
996 case FRV_OPERAND_FRINTJEVEN :
997 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
999 case FRV_OPERAND_FRINTK :
1000 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1002 case FRV_OPERAND_FRINTKEVEN :
1003 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1005 case FRV_OPERAND_FRJ :
1006 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
1008 case FRV_OPERAND_FRK :
1009 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1011 case FRV_OPERAND_FRKHI :
1012 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1014 case FRV_OPERAND_FRKLO :
1015 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1017 case FRV_OPERAND_GRDOUBLEK :
1018 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1020 case FRV_OPERAND_GRI :
1021 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_GRi);
1023 case FRV_OPERAND_GRJ :
1024 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_GRj);
1026 case FRV_OPERAND_GRK :
1027 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1029 case FRV_OPERAND_GRKHI :
1030 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1032 case FRV_OPERAND_GRKLO :
1033 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1035 case FRV_OPERAND_ICCI_1 :
1036 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 2, 32, total_length, pc, & fields->f_ICCi_1);
1038 case FRV_OPERAND_ICCI_2 :
1039 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_ICCi_2);
1041 case FRV_OPERAND_ICCI_3 :
1042 length = extract_normal (cd, ex_info, insn_value, 0, 0, 1, 2, 32, total_length, pc, & fields->f_ICCi_3);
1044 case FRV_OPERAND_LI :
1045 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_LI);
1047 case FRV_OPERAND_LRAD :
1048 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 1, 32, total_length, pc, & fields->f_LRAD);
1050 case FRV_OPERAND_LRAE :
1051 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_LRAE);
1053 case FRV_OPERAND_LRAS :
1054 length = extract_normal (cd, ex_info, insn_value, 0, 0, 3, 1, 32, total_length, pc, & fields->f_LRAS);
1056 case FRV_OPERAND_TLBPRL :
1057 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_TLBPRL);
1059 case FRV_OPERAND_TLBPROPX :
1060 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 3, 32, total_length, pc, & fields->f_TLBPRopx);
1062 case FRV_OPERAND_AE :
1063 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_ae);
1065 case FRV_OPERAND_CALLANN :
1066 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1068 case FRV_OPERAND_CCOND :
1069 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 1, 32, total_length, pc, & fields->f_ccond);
1071 case FRV_OPERAND_COND :
1072 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 1, 32, total_length, pc, & fields->f_cond);
1074 case FRV_OPERAND_D12 :
1075 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, pc, & fields->f_d12);
1077 case FRV_OPERAND_DEBUG :
1078 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_debug);
1080 case FRV_OPERAND_EIR :
1081 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_eir);
1083 case FRV_OPERAND_HINT :
1084 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1086 case FRV_OPERAND_HINT_NOT_TAKEN :
1087 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1089 case FRV_OPERAND_HINT_TAKEN :
1090 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1092 case FRV_OPERAND_LABEL16 :
1095 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, pc, & value);
1096 value = ((((value) * (4))) + (pc));
1097 fields->f_label16 = value;
1100 case FRV_OPERAND_LABEL24 :
1102 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 30, 6, 32, total_length, pc, & fields->f_labelH6);
1103 if (length <= 0) break;
1104 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 18, 32, total_length, pc, & fields->f_labelL18);
1105 if (length <= 0) break;
1107 FLD (f_label24) = ((((((((FLD (f_labelH6)) * (((1) << (18))))) | (FLD (f_labelL18)))) * (4))) + (pc));
1111 case FRV_OPERAND_LDANN :
1112 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1114 case FRV_OPERAND_LDDANN :
1115 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1117 case FRV_OPERAND_LOCK :
1118 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_lock);
1120 case FRV_OPERAND_PACK :
1121 length = extract_normal (cd, ex_info, insn_value, 0, 0, 31, 1, 32, total_length, pc, & fields->f_pack);
1123 case FRV_OPERAND_S10 :
1124 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 9, 10, 32, total_length, pc, & fields->f_s10);
1126 case FRV_OPERAND_S12 :
1127 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, pc, & fields->f_d12);
1129 case FRV_OPERAND_S16 :
1130 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, pc, & fields->f_s16);
1132 case FRV_OPERAND_S5 :
1133 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 5, 32, total_length, pc, & fields->f_s5);
1135 case FRV_OPERAND_S6 :
1136 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 5, 6, 32, total_length, pc, & fields->f_s6);
1138 case FRV_OPERAND_S6_1 :
1139 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 6, 32, total_length, pc, & fields->f_s6_1);
1141 case FRV_OPERAND_SLO16 :
1142 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, pc, & fields->f_s16);
1144 case FRV_OPERAND_SPR :
1146 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_spr_h);
1147 if (length <= 0) break;
1148 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_spr_l);
1149 if (length <= 0) break;
1151 FLD (f_spr) = ((((FLD (f_spr_h)) << (6))) | (FLD (f_spr_l)));
1155 case FRV_OPERAND_U12 :
1157 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 17, 6, 32, total_length, pc, & fields->f_u12_h);
1158 if (length <= 0) break;
1159 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_u12_l);
1160 if (length <= 0) break;
1162 FLD (f_u12) = ((((FLD (f_u12_h)) * (64))) | (FLD (f_u12_l)));
1166 case FRV_OPERAND_U16 :
1167 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1169 case FRV_OPERAND_U6 :
1170 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_u6);
1172 case FRV_OPERAND_UHI16 :
1173 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1175 case FRV_OPERAND_ULO16 :
1176 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1180 /* xgettext:c-format */
1181 opcodes_error_handler
1182 (_("internal error: unrecognized field %d while decoding insn"),
1190 cgen_insert_fn * const frv_cgen_insert_handlers[] =
1195 cgen_extract_fn * const frv_cgen_extract_handlers[] =
1197 extract_insn_normal,
1200 int frv_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1201 bfd_vma frv_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1203 /* Getting values from cgen_fields is handled by a collection of functions.
1204 They are distinguished by the type of the VALUE argument they return.
1205 TODO: floating point, inlining support, remove cases where result type
1209 frv_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1211 const CGEN_FIELDS * fields)
1217 case FRV_OPERAND_A0 :
1218 value = fields->f_A;
1220 case FRV_OPERAND_A1 :
1221 value = fields->f_A;
1223 case FRV_OPERAND_ACC40SI :
1224 value = fields->f_ACC40Si;
1226 case FRV_OPERAND_ACC40SK :
1227 value = fields->f_ACC40Sk;
1229 case FRV_OPERAND_ACC40UI :
1230 value = fields->f_ACC40Ui;
1232 case FRV_OPERAND_ACC40UK :
1233 value = fields->f_ACC40Uk;
1235 case FRV_OPERAND_ACCGI :
1236 value = fields->f_ACCGi;
1238 case FRV_OPERAND_ACCGK :
1239 value = fields->f_ACCGk;
1241 case FRV_OPERAND_CCI :
1242 value = fields->f_CCi;
1244 case FRV_OPERAND_CPRDOUBLEK :
1245 value = fields->f_CPRk;
1247 case FRV_OPERAND_CPRI :
1248 value = fields->f_CPRi;
1250 case FRV_OPERAND_CPRJ :
1251 value = fields->f_CPRj;
1253 case FRV_OPERAND_CPRK :
1254 value = fields->f_CPRk;
1256 case FRV_OPERAND_CRI :
1257 value = fields->f_CRi;
1259 case FRV_OPERAND_CRJ :
1260 value = fields->f_CRj;
1262 case FRV_OPERAND_CRJ_FLOAT :
1263 value = fields->f_CRj_float;
1265 case FRV_OPERAND_CRJ_INT :
1266 value = fields->f_CRj_int;
1268 case FRV_OPERAND_CRK :
1269 value = fields->f_CRk;
1271 case FRV_OPERAND_FCCI_1 :
1272 value = fields->f_FCCi_1;
1274 case FRV_OPERAND_FCCI_2 :
1275 value = fields->f_FCCi_2;
1277 case FRV_OPERAND_FCCI_3 :
1278 value = fields->f_FCCi_3;
1280 case FRV_OPERAND_FCCK :
1281 value = fields->f_FCCk;
1283 case FRV_OPERAND_FRDOUBLEI :
1284 value = fields->f_FRi;
1286 case FRV_OPERAND_FRDOUBLEJ :
1287 value = fields->f_FRj;
1289 case FRV_OPERAND_FRDOUBLEK :
1290 value = fields->f_FRk;
1292 case FRV_OPERAND_FRI :
1293 value = fields->f_FRi;
1295 case FRV_OPERAND_FRINTI :
1296 value = fields->f_FRi;
1298 case FRV_OPERAND_FRINTIEVEN :
1299 value = fields->f_FRi;
1301 case FRV_OPERAND_FRINTJ :
1302 value = fields->f_FRj;
1304 case FRV_OPERAND_FRINTJEVEN :
1305 value = fields->f_FRj;
1307 case FRV_OPERAND_FRINTK :
1308 value = fields->f_FRk;
1310 case FRV_OPERAND_FRINTKEVEN :
1311 value = fields->f_FRk;
1313 case FRV_OPERAND_FRJ :
1314 value = fields->f_FRj;
1316 case FRV_OPERAND_FRK :
1317 value = fields->f_FRk;
1319 case FRV_OPERAND_FRKHI :
1320 value = fields->f_FRk;
1322 case FRV_OPERAND_FRKLO :
1323 value = fields->f_FRk;
1325 case FRV_OPERAND_GRDOUBLEK :
1326 value = fields->f_GRk;
1328 case FRV_OPERAND_GRI :
1329 value = fields->f_GRi;
1331 case FRV_OPERAND_GRJ :
1332 value = fields->f_GRj;
1334 case FRV_OPERAND_GRK :
1335 value = fields->f_GRk;
1337 case FRV_OPERAND_GRKHI :
1338 value = fields->f_GRk;
1340 case FRV_OPERAND_GRKLO :
1341 value = fields->f_GRk;
1343 case FRV_OPERAND_ICCI_1 :
1344 value = fields->f_ICCi_1;
1346 case FRV_OPERAND_ICCI_2 :
1347 value = fields->f_ICCi_2;
1349 case FRV_OPERAND_ICCI_3 :
1350 value = fields->f_ICCi_3;
1352 case FRV_OPERAND_LI :
1353 value = fields->f_LI;
1355 case FRV_OPERAND_LRAD :
1356 value = fields->f_LRAD;
1358 case FRV_OPERAND_LRAE :
1359 value = fields->f_LRAE;
1361 case FRV_OPERAND_LRAS :
1362 value = fields->f_LRAS;
1364 case FRV_OPERAND_TLBPRL :
1365 value = fields->f_TLBPRL;
1367 case FRV_OPERAND_TLBPROPX :
1368 value = fields->f_TLBPRopx;
1370 case FRV_OPERAND_AE :
1371 value = fields->f_ae;
1373 case FRV_OPERAND_CALLANN :
1374 value = fields->f_reloc_ann;
1376 case FRV_OPERAND_CCOND :
1377 value = fields->f_ccond;
1379 case FRV_OPERAND_COND :
1380 value = fields->f_cond;
1382 case FRV_OPERAND_D12 :
1383 value = fields->f_d12;
1385 case FRV_OPERAND_DEBUG :
1386 value = fields->f_debug;
1388 case FRV_OPERAND_EIR :
1389 value = fields->f_eir;
1391 case FRV_OPERAND_HINT :
1392 value = fields->f_hint;
1394 case FRV_OPERAND_HINT_NOT_TAKEN :
1395 value = fields->f_hint;
1397 case FRV_OPERAND_HINT_TAKEN :
1398 value = fields->f_hint;
1400 case FRV_OPERAND_LABEL16 :
1401 value = fields->f_label16;
1403 case FRV_OPERAND_LABEL24 :
1404 value = fields->f_label24;
1406 case FRV_OPERAND_LDANN :
1407 value = fields->f_reloc_ann;
1409 case FRV_OPERAND_LDDANN :
1410 value = fields->f_reloc_ann;
1412 case FRV_OPERAND_LOCK :
1413 value = fields->f_lock;
1415 case FRV_OPERAND_PACK :
1416 value = fields->f_pack;
1418 case FRV_OPERAND_S10 :
1419 value = fields->f_s10;
1421 case FRV_OPERAND_S12 :
1422 value = fields->f_d12;
1424 case FRV_OPERAND_S16 :
1425 value = fields->f_s16;
1427 case FRV_OPERAND_S5 :
1428 value = fields->f_s5;
1430 case FRV_OPERAND_S6 :
1431 value = fields->f_s6;
1433 case FRV_OPERAND_S6_1 :
1434 value = fields->f_s6_1;
1436 case FRV_OPERAND_SLO16 :
1437 value = fields->f_s16;
1439 case FRV_OPERAND_SPR :
1440 value = fields->f_spr;
1442 case FRV_OPERAND_U12 :
1443 value = fields->f_u12;
1445 case FRV_OPERAND_U16 :
1446 value = fields->f_u16;
1448 case FRV_OPERAND_U6 :
1449 value = fields->f_u6;
1451 case FRV_OPERAND_UHI16 :
1452 value = fields->f_u16;
1454 case FRV_OPERAND_ULO16 :
1455 value = fields->f_u16;
1459 /* xgettext:c-format */
1460 opcodes_error_handler
1461 (_("internal error: unrecognized field %d while getting int operand"),
1470 frv_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1472 const CGEN_FIELDS * fields)
1478 case FRV_OPERAND_A0 :
1479 value = fields->f_A;
1481 case FRV_OPERAND_A1 :
1482 value = fields->f_A;
1484 case FRV_OPERAND_ACC40SI :
1485 value = fields->f_ACC40Si;
1487 case FRV_OPERAND_ACC40SK :
1488 value = fields->f_ACC40Sk;
1490 case FRV_OPERAND_ACC40UI :
1491 value = fields->f_ACC40Ui;
1493 case FRV_OPERAND_ACC40UK :
1494 value = fields->f_ACC40Uk;
1496 case FRV_OPERAND_ACCGI :
1497 value = fields->f_ACCGi;
1499 case FRV_OPERAND_ACCGK :
1500 value = fields->f_ACCGk;
1502 case FRV_OPERAND_CCI :
1503 value = fields->f_CCi;
1505 case FRV_OPERAND_CPRDOUBLEK :
1506 value = fields->f_CPRk;
1508 case FRV_OPERAND_CPRI :
1509 value = fields->f_CPRi;
1511 case FRV_OPERAND_CPRJ :
1512 value = fields->f_CPRj;
1514 case FRV_OPERAND_CPRK :
1515 value = fields->f_CPRk;
1517 case FRV_OPERAND_CRI :
1518 value = fields->f_CRi;
1520 case FRV_OPERAND_CRJ :
1521 value = fields->f_CRj;
1523 case FRV_OPERAND_CRJ_FLOAT :
1524 value = fields->f_CRj_float;
1526 case FRV_OPERAND_CRJ_INT :
1527 value = fields->f_CRj_int;
1529 case FRV_OPERAND_CRK :
1530 value = fields->f_CRk;
1532 case FRV_OPERAND_FCCI_1 :
1533 value = fields->f_FCCi_1;
1535 case FRV_OPERAND_FCCI_2 :
1536 value = fields->f_FCCi_2;
1538 case FRV_OPERAND_FCCI_3 :
1539 value = fields->f_FCCi_3;
1541 case FRV_OPERAND_FCCK :
1542 value = fields->f_FCCk;
1544 case FRV_OPERAND_FRDOUBLEI :
1545 value = fields->f_FRi;
1547 case FRV_OPERAND_FRDOUBLEJ :
1548 value = fields->f_FRj;
1550 case FRV_OPERAND_FRDOUBLEK :
1551 value = fields->f_FRk;
1553 case FRV_OPERAND_FRI :
1554 value = fields->f_FRi;
1556 case FRV_OPERAND_FRINTI :
1557 value = fields->f_FRi;
1559 case FRV_OPERAND_FRINTIEVEN :
1560 value = fields->f_FRi;
1562 case FRV_OPERAND_FRINTJ :
1563 value = fields->f_FRj;
1565 case FRV_OPERAND_FRINTJEVEN :
1566 value = fields->f_FRj;
1568 case FRV_OPERAND_FRINTK :
1569 value = fields->f_FRk;
1571 case FRV_OPERAND_FRINTKEVEN :
1572 value = fields->f_FRk;
1574 case FRV_OPERAND_FRJ :
1575 value = fields->f_FRj;
1577 case FRV_OPERAND_FRK :
1578 value = fields->f_FRk;
1580 case FRV_OPERAND_FRKHI :
1581 value = fields->f_FRk;
1583 case FRV_OPERAND_FRKLO :
1584 value = fields->f_FRk;
1586 case FRV_OPERAND_GRDOUBLEK :
1587 value = fields->f_GRk;
1589 case FRV_OPERAND_GRI :
1590 value = fields->f_GRi;
1592 case FRV_OPERAND_GRJ :
1593 value = fields->f_GRj;
1595 case FRV_OPERAND_GRK :
1596 value = fields->f_GRk;
1598 case FRV_OPERAND_GRKHI :
1599 value = fields->f_GRk;
1601 case FRV_OPERAND_GRKLO :
1602 value = fields->f_GRk;
1604 case FRV_OPERAND_ICCI_1 :
1605 value = fields->f_ICCi_1;
1607 case FRV_OPERAND_ICCI_2 :
1608 value = fields->f_ICCi_2;
1610 case FRV_OPERAND_ICCI_3 :
1611 value = fields->f_ICCi_3;
1613 case FRV_OPERAND_LI :
1614 value = fields->f_LI;
1616 case FRV_OPERAND_LRAD :
1617 value = fields->f_LRAD;
1619 case FRV_OPERAND_LRAE :
1620 value = fields->f_LRAE;
1622 case FRV_OPERAND_LRAS :
1623 value = fields->f_LRAS;
1625 case FRV_OPERAND_TLBPRL :
1626 value = fields->f_TLBPRL;
1628 case FRV_OPERAND_TLBPROPX :
1629 value = fields->f_TLBPRopx;
1631 case FRV_OPERAND_AE :
1632 value = fields->f_ae;
1634 case FRV_OPERAND_CALLANN :
1635 value = fields->f_reloc_ann;
1637 case FRV_OPERAND_CCOND :
1638 value = fields->f_ccond;
1640 case FRV_OPERAND_COND :
1641 value = fields->f_cond;
1643 case FRV_OPERAND_D12 :
1644 value = fields->f_d12;
1646 case FRV_OPERAND_DEBUG :
1647 value = fields->f_debug;
1649 case FRV_OPERAND_EIR :
1650 value = fields->f_eir;
1652 case FRV_OPERAND_HINT :
1653 value = fields->f_hint;
1655 case FRV_OPERAND_HINT_NOT_TAKEN :
1656 value = fields->f_hint;
1658 case FRV_OPERAND_HINT_TAKEN :
1659 value = fields->f_hint;
1661 case FRV_OPERAND_LABEL16 :
1662 value = fields->f_label16;
1664 case FRV_OPERAND_LABEL24 :
1665 value = fields->f_label24;
1667 case FRV_OPERAND_LDANN :
1668 value = fields->f_reloc_ann;
1670 case FRV_OPERAND_LDDANN :
1671 value = fields->f_reloc_ann;
1673 case FRV_OPERAND_LOCK :
1674 value = fields->f_lock;
1676 case FRV_OPERAND_PACK :
1677 value = fields->f_pack;
1679 case FRV_OPERAND_S10 :
1680 value = fields->f_s10;
1682 case FRV_OPERAND_S12 :
1683 value = fields->f_d12;
1685 case FRV_OPERAND_S16 :
1686 value = fields->f_s16;
1688 case FRV_OPERAND_S5 :
1689 value = fields->f_s5;
1691 case FRV_OPERAND_S6 :
1692 value = fields->f_s6;
1694 case FRV_OPERAND_S6_1 :
1695 value = fields->f_s6_1;
1697 case FRV_OPERAND_SLO16 :
1698 value = fields->f_s16;
1700 case FRV_OPERAND_SPR :
1701 value = fields->f_spr;
1703 case FRV_OPERAND_U12 :
1704 value = fields->f_u12;
1706 case FRV_OPERAND_U16 :
1707 value = fields->f_u16;
1709 case FRV_OPERAND_U6 :
1710 value = fields->f_u6;
1712 case FRV_OPERAND_UHI16 :
1713 value = fields->f_u16;
1715 case FRV_OPERAND_ULO16 :
1716 value = fields->f_u16;
1720 /* xgettext:c-format */
1721 opcodes_error_handler
1722 (_("internal error: unrecognized field %d while getting vma operand"),
1730 void frv_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
1731 void frv_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
1733 /* Stuffing values in cgen_fields is handled by a collection of functions.
1734 They are distinguished by the type of the VALUE argument they accept.
1735 TODO: floating point, inlining support, remove cases where argument type
1739 frv_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1741 CGEN_FIELDS * fields,
1746 case FRV_OPERAND_A0 :
1747 fields->f_A = value;
1749 case FRV_OPERAND_A1 :
1750 fields->f_A = value;
1752 case FRV_OPERAND_ACC40SI :
1753 fields->f_ACC40Si = value;
1755 case FRV_OPERAND_ACC40SK :
1756 fields->f_ACC40Sk = value;
1758 case FRV_OPERAND_ACC40UI :
1759 fields->f_ACC40Ui = value;
1761 case FRV_OPERAND_ACC40UK :
1762 fields->f_ACC40Uk = value;
1764 case FRV_OPERAND_ACCGI :
1765 fields->f_ACCGi = value;
1767 case FRV_OPERAND_ACCGK :
1768 fields->f_ACCGk = value;
1770 case FRV_OPERAND_CCI :
1771 fields->f_CCi = value;
1773 case FRV_OPERAND_CPRDOUBLEK :
1774 fields->f_CPRk = value;
1776 case FRV_OPERAND_CPRI :
1777 fields->f_CPRi = value;
1779 case FRV_OPERAND_CPRJ :
1780 fields->f_CPRj = value;
1782 case FRV_OPERAND_CPRK :
1783 fields->f_CPRk = value;
1785 case FRV_OPERAND_CRI :
1786 fields->f_CRi = value;
1788 case FRV_OPERAND_CRJ :
1789 fields->f_CRj = value;
1791 case FRV_OPERAND_CRJ_FLOAT :
1792 fields->f_CRj_float = value;
1794 case FRV_OPERAND_CRJ_INT :
1795 fields->f_CRj_int = value;
1797 case FRV_OPERAND_CRK :
1798 fields->f_CRk = value;
1800 case FRV_OPERAND_FCCI_1 :
1801 fields->f_FCCi_1 = value;
1803 case FRV_OPERAND_FCCI_2 :
1804 fields->f_FCCi_2 = value;
1806 case FRV_OPERAND_FCCI_3 :
1807 fields->f_FCCi_3 = value;
1809 case FRV_OPERAND_FCCK :
1810 fields->f_FCCk = value;
1812 case FRV_OPERAND_FRDOUBLEI :
1813 fields->f_FRi = value;
1815 case FRV_OPERAND_FRDOUBLEJ :
1816 fields->f_FRj = value;
1818 case FRV_OPERAND_FRDOUBLEK :
1819 fields->f_FRk = value;
1821 case FRV_OPERAND_FRI :
1822 fields->f_FRi = value;
1824 case FRV_OPERAND_FRINTI :
1825 fields->f_FRi = value;
1827 case FRV_OPERAND_FRINTIEVEN :
1828 fields->f_FRi = value;
1830 case FRV_OPERAND_FRINTJ :
1831 fields->f_FRj = value;
1833 case FRV_OPERAND_FRINTJEVEN :
1834 fields->f_FRj = value;
1836 case FRV_OPERAND_FRINTK :
1837 fields->f_FRk = value;
1839 case FRV_OPERAND_FRINTKEVEN :
1840 fields->f_FRk = value;
1842 case FRV_OPERAND_FRJ :
1843 fields->f_FRj = value;
1845 case FRV_OPERAND_FRK :
1846 fields->f_FRk = value;
1848 case FRV_OPERAND_FRKHI :
1849 fields->f_FRk = value;
1851 case FRV_OPERAND_FRKLO :
1852 fields->f_FRk = value;
1854 case FRV_OPERAND_GRDOUBLEK :
1855 fields->f_GRk = value;
1857 case FRV_OPERAND_GRI :
1858 fields->f_GRi = value;
1860 case FRV_OPERAND_GRJ :
1861 fields->f_GRj = value;
1863 case FRV_OPERAND_GRK :
1864 fields->f_GRk = value;
1866 case FRV_OPERAND_GRKHI :
1867 fields->f_GRk = value;
1869 case FRV_OPERAND_GRKLO :
1870 fields->f_GRk = value;
1872 case FRV_OPERAND_ICCI_1 :
1873 fields->f_ICCi_1 = value;
1875 case FRV_OPERAND_ICCI_2 :
1876 fields->f_ICCi_2 = value;
1878 case FRV_OPERAND_ICCI_3 :
1879 fields->f_ICCi_3 = value;
1881 case FRV_OPERAND_LI :
1882 fields->f_LI = value;
1884 case FRV_OPERAND_LRAD :
1885 fields->f_LRAD = value;
1887 case FRV_OPERAND_LRAE :
1888 fields->f_LRAE = value;
1890 case FRV_OPERAND_LRAS :
1891 fields->f_LRAS = value;
1893 case FRV_OPERAND_TLBPRL :
1894 fields->f_TLBPRL = value;
1896 case FRV_OPERAND_TLBPROPX :
1897 fields->f_TLBPRopx = value;
1899 case FRV_OPERAND_AE :
1900 fields->f_ae = value;
1902 case FRV_OPERAND_CALLANN :
1903 fields->f_reloc_ann = value;
1905 case FRV_OPERAND_CCOND :
1906 fields->f_ccond = value;
1908 case FRV_OPERAND_COND :
1909 fields->f_cond = value;
1911 case FRV_OPERAND_D12 :
1912 fields->f_d12 = value;
1914 case FRV_OPERAND_DEBUG :
1915 fields->f_debug = value;
1917 case FRV_OPERAND_EIR :
1918 fields->f_eir = value;
1920 case FRV_OPERAND_HINT :
1921 fields->f_hint = value;
1923 case FRV_OPERAND_HINT_NOT_TAKEN :
1924 fields->f_hint = value;
1926 case FRV_OPERAND_HINT_TAKEN :
1927 fields->f_hint = value;
1929 case FRV_OPERAND_LABEL16 :
1930 fields->f_label16 = value;
1932 case FRV_OPERAND_LABEL24 :
1933 fields->f_label24 = value;
1935 case FRV_OPERAND_LDANN :
1936 fields->f_reloc_ann = value;
1938 case FRV_OPERAND_LDDANN :
1939 fields->f_reloc_ann = value;
1941 case FRV_OPERAND_LOCK :
1942 fields->f_lock = value;
1944 case FRV_OPERAND_PACK :
1945 fields->f_pack = value;
1947 case FRV_OPERAND_S10 :
1948 fields->f_s10 = value;
1950 case FRV_OPERAND_S12 :
1951 fields->f_d12 = value;
1953 case FRV_OPERAND_S16 :
1954 fields->f_s16 = value;
1956 case FRV_OPERAND_S5 :
1957 fields->f_s5 = value;
1959 case FRV_OPERAND_S6 :
1960 fields->f_s6 = value;
1962 case FRV_OPERAND_S6_1 :
1963 fields->f_s6_1 = value;
1965 case FRV_OPERAND_SLO16 :
1966 fields->f_s16 = value;
1968 case FRV_OPERAND_SPR :
1969 fields->f_spr = value;
1971 case FRV_OPERAND_U12 :
1972 fields->f_u12 = value;
1974 case FRV_OPERAND_U16 :
1975 fields->f_u16 = value;
1977 case FRV_OPERAND_U6 :
1978 fields->f_u6 = value;
1980 case FRV_OPERAND_UHI16 :
1981 fields->f_u16 = value;
1983 case FRV_OPERAND_ULO16 :
1984 fields->f_u16 = value;
1988 /* xgettext:c-format */
1989 opcodes_error_handler
1990 (_("internal error: unrecognized field %d while setting int operand"),
1997 frv_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1999 CGEN_FIELDS * fields,
2004 case FRV_OPERAND_A0 :
2005 fields->f_A = value;
2007 case FRV_OPERAND_A1 :
2008 fields->f_A = value;
2010 case FRV_OPERAND_ACC40SI :
2011 fields->f_ACC40Si = value;
2013 case FRV_OPERAND_ACC40SK :
2014 fields->f_ACC40Sk = value;
2016 case FRV_OPERAND_ACC40UI :
2017 fields->f_ACC40Ui = value;
2019 case FRV_OPERAND_ACC40UK :
2020 fields->f_ACC40Uk = value;
2022 case FRV_OPERAND_ACCGI :
2023 fields->f_ACCGi = value;
2025 case FRV_OPERAND_ACCGK :
2026 fields->f_ACCGk = value;
2028 case FRV_OPERAND_CCI :
2029 fields->f_CCi = value;
2031 case FRV_OPERAND_CPRDOUBLEK :
2032 fields->f_CPRk = value;
2034 case FRV_OPERAND_CPRI :
2035 fields->f_CPRi = value;
2037 case FRV_OPERAND_CPRJ :
2038 fields->f_CPRj = value;
2040 case FRV_OPERAND_CPRK :
2041 fields->f_CPRk = value;
2043 case FRV_OPERAND_CRI :
2044 fields->f_CRi = value;
2046 case FRV_OPERAND_CRJ :
2047 fields->f_CRj = value;
2049 case FRV_OPERAND_CRJ_FLOAT :
2050 fields->f_CRj_float = value;
2052 case FRV_OPERAND_CRJ_INT :
2053 fields->f_CRj_int = value;
2055 case FRV_OPERAND_CRK :
2056 fields->f_CRk = value;
2058 case FRV_OPERAND_FCCI_1 :
2059 fields->f_FCCi_1 = value;
2061 case FRV_OPERAND_FCCI_2 :
2062 fields->f_FCCi_2 = value;
2064 case FRV_OPERAND_FCCI_3 :
2065 fields->f_FCCi_3 = value;
2067 case FRV_OPERAND_FCCK :
2068 fields->f_FCCk = value;
2070 case FRV_OPERAND_FRDOUBLEI :
2071 fields->f_FRi = value;
2073 case FRV_OPERAND_FRDOUBLEJ :
2074 fields->f_FRj = value;
2076 case FRV_OPERAND_FRDOUBLEK :
2077 fields->f_FRk = value;
2079 case FRV_OPERAND_FRI :
2080 fields->f_FRi = value;
2082 case FRV_OPERAND_FRINTI :
2083 fields->f_FRi = value;
2085 case FRV_OPERAND_FRINTIEVEN :
2086 fields->f_FRi = value;
2088 case FRV_OPERAND_FRINTJ :
2089 fields->f_FRj = value;
2091 case FRV_OPERAND_FRINTJEVEN :
2092 fields->f_FRj = value;
2094 case FRV_OPERAND_FRINTK :
2095 fields->f_FRk = value;
2097 case FRV_OPERAND_FRINTKEVEN :
2098 fields->f_FRk = value;
2100 case FRV_OPERAND_FRJ :
2101 fields->f_FRj = value;
2103 case FRV_OPERAND_FRK :
2104 fields->f_FRk = value;
2106 case FRV_OPERAND_FRKHI :
2107 fields->f_FRk = value;
2109 case FRV_OPERAND_FRKLO :
2110 fields->f_FRk = value;
2112 case FRV_OPERAND_GRDOUBLEK :
2113 fields->f_GRk = value;
2115 case FRV_OPERAND_GRI :
2116 fields->f_GRi = value;
2118 case FRV_OPERAND_GRJ :
2119 fields->f_GRj = value;
2121 case FRV_OPERAND_GRK :
2122 fields->f_GRk = value;
2124 case FRV_OPERAND_GRKHI :
2125 fields->f_GRk = value;
2127 case FRV_OPERAND_GRKLO :
2128 fields->f_GRk = value;
2130 case FRV_OPERAND_ICCI_1 :
2131 fields->f_ICCi_1 = value;
2133 case FRV_OPERAND_ICCI_2 :
2134 fields->f_ICCi_2 = value;
2136 case FRV_OPERAND_ICCI_3 :
2137 fields->f_ICCi_3 = value;
2139 case FRV_OPERAND_LI :
2140 fields->f_LI = value;
2142 case FRV_OPERAND_LRAD :
2143 fields->f_LRAD = value;
2145 case FRV_OPERAND_LRAE :
2146 fields->f_LRAE = value;
2148 case FRV_OPERAND_LRAS :
2149 fields->f_LRAS = value;
2151 case FRV_OPERAND_TLBPRL :
2152 fields->f_TLBPRL = value;
2154 case FRV_OPERAND_TLBPROPX :
2155 fields->f_TLBPRopx = value;
2157 case FRV_OPERAND_AE :
2158 fields->f_ae = value;
2160 case FRV_OPERAND_CALLANN :
2161 fields->f_reloc_ann = value;
2163 case FRV_OPERAND_CCOND :
2164 fields->f_ccond = value;
2166 case FRV_OPERAND_COND :
2167 fields->f_cond = value;
2169 case FRV_OPERAND_D12 :
2170 fields->f_d12 = value;
2172 case FRV_OPERAND_DEBUG :
2173 fields->f_debug = value;
2175 case FRV_OPERAND_EIR :
2176 fields->f_eir = value;
2178 case FRV_OPERAND_HINT :
2179 fields->f_hint = value;
2181 case FRV_OPERAND_HINT_NOT_TAKEN :
2182 fields->f_hint = value;
2184 case FRV_OPERAND_HINT_TAKEN :
2185 fields->f_hint = value;
2187 case FRV_OPERAND_LABEL16 :
2188 fields->f_label16 = value;
2190 case FRV_OPERAND_LABEL24 :
2191 fields->f_label24 = value;
2193 case FRV_OPERAND_LDANN :
2194 fields->f_reloc_ann = value;
2196 case FRV_OPERAND_LDDANN :
2197 fields->f_reloc_ann = value;
2199 case FRV_OPERAND_LOCK :
2200 fields->f_lock = value;
2202 case FRV_OPERAND_PACK :
2203 fields->f_pack = value;
2205 case FRV_OPERAND_S10 :
2206 fields->f_s10 = value;
2208 case FRV_OPERAND_S12 :
2209 fields->f_d12 = value;
2211 case FRV_OPERAND_S16 :
2212 fields->f_s16 = value;
2214 case FRV_OPERAND_S5 :
2215 fields->f_s5 = value;
2217 case FRV_OPERAND_S6 :
2218 fields->f_s6 = value;
2220 case FRV_OPERAND_S6_1 :
2221 fields->f_s6_1 = value;
2223 case FRV_OPERAND_SLO16 :
2224 fields->f_s16 = value;
2226 case FRV_OPERAND_SPR :
2227 fields->f_spr = value;
2229 case FRV_OPERAND_U12 :
2230 fields->f_u12 = value;
2232 case FRV_OPERAND_U16 :
2233 fields->f_u16 = value;
2235 case FRV_OPERAND_U6 :
2236 fields->f_u6 = value;
2238 case FRV_OPERAND_UHI16 :
2239 fields->f_u16 = value;
2241 case FRV_OPERAND_ULO16 :
2242 fields->f_u16 = value;
2246 /* xgettext:c-format */
2247 opcodes_error_handler
2248 (_("internal error: unrecognized field %d while setting vma operand"),
2254 /* Function to call before using the instruction builder tables. */
2257 frv_cgen_init_ibld_table (CGEN_CPU_DESC cd)
2259 cd->insert_handlers = & frv_cgen_insert_handlers[0];
2260 cd->extract_handlers = & frv_cgen_extract_handlers[0];
2262 cd->insert_operand = frv_cgen_insert_operand;
2263 cd->extract_operand = frv_cgen_extract_operand;
2265 cd->get_int_operand = frv_cgen_get_int_operand;
2266 cd->set_int_operand = frv_cgen_set_int_operand;
2267 cd->get_vma_operand = frv_cgen_get_vma_operand;
2268 cd->set_vma_operand = frv_cgen_set_vma_operand;