1 /* Instruction building/extraction support for frv. -*- C -*-
3 THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
4 - the resultant file is machine generated, cgen-ibld.in isn't
6 Copyright (C) 1996-2016 Free Software Foundation, Inc.
8 This file is part of libopcodes.
10 This library is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
24 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
35 #include "cgen/basic-modes.h"
37 #include "safe-ctype.h"
40 #define min(a,b) ((a) < (b) ? (a) : (b))
42 #define max(a,b) ((a) > (b) ? (a) : (b))
44 /* Used by the ifield rtx function. */
45 #define FLD(f) (fields->f)
47 static const char * insert_normal
48 (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
49 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
50 static const char * insert_insn_normal
51 (CGEN_CPU_DESC, const CGEN_INSN *,
52 CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
53 static int extract_normal
54 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
55 unsigned int, unsigned int, unsigned int, unsigned int,
56 unsigned int, unsigned int, bfd_vma, long *);
57 static int extract_insn_normal
58 (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
59 CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
61 static void put_insn_int_value
62 (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
65 static CGEN_INLINE void insert_1
66 (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
67 static CGEN_INLINE int fill_cache
68 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
69 static CGEN_INLINE long extract_1
70 (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
73 /* Operand insertion. */
77 /* Subroutine of insert_normal. */
79 static CGEN_INLINE void
80 insert_1 (CGEN_CPU_DESC cd,
90 x = cgen_get_insn_value (cd, bufp, word_length);
92 /* Written this way to avoid undefined behaviour. */
93 mask = (((1L << (length - 1)) - 1) << 1) | 1;
95 shift = (start + 1) - length;
97 shift = (word_length - (start + length));
98 x = (x & ~(mask << shift)) | ((value & mask) << shift);
100 cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x);
103 #endif /* ! CGEN_INT_INSN_P */
105 /* Default insertion routine.
107 ATTRS is a mask of the boolean attributes.
108 WORD_OFFSET is the offset in bits from the start of the insn of the value.
109 WORD_LENGTH is the length of the word in bits in which the value resides.
110 START is the starting bit number in the word, architecture origin.
111 LENGTH is the length of VALUE in bits.
112 TOTAL_LENGTH is the total length of the insn in bits.
114 The result is an error message or NULL if success. */
116 /* ??? This duplicates functionality with bfd's howto table and
117 bfd_install_relocation. */
118 /* ??? This doesn't handle bfd_vma's. Create another function when
122 insert_normal (CGEN_CPU_DESC cd,
125 unsigned int word_offset,
128 unsigned int word_length,
129 unsigned int total_length,
130 CGEN_INSN_BYTES_PTR buffer)
132 static char errbuf[100];
133 /* Written this way to avoid undefined behaviour. */
134 unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1;
136 /* If LENGTH is zero, this operand doesn't contribute to the value. */
140 if (word_length > 8 * sizeof (CGEN_INSN_INT))
143 /* For architectures with insns smaller than the base-insn-bitsize,
144 word_length may be too big. */
145 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
148 && word_length > total_length)
149 word_length = total_length;
152 /* Ensure VALUE will fit. */
153 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
155 long minval = - (1L << (length - 1));
156 unsigned long maxval = mask;
158 if ((value > 0 && (unsigned long) value > maxval)
161 /* xgettext:c-format */
163 _("operand out of range (%ld not between %ld and %lu)"),
164 value, minval, maxval);
168 else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
170 unsigned long maxval = mask;
171 unsigned long val = (unsigned long) value;
173 /* For hosts with a word size > 32 check to see if value has been sign
174 extended beyond 32 bits. If so then ignore these higher sign bits
175 as the user is attempting to store a 32-bit signed value into an
176 unsigned 32-bit field which is allowed. */
177 if (sizeof (unsigned long) > 4 && ((value >> 32) == -1))
182 /* xgettext:c-format */
184 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
191 if (! cgen_signed_overflow_ok_p (cd))
193 long minval = - (1L << (length - 1));
194 long maxval = (1L << (length - 1)) - 1;
196 if (value < minval || value > maxval)
199 /* xgettext:c-format */
200 (errbuf, _("operand out of range (%ld not between %ld and %ld)"),
201 value, minval, maxval);
210 int shift_within_word, shift_to_word, shift;
212 /* How to shift the value to BIT0 of the word. */
213 shift_to_word = total_length - (word_offset + word_length);
215 /* How to shift the value to the field within the word. */
216 if (CGEN_INSN_LSB0_P)
217 shift_within_word = start + 1 - length;
219 shift_within_word = word_length - start - length;
221 /* The total SHIFT, then mask in the value. */
222 shift = shift_to_word + shift_within_word;
223 *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift);
226 #else /* ! CGEN_INT_INSN_P */
229 unsigned char *bufp = (unsigned char *) buffer + word_offset / 8;
231 insert_1 (cd, value, start, length, word_length, bufp);
234 #endif /* ! CGEN_INT_INSN_P */
239 /* Default insn builder (insert handler).
240 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
241 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
242 recorded in host byte order, otherwise BUFFER is an array of bytes
243 and the value is recorded in target byte order).
244 The result is an error message or NULL if success. */
247 insert_insn_normal (CGEN_CPU_DESC cd,
248 const CGEN_INSN * insn,
249 CGEN_FIELDS * fields,
250 CGEN_INSN_BYTES_PTR buffer,
253 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
255 const CGEN_SYNTAX_CHAR_TYPE * syn;
257 CGEN_INIT_INSERT (cd);
258 value = CGEN_INSN_BASE_VALUE (insn);
260 /* If we're recording insns as numbers (rather than a string of bytes),
261 target byte order handling is deferred until later. */
265 put_insn_int_value (cd, buffer, cd->base_insn_bitsize,
266 CGEN_FIELDS_BITSIZE (fields), value);
270 cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize,
271 (unsigned) CGEN_FIELDS_BITSIZE (fields)),
274 #endif /* ! CGEN_INT_INSN_P */
276 /* ??? It would be better to scan the format's fields.
277 Still need to be able to insert a value based on the operand though;
278 e.g. storing a branch displacement that got resolved later.
279 Needs more thought first. */
281 for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn)
285 if (CGEN_SYNTAX_CHAR_P (* syn))
288 errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
298 /* Cover function to store an insn value into an integral insn. Must go here
299 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
302 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
303 CGEN_INSN_BYTES_PTR buf,
308 /* For architectures with insns smaller than the base-insn-bitsize,
309 length may be too big. */
310 if (length > insn_length)
314 int shift = insn_length - length;
315 /* Written this way to avoid undefined behaviour. */
316 CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1;
318 *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
323 /* Operand extraction. */
325 #if ! CGEN_INT_INSN_P
327 /* Subroutine of extract_normal.
328 Ensure sufficient bytes are cached in EX_INFO.
329 OFFSET is the offset in bytes from the start of the insn of the value.
330 BYTES is the length of the needed value.
331 Returns 1 for success, 0 for failure. */
333 static CGEN_INLINE int
334 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
335 CGEN_EXTRACT_INFO *ex_info,
340 /* It's doubtful that the middle part has already been fetched so
341 we don't optimize that case. kiss. */
343 disassemble_info *info = (disassemble_info *) ex_info->dis_info;
345 /* First do a quick check. */
346 mask = (1 << bytes) - 1;
347 if (((ex_info->valid >> offset) & mask) == mask)
350 /* Search for the first byte we need to read. */
351 for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1)
352 if (! (mask & ex_info->valid))
360 status = (*info->read_memory_func)
361 (pc, ex_info->insn_bytes + offset, bytes, info);
365 (*info->memory_error_func) (status, pc, info);
369 ex_info->valid |= ((1 << bytes) - 1) << offset;
375 /* Subroutine of extract_normal. */
377 static CGEN_INLINE long
378 extract_1 (CGEN_CPU_DESC cd,
379 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
384 bfd_vma pc ATTRIBUTE_UNUSED)
389 x = cgen_get_insn_value (cd, bufp, word_length);
391 if (CGEN_INSN_LSB0_P)
392 shift = (start + 1) - length;
394 shift = (word_length - (start + length));
398 #endif /* ! CGEN_INT_INSN_P */
400 /* Default extraction routine.
402 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
403 or sometimes less for cases like the m32r where the base insn size is 32
404 but some insns are 16 bits.
405 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
406 but for generality we take a bitmask of all of them.
407 WORD_OFFSET is the offset in bits from the start of the insn of the value.
408 WORD_LENGTH is the length of the word in bits in which the value resides.
409 START is the starting bit number in the word, architecture origin.
410 LENGTH is the length of VALUE in bits.
411 TOTAL_LENGTH is the total length of the insn in bits.
413 Returns 1 for success, 0 for failure. */
415 /* ??? The return code isn't properly used. wip. */
417 /* ??? This doesn't handle bfd_vma's. Create another function when
421 extract_normal (CGEN_CPU_DESC cd,
422 #if ! CGEN_INT_INSN_P
423 CGEN_EXTRACT_INFO *ex_info,
425 CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
427 CGEN_INSN_INT insn_value,
429 unsigned int word_offset,
432 unsigned int word_length,
433 unsigned int total_length,
434 #if ! CGEN_INT_INSN_P
437 bfd_vma pc ATTRIBUTE_UNUSED,
443 /* If LENGTH is zero, this operand doesn't contribute to the value
444 so give it a standard value of zero. */
451 if (word_length > 8 * sizeof (CGEN_INSN_INT))
454 /* For architectures with insns smaller than the insn-base-bitsize,
455 word_length may be too big. */
456 if (cd->min_insn_bitsize < cd->base_insn_bitsize)
458 if (word_offset + word_length > total_length)
459 word_length = total_length - word_offset;
462 /* Does the value reside in INSN_VALUE, and at the right alignment? */
464 if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length))
466 if (CGEN_INSN_LSB0_P)
467 value = insn_value >> ((word_offset + start + 1) - length);
469 value = insn_value >> (total_length - ( word_offset + start + length));
472 #if ! CGEN_INT_INSN_P
476 unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
478 if (word_length > 8 * sizeof (CGEN_INSN_INT))
481 if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
484 value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc);
487 #endif /* ! CGEN_INT_INSN_P */
489 /* Written this way to avoid undefined behaviour. */
490 mask = (((1L << (length - 1)) - 1) << 1) | 1;
494 if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
495 && (value & (1L << (length - 1))))
503 /* Default insn extractor.
505 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
506 The extracted fields are stored in FIELDS.
507 EX_INFO is used to handle reading variable length insns.
508 Return the length of the insn in bits, or 0 if no match,
509 or -1 if an error occurs fetching data (memory_error_func will have
513 extract_insn_normal (CGEN_CPU_DESC cd,
514 const CGEN_INSN *insn,
515 CGEN_EXTRACT_INFO *ex_info,
516 CGEN_INSN_INT insn_value,
520 const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
521 const CGEN_SYNTAX_CHAR_TYPE *syn;
523 CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn);
525 CGEN_INIT_EXTRACT (cd);
527 for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
531 if (CGEN_SYNTAX_CHAR_P (*syn))
534 length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn),
535 ex_info, insn_value, fields, pc);
540 /* We recognized and successfully extracted this insn. */
541 return CGEN_INSN_BITSIZE (insn);
544 /* Machine generated code added here. */
546 const char * frv_cgen_insert_operand
547 (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
549 /* Main entry point for operand insertion.
551 This function is basically just a big switch statement. Earlier versions
552 used tables to look up the function to use, but
553 - if the table contains both assembler and disassembler functions then
554 the disassembler contains much of the assembler and vice-versa,
555 - there's a lot of inlining possibilities as things grow,
556 - using a switch statement avoids the function call overhead.
558 This function could be moved into `parse_insn_normal', but keeping it
559 separate makes clear the interface between `parse_insn_normal' and each of
560 the handlers. It's also needed by GAS to insert operands that couldn't be
561 resolved during parsing. */
564 frv_cgen_insert_operand (CGEN_CPU_DESC cd,
566 CGEN_FIELDS * fields,
567 CGEN_INSN_BYTES_PTR buffer,
568 bfd_vma pc ATTRIBUTE_UNUSED)
570 const char * errmsg = NULL;
571 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
575 case FRV_OPERAND_A0 :
576 errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
578 case FRV_OPERAND_A1 :
579 errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
581 case FRV_OPERAND_ACC40SI :
582 errmsg = insert_normal (cd, fields->f_ACC40Si, 0, 0, 17, 6, 32, total_length, buffer);
584 case FRV_OPERAND_ACC40SK :
585 errmsg = insert_normal (cd, fields->f_ACC40Sk, 0, 0, 30, 6, 32, total_length, buffer);
587 case FRV_OPERAND_ACC40UI :
588 errmsg = insert_normal (cd, fields->f_ACC40Ui, 0, 0, 17, 6, 32, total_length, buffer);
590 case FRV_OPERAND_ACC40UK :
591 errmsg = insert_normal (cd, fields->f_ACC40Uk, 0, 0, 30, 6, 32, total_length, buffer);
593 case FRV_OPERAND_ACCGI :
594 errmsg = insert_normal (cd, fields->f_ACCGi, 0, 0, 17, 6, 32, total_length, buffer);
596 case FRV_OPERAND_ACCGK :
597 errmsg = insert_normal (cd, fields->f_ACCGk, 0, 0, 30, 6, 32, total_length, buffer);
599 case FRV_OPERAND_CCI :
600 errmsg = insert_normal (cd, fields->f_CCi, 0, 0, 11, 3, 32, total_length, buffer);
602 case FRV_OPERAND_CPRDOUBLEK :
603 errmsg = insert_normal (cd, fields->f_CPRk, 0, 0, 30, 6, 32, total_length, buffer);
605 case FRV_OPERAND_CPRI :
606 errmsg = insert_normal (cd, fields->f_CPRi, 0, 0, 17, 6, 32, total_length, buffer);
608 case FRV_OPERAND_CPRJ :
609 errmsg = insert_normal (cd, fields->f_CPRj, 0, 0, 5, 6, 32, total_length, buffer);
611 case FRV_OPERAND_CPRK :
612 errmsg = insert_normal (cd, fields->f_CPRk, 0, 0, 30, 6, 32, total_length, buffer);
614 case FRV_OPERAND_CRI :
615 errmsg = insert_normal (cd, fields->f_CRi, 0, 0, 14, 3, 32, total_length, buffer);
617 case FRV_OPERAND_CRJ :
618 errmsg = insert_normal (cd, fields->f_CRj, 0, 0, 2, 3, 32, total_length, buffer);
620 case FRV_OPERAND_CRJ_FLOAT :
621 errmsg = insert_normal (cd, fields->f_CRj_float, 0, 0, 26, 2, 32, total_length, buffer);
623 case FRV_OPERAND_CRJ_INT :
625 long value = fields->f_CRj_int;
626 value = ((value) - (4));
627 errmsg = insert_normal (cd, value, 0, 0, 26, 2, 32, total_length, buffer);
630 case FRV_OPERAND_CRK :
631 errmsg = insert_normal (cd, fields->f_CRk, 0, 0, 27, 3, 32, total_length, buffer);
633 case FRV_OPERAND_FCCI_1 :
634 errmsg = insert_normal (cd, fields->f_FCCi_1, 0, 0, 11, 2, 32, total_length, buffer);
636 case FRV_OPERAND_FCCI_2 :
637 errmsg = insert_normal (cd, fields->f_FCCi_2, 0, 0, 26, 2, 32, total_length, buffer);
639 case FRV_OPERAND_FCCI_3 :
640 errmsg = insert_normal (cd, fields->f_FCCi_3, 0, 0, 1, 2, 32, total_length, buffer);
642 case FRV_OPERAND_FCCK :
643 errmsg = insert_normal (cd, fields->f_FCCk, 0, 0, 26, 2, 32, total_length, buffer);
645 case FRV_OPERAND_FRDOUBLEI :
646 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
648 case FRV_OPERAND_FRDOUBLEJ :
649 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
651 case FRV_OPERAND_FRDOUBLEK :
652 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
654 case FRV_OPERAND_FRI :
655 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
657 case FRV_OPERAND_FRINTI :
658 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
660 case FRV_OPERAND_FRINTIEVEN :
661 errmsg = insert_normal (cd, fields->f_FRi, 0, 0, 17, 6, 32, total_length, buffer);
663 case FRV_OPERAND_FRINTJ :
664 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
666 case FRV_OPERAND_FRINTJEVEN :
667 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
669 case FRV_OPERAND_FRINTK :
670 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
672 case FRV_OPERAND_FRINTKEVEN :
673 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
675 case FRV_OPERAND_FRJ :
676 errmsg = insert_normal (cd, fields->f_FRj, 0, 0, 5, 6, 32, total_length, buffer);
678 case FRV_OPERAND_FRK :
679 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
681 case FRV_OPERAND_FRKHI :
682 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
684 case FRV_OPERAND_FRKLO :
685 errmsg = insert_normal (cd, fields->f_FRk, 0, 0, 30, 6, 32, total_length, buffer);
687 case FRV_OPERAND_GRDOUBLEK :
688 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
690 case FRV_OPERAND_GRI :
691 errmsg = insert_normal (cd, fields->f_GRi, 0, 0, 17, 6, 32, total_length, buffer);
693 case FRV_OPERAND_GRJ :
694 errmsg = insert_normal (cd, fields->f_GRj, 0, 0, 5, 6, 32, total_length, buffer);
696 case FRV_OPERAND_GRK :
697 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
699 case FRV_OPERAND_GRKHI :
700 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
702 case FRV_OPERAND_GRKLO :
703 errmsg = insert_normal (cd, fields->f_GRk, 0, 0, 30, 6, 32, total_length, buffer);
705 case FRV_OPERAND_ICCI_1 :
706 errmsg = insert_normal (cd, fields->f_ICCi_1, 0, 0, 11, 2, 32, total_length, buffer);
708 case FRV_OPERAND_ICCI_2 :
709 errmsg = insert_normal (cd, fields->f_ICCi_2, 0, 0, 26, 2, 32, total_length, buffer);
711 case FRV_OPERAND_ICCI_3 :
712 errmsg = insert_normal (cd, fields->f_ICCi_3, 0, 0, 1, 2, 32, total_length, buffer);
714 case FRV_OPERAND_LI :
715 errmsg = insert_normal (cd, fields->f_LI, 0, 0, 25, 1, 32, total_length, buffer);
717 case FRV_OPERAND_LRAD :
718 errmsg = insert_normal (cd, fields->f_LRAD, 0, 0, 4, 1, 32, total_length, buffer);
720 case FRV_OPERAND_LRAE :
721 errmsg = insert_normal (cd, fields->f_LRAE, 0, 0, 5, 1, 32, total_length, buffer);
723 case FRV_OPERAND_LRAS :
724 errmsg = insert_normal (cd, fields->f_LRAS, 0, 0, 3, 1, 32, total_length, buffer);
726 case FRV_OPERAND_TLBPRL :
727 errmsg = insert_normal (cd, fields->f_TLBPRL, 0, 0, 25, 1, 32, total_length, buffer);
729 case FRV_OPERAND_TLBPROPX :
730 errmsg = insert_normal (cd, fields->f_TLBPRopx, 0, 0, 28, 3, 32, total_length, buffer);
732 case FRV_OPERAND_AE :
733 errmsg = insert_normal (cd, fields->f_ae, 0, 0, 25, 1, 32, total_length, buffer);
735 case FRV_OPERAND_CALLANN :
736 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
738 case FRV_OPERAND_CCOND :
739 errmsg = insert_normal (cd, fields->f_ccond, 0, 0, 12, 1, 32, total_length, buffer);
741 case FRV_OPERAND_COND :
742 errmsg = insert_normal (cd, fields->f_cond, 0, 0, 8, 1, 32, total_length, buffer);
744 case FRV_OPERAND_D12 :
745 errmsg = insert_normal (cd, fields->f_d12, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, buffer);
747 case FRV_OPERAND_DEBUG :
748 errmsg = insert_normal (cd, fields->f_debug, 0, 0, 25, 1, 32, total_length, buffer);
750 case FRV_OPERAND_EIR :
751 errmsg = insert_normal (cd, fields->f_eir, 0, 0, 17, 6, 32, total_length, buffer);
753 case FRV_OPERAND_HINT :
754 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
756 case FRV_OPERAND_HINT_NOT_TAKEN :
757 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
759 case FRV_OPERAND_HINT_TAKEN :
760 errmsg = insert_normal (cd, fields->f_hint, 0, 0, 17, 2, 32, total_length, buffer);
762 case FRV_OPERAND_LABEL16 :
764 long value = fields->f_label16;
765 value = ((SI) (((value) - (pc))) >> (2));
766 errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, buffer);
769 case FRV_OPERAND_LABEL24 :
772 FLD (f_labelH6) = ((SI) (((FLD (f_label24)) - (pc))) >> (20));
773 FLD (f_labelL18) = ((((UINT) (((FLD (f_label24)) - (pc))) >> (2))) & (262143));
775 errmsg = insert_normal (cd, fields->f_labelH6, 0|(1<<CGEN_IFLD_SIGNED), 0, 30, 6, 32, total_length, buffer);
778 errmsg = insert_normal (cd, fields->f_labelL18, 0, 0, 17, 18, 32, total_length, buffer);
783 case FRV_OPERAND_LDANN :
784 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
786 case FRV_OPERAND_LDDANN :
787 errmsg = insert_normal (cd, fields->f_reloc_ann, 0, 0, 0, 0, 32, total_length, buffer);
789 case FRV_OPERAND_LOCK :
790 errmsg = insert_normal (cd, fields->f_lock, 0, 0, 25, 1, 32, total_length, buffer);
792 case FRV_OPERAND_PACK :
793 errmsg = insert_normal (cd, fields->f_pack, 0, 0, 31, 1, 32, total_length, buffer);
795 case FRV_OPERAND_S10 :
796 errmsg = insert_normal (cd, fields->f_s10, 0|(1<<CGEN_IFLD_SIGNED), 0, 9, 10, 32, total_length, buffer);
798 case FRV_OPERAND_S12 :
799 errmsg = insert_normal (cd, fields->f_d12, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, buffer);
801 case FRV_OPERAND_S16 :
802 errmsg = insert_normal (cd, fields->f_s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, buffer);
804 case FRV_OPERAND_S5 :
805 errmsg = insert_normal (cd, fields->f_s5, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 5, 32, total_length, buffer);
807 case FRV_OPERAND_S6 :
808 errmsg = insert_normal (cd, fields->f_s6, 0|(1<<CGEN_IFLD_SIGNED), 0, 5, 6, 32, total_length, buffer);
810 case FRV_OPERAND_S6_1 :
811 errmsg = insert_normal (cd, fields->f_s6_1, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 6, 32, total_length, buffer);
813 case FRV_OPERAND_SLO16 :
814 errmsg = insert_normal (cd, fields->f_s16, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, buffer);
816 case FRV_OPERAND_SPR :
819 FLD (f_spr_h) = ((UINT) (FLD (f_spr)) >> (6));
820 FLD (f_spr_l) = ((FLD (f_spr)) & (63));
822 errmsg = insert_normal (cd, fields->f_spr_h, 0, 0, 30, 6, 32, total_length, buffer);
825 errmsg = insert_normal (cd, fields->f_spr_l, 0, 0, 17, 6, 32, total_length, buffer);
830 case FRV_OPERAND_U12 :
833 FLD (f_u12_h) = ((SI) (FLD (f_u12)) >> (6));
834 FLD (f_u12_l) = ((FLD (f_u12)) & (63));
836 errmsg = insert_normal (cd, fields->f_u12_h, 0|(1<<CGEN_IFLD_SIGNED), 0, 17, 6, 32, total_length, buffer);
839 errmsg = insert_normal (cd, fields->f_u12_l, 0, 0, 5, 6, 32, total_length, buffer);
844 case FRV_OPERAND_U16 :
845 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
847 case FRV_OPERAND_U6 :
848 errmsg = insert_normal (cd, fields->f_u6, 0, 0, 5, 6, 32, total_length, buffer);
850 case FRV_OPERAND_UHI16 :
851 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
853 case FRV_OPERAND_ULO16 :
854 errmsg = insert_normal (cd, fields->f_u16, 0, 0, 15, 16, 32, total_length, buffer);
858 /* xgettext:c-format */
859 fprintf (stderr, _("Unrecognized field %d while building insn.\n"),
867 int frv_cgen_extract_operand
868 (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
870 /* Main entry point for operand extraction.
871 The result is <= 0 for error, >0 for success.
872 ??? Actual values aren't well defined right now.
874 This function is basically just a big switch statement. Earlier versions
875 used tables to look up the function to use, but
876 - if the table contains both assembler and disassembler functions then
877 the disassembler contains much of the assembler and vice-versa,
878 - there's a lot of inlining possibilities as things grow,
879 - using a switch statement avoids the function call overhead.
881 This function could be moved into `print_insn_normal', but keeping it
882 separate makes clear the interface between `print_insn_normal' and each of
886 frv_cgen_extract_operand (CGEN_CPU_DESC cd,
888 CGEN_EXTRACT_INFO *ex_info,
889 CGEN_INSN_INT insn_value,
890 CGEN_FIELDS * fields,
893 /* Assume success (for those operands that are nops). */
895 unsigned int total_length = CGEN_FIELDS_BITSIZE (fields);
899 case FRV_OPERAND_A0 :
900 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
902 case FRV_OPERAND_A1 :
903 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
905 case FRV_OPERAND_ACC40SI :
906 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACC40Si);
908 case FRV_OPERAND_ACC40SK :
909 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACC40Sk);
911 case FRV_OPERAND_ACC40UI :
912 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACC40Ui);
914 case FRV_OPERAND_ACC40UK :
915 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACC40Uk);
917 case FRV_OPERAND_ACCGI :
918 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_ACCGi);
920 case FRV_OPERAND_ACCGK :
921 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_ACCGk);
923 case FRV_OPERAND_CCI :
924 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 3, 32, total_length, pc, & fields->f_CCi);
926 case FRV_OPERAND_CPRDOUBLEK :
927 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_CPRk);
929 case FRV_OPERAND_CPRI :
930 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_CPRi);
932 case FRV_OPERAND_CPRJ :
933 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_CPRj);
935 case FRV_OPERAND_CPRK :
936 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_CPRk);
938 case FRV_OPERAND_CRI :
939 length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_CRi);
941 case FRV_OPERAND_CRJ :
942 length = extract_normal (cd, ex_info, insn_value, 0, 0, 2, 3, 32, total_length, pc, & fields->f_CRj);
944 case FRV_OPERAND_CRJ_FLOAT :
945 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_CRj_float);
947 case FRV_OPERAND_CRJ_INT :
950 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & value);
951 value = ((value) + (4));
952 fields->f_CRj_int = value;
955 case FRV_OPERAND_CRK :
956 length = extract_normal (cd, ex_info, insn_value, 0, 0, 27, 3, 32, total_length, pc, & fields->f_CRk);
958 case FRV_OPERAND_FCCI_1 :
959 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 2, 32, total_length, pc, & fields->f_FCCi_1);
961 case FRV_OPERAND_FCCI_2 :
962 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_FCCi_2);
964 case FRV_OPERAND_FCCI_3 :
965 length = extract_normal (cd, ex_info, insn_value, 0, 0, 1, 2, 32, total_length, pc, & fields->f_FCCi_3);
967 case FRV_OPERAND_FCCK :
968 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_FCCk);
970 case FRV_OPERAND_FRDOUBLEI :
971 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
973 case FRV_OPERAND_FRDOUBLEJ :
974 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
976 case FRV_OPERAND_FRDOUBLEK :
977 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
979 case FRV_OPERAND_FRI :
980 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
982 case FRV_OPERAND_FRINTI :
983 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
985 case FRV_OPERAND_FRINTIEVEN :
986 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_FRi);
988 case FRV_OPERAND_FRINTJ :
989 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
991 case FRV_OPERAND_FRINTJEVEN :
992 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
994 case FRV_OPERAND_FRINTK :
995 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
997 case FRV_OPERAND_FRINTKEVEN :
998 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1000 case FRV_OPERAND_FRJ :
1001 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_FRj);
1003 case FRV_OPERAND_FRK :
1004 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1006 case FRV_OPERAND_FRKHI :
1007 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1009 case FRV_OPERAND_FRKLO :
1010 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_FRk);
1012 case FRV_OPERAND_GRDOUBLEK :
1013 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1015 case FRV_OPERAND_GRI :
1016 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_GRi);
1018 case FRV_OPERAND_GRJ :
1019 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_GRj);
1021 case FRV_OPERAND_GRK :
1022 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1024 case FRV_OPERAND_GRKHI :
1025 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1027 case FRV_OPERAND_GRKLO :
1028 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_GRk);
1030 case FRV_OPERAND_ICCI_1 :
1031 length = extract_normal (cd, ex_info, insn_value, 0, 0, 11, 2, 32, total_length, pc, & fields->f_ICCi_1);
1033 case FRV_OPERAND_ICCI_2 :
1034 length = extract_normal (cd, ex_info, insn_value, 0, 0, 26, 2, 32, total_length, pc, & fields->f_ICCi_2);
1036 case FRV_OPERAND_ICCI_3 :
1037 length = extract_normal (cd, ex_info, insn_value, 0, 0, 1, 2, 32, total_length, pc, & fields->f_ICCi_3);
1039 case FRV_OPERAND_LI :
1040 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_LI);
1042 case FRV_OPERAND_LRAD :
1043 length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 1, 32, total_length, pc, & fields->f_LRAD);
1045 case FRV_OPERAND_LRAE :
1046 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_LRAE);
1048 case FRV_OPERAND_LRAS :
1049 length = extract_normal (cd, ex_info, insn_value, 0, 0, 3, 1, 32, total_length, pc, & fields->f_LRAS);
1051 case FRV_OPERAND_TLBPRL :
1052 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_TLBPRL);
1054 case FRV_OPERAND_TLBPROPX :
1055 length = extract_normal (cd, ex_info, insn_value, 0, 0, 28, 3, 32, total_length, pc, & fields->f_TLBPRopx);
1057 case FRV_OPERAND_AE :
1058 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_ae);
1060 case FRV_OPERAND_CALLANN :
1061 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1063 case FRV_OPERAND_CCOND :
1064 length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 1, 32, total_length, pc, & fields->f_ccond);
1066 case FRV_OPERAND_COND :
1067 length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 1, 32, total_length, pc, & fields->f_cond);
1069 case FRV_OPERAND_D12 :
1070 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, pc, & fields->f_d12);
1072 case FRV_OPERAND_DEBUG :
1073 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_debug);
1075 case FRV_OPERAND_EIR :
1076 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_eir);
1078 case FRV_OPERAND_HINT :
1079 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1081 case FRV_OPERAND_HINT_NOT_TAKEN :
1082 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1084 case FRV_OPERAND_HINT_TAKEN :
1085 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 2, 32, total_length, pc, & fields->f_hint);
1087 case FRV_OPERAND_LABEL16 :
1090 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);
1091 value = ((((value) << (2))) + (pc));
1092 fields->f_label16 = value;
1095 case FRV_OPERAND_LABEL24 :
1097 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 30, 6, 32, total_length, pc, & fields->f_labelH6);
1098 if (length <= 0) break;
1099 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 18, 32, total_length, pc, & fields->f_labelL18);
1100 if (length <= 0) break;
1102 FLD (f_label24) = ((((((((FLD (f_labelH6)) << (18))) | (FLD (f_labelL18)))) << (2))) + (pc));
1106 case FRV_OPERAND_LDANN :
1107 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1109 case FRV_OPERAND_LDDANN :
1110 length = extract_normal (cd, ex_info, insn_value, 0, 0, 0, 0, 32, total_length, pc, & fields->f_reloc_ann);
1112 case FRV_OPERAND_LOCK :
1113 length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 1, 32, total_length, pc, & fields->f_lock);
1115 case FRV_OPERAND_PACK :
1116 length = extract_normal (cd, ex_info, insn_value, 0, 0, 31, 1, 32, total_length, pc, & fields->f_pack);
1118 case FRV_OPERAND_S10 :
1119 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 9, 10, 32, total_length, pc, & fields->f_s10);
1121 case FRV_OPERAND_S12 :
1122 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 12, 32, total_length, pc, & fields->f_d12);
1124 case FRV_OPERAND_S16 :
1125 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, pc, & fields->f_s16);
1127 case FRV_OPERAND_S5 :
1128 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 4, 5, 32, total_length, pc, & fields->f_s5);
1130 case FRV_OPERAND_S6 :
1131 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 5, 6, 32, total_length, pc, & fields->f_s6);
1133 case FRV_OPERAND_S6_1 :
1134 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 11, 6, 32, total_length, pc, & fields->f_s6_1);
1136 case FRV_OPERAND_SLO16 :
1137 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, pc, & fields->f_s16);
1139 case FRV_OPERAND_SPR :
1141 length = extract_normal (cd, ex_info, insn_value, 0, 0, 30, 6, 32, total_length, pc, & fields->f_spr_h);
1142 if (length <= 0) break;
1143 length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 6, 32, total_length, pc, & fields->f_spr_l);
1144 if (length <= 0) break;
1146 FLD (f_spr) = ((((FLD (f_spr_h)) << (6))) | (FLD (f_spr_l)));
1150 case FRV_OPERAND_U12 :
1152 length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 17, 6, 32, total_length, pc, & fields->f_u12_h);
1153 if (length <= 0) break;
1154 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_u12_l);
1155 if (length <= 0) break;
1157 FLD (f_u12) = ((((FLD (f_u12_h)) << (6))) | (FLD (f_u12_l)));
1161 case FRV_OPERAND_U16 :
1162 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1164 case FRV_OPERAND_U6 :
1165 length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_u6);
1167 case FRV_OPERAND_UHI16 :
1168 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1170 case FRV_OPERAND_ULO16 :
1171 length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_u16);
1175 /* xgettext:c-format */
1176 fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"),
1184 cgen_insert_fn * const frv_cgen_insert_handlers[] =
1189 cgen_extract_fn * const frv_cgen_extract_handlers[] =
1191 extract_insn_normal,
1194 int frv_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1195 bfd_vma frv_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *);
1197 /* Getting values from cgen_fields is handled by a collection of functions.
1198 They are distinguished by the type of the VALUE argument they return.
1199 TODO: floating point, inlining support, remove cases where result type
1203 frv_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1205 const CGEN_FIELDS * fields)
1211 case FRV_OPERAND_A0 :
1212 value = fields->f_A;
1214 case FRV_OPERAND_A1 :
1215 value = fields->f_A;
1217 case FRV_OPERAND_ACC40SI :
1218 value = fields->f_ACC40Si;
1220 case FRV_OPERAND_ACC40SK :
1221 value = fields->f_ACC40Sk;
1223 case FRV_OPERAND_ACC40UI :
1224 value = fields->f_ACC40Ui;
1226 case FRV_OPERAND_ACC40UK :
1227 value = fields->f_ACC40Uk;
1229 case FRV_OPERAND_ACCGI :
1230 value = fields->f_ACCGi;
1232 case FRV_OPERAND_ACCGK :
1233 value = fields->f_ACCGk;
1235 case FRV_OPERAND_CCI :
1236 value = fields->f_CCi;
1238 case FRV_OPERAND_CPRDOUBLEK :
1239 value = fields->f_CPRk;
1241 case FRV_OPERAND_CPRI :
1242 value = fields->f_CPRi;
1244 case FRV_OPERAND_CPRJ :
1245 value = fields->f_CPRj;
1247 case FRV_OPERAND_CPRK :
1248 value = fields->f_CPRk;
1250 case FRV_OPERAND_CRI :
1251 value = fields->f_CRi;
1253 case FRV_OPERAND_CRJ :
1254 value = fields->f_CRj;
1256 case FRV_OPERAND_CRJ_FLOAT :
1257 value = fields->f_CRj_float;
1259 case FRV_OPERAND_CRJ_INT :
1260 value = fields->f_CRj_int;
1262 case FRV_OPERAND_CRK :
1263 value = fields->f_CRk;
1265 case FRV_OPERAND_FCCI_1 :
1266 value = fields->f_FCCi_1;
1268 case FRV_OPERAND_FCCI_2 :
1269 value = fields->f_FCCi_2;
1271 case FRV_OPERAND_FCCI_3 :
1272 value = fields->f_FCCi_3;
1274 case FRV_OPERAND_FCCK :
1275 value = fields->f_FCCk;
1277 case FRV_OPERAND_FRDOUBLEI :
1278 value = fields->f_FRi;
1280 case FRV_OPERAND_FRDOUBLEJ :
1281 value = fields->f_FRj;
1283 case FRV_OPERAND_FRDOUBLEK :
1284 value = fields->f_FRk;
1286 case FRV_OPERAND_FRI :
1287 value = fields->f_FRi;
1289 case FRV_OPERAND_FRINTI :
1290 value = fields->f_FRi;
1292 case FRV_OPERAND_FRINTIEVEN :
1293 value = fields->f_FRi;
1295 case FRV_OPERAND_FRINTJ :
1296 value = fields->f_FRj;
1298 case FRV_OPERAND_FRINTJEVEN :
1299 value = fields->f_FRj;
1301 case FRV_OPERAND_FRINTK :
1302 value = fields->f_FRk;
1304 case FRV_OPERAND_FRINTKEVEN :
1305 value = fields->f_FRk;
1307 case FRV_OPERAND_FRJ :
1308 value = fields->f_FRj;
1310 case FRV_OPERAND_FRK :
1311 value = fields->f_FRk;
1313 case FRV_OPERAND_FRKHI :
1314 value = fields->f_FRk;
1316 case FRV_OPERAND_FRKLO :
1317 value = fields->f_FRk;
1319 case FRV_OPERAND_GRDOUBLEK :
1320 value = fields->f_GRk;
1322 case FRV_OPERAND_GRI :
1323 value = fields->f_GRi;
1325 case FRV_OPERAND_GRJ :
1326 value = fields->f_GRj;
1328 case FRV_OPERAND_GRK :
1329 value = fields->f_GRk;
1331 case FRV_OPERAND_GRKHI :
1332 value = fields->f_GRk;
1334 case FRV_OPERAND_GRKLO :
1335 value = fields->f_GRk;
1337 case FRV_OPERAND_ICCI_1 :
1338 value = fields->f_ICCi_1;
1340 case FRV_OPERAND_ICCI_2 :
1341 value = fields->f_ICCi_2;
1343 case FRV_OPERAND_ICCI_3 :
1344 value = fields->f_ICCi_3;
1346 case FRV_OPERAND_LI :
1347 value = fields->f_LI;
1349 case FRV_OPERAND_LRAD :
1350 value = fields->f_LRAD;
1352 case FRV_OPERAND_LRAE :
1353 value = fields->f_LRAE;
1355 case FRV_OPERAND_LRAS :
1356 value = fields->f_LRAS;
1358 case FRV_OPERAND_TLBPRL :
1359 value = fields->f_TLBPRL;
1361 case FRV_OPERAND_TLBPROPX :
1362 value = fields->f_TLBPRopx;
1364 case FRV_OPERAND_AE :
1365 value = fields->f_ae;
1367 case FRV_OPERAND_CALLANN :
1368 value = fields->f_reloc_ann;
1370 case FRV_OPERAND_CCOND :
1371 value = fields->f_ccond;
1373 case FRV_OPERAND_COND :
1374 value = fields->f_cond;
1376 case FRV_OPERAND_D12 :
1377 value = fields->f_d12;
1379 case FRV_OPERAND_DEBUG :
1380 value = fields->f_debug;
1382 case FRV_OPERAND_EIR :
1383 value = fields->f_eir;
1385 case FRV_OPERAND_HINT :
1386 value = fields->f_hint;
1388 case FRV_OPERAND_HINT_NOT_TAKEN :
1389 value = fields->f_hint;
1391 case FRV_OPERAND_HINT_TAKEN :
1392 value = fields->f_hint;
1394 case FRV_OPERAND_LABEL16 :
1395 value = fields->f_label16;
1397 case FRV_OPERAND_LABEL24 :
1398 value = fields->f_label24;
1400 case FRV_OPERAND_LDANN :
1401 value = fields->f_reloc_ann;
1403 case FRV_OPERAND_LDDANN :
1404 value = fields->f_reloc_ann;
1406 case FRV_OPERAND_LOCK :
1407 value = fields->f_lock;
1409 case FRV_OPERAND_PACK :
1410 value = fields->f_pack;
1412 case FRV_OPERAND_S10 :
1413 value = fields->f_s10;
1415 case FRV_OPERAND_S12 :
1416 value = fields->f_d12;
1418 case FRV_OPERAND_S16 :
1419 value = fields->f_s16;
1421 case FRV_OPERAND_S5 :
1422 value = fields->f_s5;
1424 case FRV_OPERAND_S6 :
1425 value = fields->f_s6;
1427 case FRV_OPERAND_S6_1 :
1428 value = fields->f_s6_1;
1430 case FRV_OPERAND_SLO16 :
1431 value = fields->f_s16;
1433 case FRV_OPERAND_SPR :
1434 value = fields->f_spr;
1436 case FRV_OPERAND_U12 :
1437 value = fields->f_u12;
1439 case FRV_OPERAND_U16 :
1440 value = fields->f_u16;
1442 case FRV_OPERAND_U6 :
1443 value = fields->f_u6;
1445 case FRV_OPERAND_UHI16 :
1446 value = fields->f_u16;
1448 case FRV_OPERAND_ULO16 :
1449 value = fields->f_u16;
1453 /* xgettext:c-format */
1454 fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"),
1463 frv_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1465 const CGEN_FIELDS * fields)
1471 case FRV_OPERAND_A0 :
1472 value = fields->f_A;
1474 case FRV_OPERAND_A1 :
1475 value = fields->f_A;
1477 case FRV_OPERAND_ACC40SI :
1478 value = fields->f_ACC40Si;
1480 case FRV_OPERAND_ACC40SK :
1481 value = fields->f_ACC40Sk;
1483 case FRV_OPERAND_ACC40UI :
1484 value = fields->f_ACC40Ui;
1486 case FRV_OPERAND_ACC40UK :
1487 value = fields->f_ACC40Uk;
1489 case FRV_OPERAND_ACCGI :
1490 value = fields->f_ACCGi;
1492 case FRV_OPERAND_ACCGK :
1493 value = fields->f_ACCGk;
1495 case FRV_OPERAND_CCI :
1496 value = fields->f_CCi;
1498 case FRV_OPERAND_CPRDOUBLEK :
1499 value = fields->f_CPRk;
1501 case FRV_OPERAND_CPRI :
1502 value = fields->f_CPRi;
1504 case FRV_OPERAND_CPRJ :
1505 value = fields->f_CPRj;
1507 case FRV_OPERAND_CPRK :
1508 value = fields->f_CPRk;
1510 case FRV_OPERAND_CRI :
1511 value = fields->f_CRi;
1513 case FRV_OPERAND_CRJ :
1514 value = fields->f_CRj;
1516 case FRV_OPERAND_CRJ_FLOAT :
1517 value = fields->f_CRj_float;
1519 case FRV_OPERAND_CRJ_INT :
1520 value = fields->f_CRj_int;
1522 case FRV_OPERAND_CRK :
1523 value = fields->f_CRk;
1525 case FRV_OPERAND_FCCI_1 :
1526 value = fields->f_FCCi_1;
1528 case FRV_OPERAND_FCCI_2 :
1529 value = fields->f_FCCi_2;
1531 case FRV_OPERAND_FCCI_3 :
1532 value = fields->f_FCCi_3;
1534 case FRV_OPERAND_FCCK :
1535 value = fields->f_FCCk;
1537 case FRV_OPERAND_FRDOUBLEI :
1538 value = fields->f_FRi;
1540 case FRV_OPERAND_FRDOUBLEJ :
1541 value = fields->f_FRj;
1543 case FRV_OPERAND_FRDOUBLEK :
1544 value = fields->f_FRk;
1546 case FRV_OPERAND_FRI :
1547 value = fields->f_FRi;
1549 case FRV_OPERAND_FRINTI :
1550 value = fields->f_FRi;
1552 case FRV_OPERAND_FRINTIEVEN :
1553 value = fields->f_FRi;
1555 case FRV_OPERAND_FRINTJ :
1556 value = fields->f_FRj;
1558 case FRV_OPERAND_FRINTJEVEN :
1559 value = fields->f_FRj;
1561 case FRV_OPERAND_FRINTK :
1562 value = fields->f_FRk;
1564 case FRV_OPERAND_FRINTKEVEN :
1565 value = fields->f_FRk;
1567 case FRV_OPERAND_FRJ :
1568 value = fields->f_FRj;
1570 case FRV_OPERAND_FRK :
1571 value = fields->f_FRk;
1573 case FRV_OPERAND_FRKHI :
1574 value = fields->f_FRk;
1576 case FRV_OPERAND_FRKLO :
1577 value = fields->f_FRk;
1579 case FRV_OPERAND_GRDOUBLEK :
1580 value = fields->f_GRk;
1582 case FRV_OPERAND_GRI :
1583 value = fields->f_GRi;
1585 case FRV_OPERAND_GRJ :
1586 value = fields->f_GRj;
1588 case FRV_OPERAND_GRK :
1589 value = fields->f_GRk;
1591 case FRV_OPERAND_GRKHI :
1592 value = fields->f_GRk;
1594 case FRV_OPERAND_GRKLO :
1595 value = fields->f_GRk;
1597 case FRV_OPERAND_ICCI_1 :
1598 value = fields->f_ICCi_1;
1600 case FRV_OPERAND_ICCI_2 :
1601 value = fields->f_ICCi_2;
1603 case FRV_OPERAND_ICCI_3 :
1604 value = fields->f_ICCi_3;
1606 case FRV_OPERAND_LI :
1607 value = fields->f_LI;
1609 case FRV_OPERAND_LRAD :
1610 value = fields->f_LRAD;
1612 case FRV_OPERAND_LRAE :
1613 value = fields->f_LRAE;
1615 case FRV_OPERAND_LRAS :
1616 value = fields->f_LRAS;
1618 case FRV_OPERAND_TLBPRL :
1619 value = fields->f_TLBPRL;
1621 case FRV_OPERAND_TLBPROPX :
1622 value = fields->f_TLBPRopx;
1624 case FRV_OPERAND_AE :
1625 value = fields->f_ae;
1627 case FRV_OPERAND_CALLANN :
1628 value = fields->f_reloc_ann;
1630 case FRV_OPERAND_CCOND :
1631 value = fields->f_ccond;
1633 case FRV_OPERAND_COND :
1634 value = fields->f_cond;
1636 case FRV_OPERAND_D12 :
1637 value = fields->f_d12;
1639 case FRV_OPERAND_DEBUG :
1640 value = fields->f_debug;
1642 case FRV_OPERAND_EIR :
1643 value = fields->f_eir;
1645 case FRV_OPERAND_HINT :
1646 value = fields->f_hint;
1648 case FRV_OPERAND_HINT_NOT_TAKEN :
1649 value = fields->f_hint;
1651 case FRV_OPERAND_HINT_TAKEN :
1652 value = fields->f_hint;
1654 case FRV_OPERAND_LABEL16 :
1655 value = fields->f_label16;
1657 case FRV_OPERAND_LABEL24 :
1658 value = fields->f_label24;
1660 case FRV_OPERAND_LDANN :
1661 value = fields->f_reloc_ann;
1663 case FRV_OPERAND_LDDANN :
1664 value = fields->f_reloc_ann;
1666 case FRV_OPERAND_LOCK :
1667 value = fields->f_lock;
1669 case FRV_OPERAND_PACK :
1670 value = fields->f_pack;
1672 case FRV_OPERAND_S10 :
1673 value = fields->f_s10;
1675 case FRV_OPERAND_S12 :
1676 value = fields->f_d12;
1678 case FRV_OPERAND_S16 :
1679 value = fields->f_s16;
1681 case FRV_OPERAND_S5 :
1682 value = fields->f_s5;
1684 case FRV_OPERAND_S6 :
1685 value = fields->f_s6;
1687 case FRV_OPERAND_S6_1 :
1688 value = fields->f_s6_1;
1690 case FRV_OPERAND_SLO16 :
1691 value = fields->f_s16;
1693 case FRV_OPERAND_SPR :
1694 value = fields->f_spr;
1696 case FRV_OPERAND_U12 :
1697 value = fields->f_u12;
1699 case FRV_OPERAND_U16 :
1700 value = fields->f_u16;
1702 case FRV_OPERAND_U6 :
1703 value = fields->f_u6;
1705 case FRV_OPERAND_UHI16 :
1706 value = fields->f_u16;
1708 case FRV_OPERAND_ULO16 :
1709 value = fields->f_u16;
1713 /* xgettext:c-format */
1714 fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"),
1722 void frv_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int);
1723 void frv_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma);
1725 /* Stuffing values in cgen_fields is handled by a collection of functions.
1726 They are distinguished by the type of the VALUE argument they accept.
1727 TODO: floating point, inlining support, remove cases where argument type
1731 frv_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1733 CGEN_FIELDS * fields,
1738 case FRV_OPERAND_A0 :
1739 fields->f_A = value;
1741 case FRV_OPERAND_A1 :
1742 fields->f_A = value;
1744 case FRV_OPERAND_ACC40SI :
1745 fields->f_ACC40Si = value;
1747 case FRV_OPERAND_ACC40SK :
1748 fields->f_ACC40Sk = value;
1750 case FRV_OPERAND_ACC40UI :
1751 fields->f_ACC40Ui = value;
1753 case FRV_OPERAND_ACC40UK :
1754 fields->f_ACC40Uk = value;
1756 case FRV_OPERAND_ACCGI :
1757 fields->f_ACCGi = value;
1759 case FRV_OPERAND_ACCGK :
1760 fields->f_ACCGk = value;
1762 case FRV_OPERAND_CCI :
1763 fields->f_CCi = value;
1765 case FRV_OPERAND_CPRDOUBLEK :
1766 fields->f_CPRk = value;
1768 case FRV_OPERAND_CPRI :
1769 fields->f_CPRi = value;
1771 case FRV_OPERAND_CPRJ :
1772 fields->f_CPRj = value;
1774 case FRV_OPERAND_CPRK :
1775 fields->f_CPRk = value;
1777 case FRV_OPERAND_CRI :
1778 fields->f_CRi = value;
1780 case FRV_OPERAND_CRJ :
1781 fields->f_CRj = value;
1783 case FRV_OPERAND_CRJ_FLOAT :
1784 fields->f_CRj_float = value;
1786 case FRV_OPERAND_CRJ_INT :
1787 fields->f_CRj_int = value;
1789 case FRV_OPERAND_CRK :
1790 fields->f_CRk = value;
1792 case FRV_OPERAND_FCCI_1 :
1793 fields->f_FCCi_1 = value;
1795 case FRV_OPERAND_FCCI_2 :
1796 fields->f_FCCi_2 = value;
1798 case FRV_OPERAND_FCCI_3 :
1799 fields->f_FCCi_3 = value;
1801 case FRV_OPERAND_FCCK :
1802 fields->f_FCCk = value;
1804 case FRV_OPERAND_FRDOUBLEI :
1805 fields->f_FRi = value;
1807 case FRV_OPERAND_FRDOUBLEJ :
1808 fields->f_FRj = value;
1810 case FRV_OPERAND_FRDOUBLEK :
1811 fields->f_FRk = value;
1813 case FRV_OPERAND_FRI :
1814 fields->f_FRi = value;
1816 case FRV_OPERAND_FRINTI :
1817 fields->f_FRi = value;
1819 case FRV_OPERAND_FRINTIEVEN :
1820 fields->f_FRi = value;
1822 case FRV_OPERAND_FRINTJ :
1823 fields->f_FRj = value;
1825 case FRV_OPERAND_FRINTJEVEN :
1826 fields->f_FRj = value;
1828 case FRV_OPERAND_FRINTK :
1829 fields->f_FRk = value;
1831 case FRV_OPERAND_FRINTKEVEN :
1832 fields->f_FRk = value;
1834 case FRV_OPERAND_FRJ :
1835 fields->f_FRj = value;
1837 case FRV_OPERAND_FRK :
1838 fields->f_FRk = value;
1840 case FRV_OPERAND_FRKHI :
1841 fields->f_FRk = value;
1843 case FRV_OPERAND_FRKLO :
1844 fields->f_FRk = value;
1846 case FRV_OPERAND_GRDOUBLEK :
1847 fields->f_GRk = value;
1849 case FRV_OPERAND_GRI :
1850 fields->f_GRi = value;
1852 case FRV_OPERAND_GRJ :
1853 fields->f_GRj = value;
1855 case FRV_OPERAND_GRK :
1856 fields->f_GRk = value;
1858 case FRV_OPERAND_GRKHI :
1859 fields->f_GRk = value;
1861 case FRV_OPERAND_GRKLO :
1862 fields->f_GRk = value;
1864 case FRV_OPERAND_ICCI_1 :
1865 fields->f_ICCi_1 = value;
1867 case FRV_OPERAND_ICCI_2 :
1868 fields->f_ICCi_2 = value;
1870 case FRV_OPERAND_ICCI_3 :
1871 fields->f_ICCi_3 = value;
1873 case FRV_OPERAND_LI :
1874 fields->f_LI = value;
1876 case FRV_OPERAND_LRAD :
1877 fields->f_LRAD = value;
1879 case FRV_OPERAND_LRAE :
1880 fields->f_LRAE = value;
1882 case FRV_OPERAND_LRAS :
1883 fields->f_LRAS = value;
1885 case FRV_OPERAND_TLBPRL :
1886 fields->f_TLBPRL = value;
1888 case FRV_OPERAND_TLBPROPX :
1889 fields->f_TLBPRopx = value;
1891 case FRV_OPERAND_AE :
1892 fields->f_ae = value;
1894 case FRV_OPERAND_CALLANN :
1895 fields->f_reloc_ann = value;
1897 case FRV_OPERAND_CCOND :
1898 fields->f_ccond = value;
1900 case FRV_OPERAND_COND :
1901 fields->f_cond = value;
1903 case FRV_OPERAND_D12 :
1904 fields->f_d12 = value;
1906 case FRV_OPERAND_DEBUG :
1907 fields->f_debug = value;
1909 case FRV_OPERAND_EIR :
1910 fields->f_eir = value;
1912 case FRV_OPERAND_HINT :
1913 fields->f_hint = value;
1915 case FRV_OPERAND_HINT_NOT_TAKEN :
1916 fields->f_hint = value;
1918 case FRV_OPERAND_HINT_TAKEN :
1919 fields->f_hint = value;
1921 case FRV_OPERAND_LABEL16 :
1922 fields->f_label16 = value;
1924 case FRV_OPERAND_LABEL24 :
1925 fields->f_label24 = value;
1927 case FRV_OPERAND_LDANN :
1928 fields->f_reloc_ann = value;
1930 case FRV_OPERAND_LDDANN :
1931 fields->f_reloc_ann = value;
1933 case FRV_OPERAND_LOCK :
1934 fields->f_lock = value;
1936 case FRV_OPERAND_PACK :
1937 fields->f_pack = value;
1939 case FRV_OPERAND_S10 :
1940 fields->f_s10 = value;
1942 case FRV_OPERAND_S12 :
1943 fields->f_d12 = value;
1945 case FRV_OPERAND_S16 :
1946 fields->f_s16 = value;
1948 case FRV_OPERAND_S5 :
1949 fields->f_s5 = value;
1951 case FRV_OPERAND_S6 :
1952 fields->f_s6 = value;
1954 case FRV_OPERAND_S6_1 :
1955 fields->f_s6_1 = value;
1957 case FRV_OPERAND_SLO16 :
1958 fields->f_s16 = value;
1960 case FRV_OPERAND_SPR :
1961 fields->f_spr = value;
1963 case FRV_OPERAND_U12 :
1964 fields->f_u12 = value;
1966 case FRV_OPERAND_U16 :
1967 fields->f_u16 = value;
1969 case FRV_OPERAND_U6 :
1970 fields->f_u6 = value;
1972 case FRV_OPERAND_UHI16 :
1973 fields->f_u16 = value;
1975 case FRV_OPERAND_ULO16 :
1976 fields->f_u16 = value;
1980 /* xgettext:c-format */
1981 fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"),
1988 frv_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
1990 CGEN_FIELDS * fields,
1995 case FRV_OPERAND_A0 :
1996 fields->f_A = value;
1998 case FRV_OPERAND_A1 :
1999 fields->f_A = value;
2001 case FRV_OPERAND_ACC40SI :
2002 fields->f_ACC40Si = value;
2004 case FRV_OPERAND_ACC40SK :
2005 fields->f_ACC40Sk = value;
2007 case FRV_OPERAND_ACC40UI :
2008 fields->f_ACC40Ui = value;
2010 case FRV_OPERAND_ACC40UK :
2011 fields->f_ACC40Uk = value;
2013 case FRV_OPERAND_ACCGI :
2014 fields->f_ACCGi = value;
2016 case FRV_OPERAND_ACCGK :
2017 fields->f_ACCGk = value;
2019 case FRV_OPERAND_CCI :
2020 fields->f_CCi = value;
2022 case FRV_OPERAND_CPRDOUBLEK :
2023 fields->f_CPRk = value;
2025 case FRV_OPERAND_CPRI :
2026 fields->f_CPRi = value;
2028 case FRV_OPERAND_CPRJ :
2029 fields->f_CPRj = value;
2031 case FRV_OPERAND_CPRK :
2032 fields->f_CPRk = value;
2034 case FRV_OPERAND_CRI :
2035 fields->f_CRi = value;
2037 case FRV_OPERAND_CRJ :
2038 fields->f_CRj = value;
2040 case FRV_OPERAND_CRJ_FLOAT :
2041 fields->f_CRj_float = value;
2043 case FRV_OPERAND_CRJ_INT :
2044 fields->f_CRj_int = value;
2046 case FRV_OPERAND_CRK :
2047 fields->f_CRk = value;
2049 case FRV_OPERAND_FCCI_1 :
2050 fields->f_FCCi_1 = value;
2052 case FRV_OPERAND_FCCI_2 :
2053 fields->f_FCCi_2 = value;
2055 case FRV_OPERAND_FCCI_3 :
2056 fields->f_FCCi_3 = value;
2058 case FRV_OPERAND_FCCK :
2059 fields->f_FCCk = value;
2061 case FRV_OPERAND_FRDOUBLEI :
2062 fields->f_FRi = value;
2064 case FRV_OPERAND_FRDOUBLEJ :
2065 fields->f_FRj = value;
2067 case FRV_OPERAND_FRDOUBLEK :
2068 fields->f_FRk = value;
2070 case FRV_OPERAND_FRI :
2071 fields->f_FRi = value;
2073 case FRV_OPERAND_FRINTI :
2074 fields->f_FRi = value;
2076 case FRV_OPERAND_FRINTIEVEN :
2077 fields->f_FRi = value;
2079 case FRV_OPERAND_FRINTJ :
2080 fields->f_FRj = value;
2082 case FRV_OPERAND_FRINTJEVEN :
2083 fields->f_FRj = value;
2085 case FRV_OPERAND_FRINTK :
2086 fields->f_FRk = value;
2088 case FRV_OPERAND_FRINTKEVEN :
2089 fields->f_FRk = value;
2091 case FRV_OPERAND_FRJ :
2092 fields->f_FRj = value;
2094 case FRV_OPERAND_FRK :
2095 fields->f_FRk = value;
2097 case FRV_OPERAND_FRKHI :
2098 fields->f_FRk = value;
2100 case FRV_OPERAND_FRKLO :
2101 fields->f_FRk = value;
2103 case FRV_OPERAND_GRDOUBLEK :
2104 fields->f_GRk = value;
2106 case FRV_OPERAND_GRI :
2107 fields->f_GRi = value;
2109 case FRV_OPERAND_GRJ :
2110 fields->f_GRj = value;
2112 case FRV_OPERAND_GRK :
2113 fields->f_GRk = value;
2115 case FRV_OPERAND_GRKHI :
2116 fields->f_GRk = value;
2118 case FRV_OPERAND_GRKLO :
2119 fields->f_GRk = value;
2121 case FRV_OPERAND_ICCI_1 :
2122 fields->f_ICCi_1 = value;
2124 case FRV_OPERAND_ICCI_2 :
2125 fields->f_ICCi_2 = value;
2127 case FRV_OPERAND_ICCI_3 :
2128 fields->f_ICCi_3 = value;
2130 case FRV_OPERAND_LI :
2131 fields->f_LI = value;
2133 case FRV_OPERAND_LRAD :
2134 fields->f_LRAD = value;
2136 case FRV_OPERAND_LRAE :
2137 fields->f_LRAE = value;
2139 case FRV_OPERAND_LRAS :
2140 fields->f_LRAS = value;
2142 case FRV_OPERAND_TLBPRL :
2143 fields->f_TLBPRL = value;
2145 case FRV_OPERAND_TLBPROPX :
2146 fields->f_TLBPRopx = value;
2148 case FRV_OPERAND_AE :
2149 fields->f_ae = value;
2151 case FRV_OPERAND_CALLANN :
2152 fields->f_reloc_ann = value;
2154 case FRV_OPERAND_CCOND :
2155 fields->f_ccond = value;
2157 case FRV_OPERAND_COND :
2158 fields->f_cond = value;
2160 case FRV_OPERAND_D12 :
2161 fields->f_d12 = value;
2163 case FRV_OPERAND_DEBUG :
2164 fields->f_debug = value;
2166 case FRV_OPERAND_EIR :
2167 fields->f_eir = value;
2169 case FRV_OPERAND_HINT :
2170 fields->f_hint = value;
2172 case FRV_OPERAND_HINT_NOT_TAKEN :
2173 fields->f_hint = value;
2175 case FRV_OPERAND_HINT_TAKEN :
2176 fields->f_hint = value;
2178 case FRV_OPERAND_LABEL16 :
2179 fields->f_label16 = value;
2181 case FRV_OPERAND_LABEL24 :
2182 fields->f_label24 = value;
2184 case FRV_OPERAND_LDANN :
2185 fields->f_reloc_ann = value;
2187 case FRV_OPERAND_LDDANN :
2188 fields->f_reloc_ann = value;
2190 case FRV_OPERAND_LOCK :
2191 fields->f_lock = value;
2193 case FRV_OPERAND_PACK :
2194 fields->f_pack = value;
2196 case FRV_OPERAND_S10 :
2197 fields->f_s10 = value;
2199 case FRV_OPERAND_S12 :
2200 fields->f_d12 = value;
2202 case FRV_OPERAND_S16 :
2203 fields->f_s16 = value;
2205 case FRV_OPERAND_S5 :
2206 fields->f_s5 = value;
2208 case FRV_OPERAND_S6 :
2209 fields->f_s6 = value;
2211 case FRV_OPERAND_S6_1 :
2212 fields->f_s6_1 = value;
2214 case FRV_OPERAND_SLO16 :
2215 fields->f_s16 = value;
2217 case FRV_OPERAND_SPR :
2218 fields->f_spr = value;
2220 case FRV_OPERAND_U12 :
2221 fields->f_u12 = value;
2223 case FRV_OPERAND_U16 :
2224 fields->f_u16 = value;
2226 case FRV_OPERAND_U6 :
2227 fields->f_u6 = value;
2229 case FRV_OPERAND_UHI16 :
2230 fields->f_u16 = value;
2232 case FRV_OPERAND_ULO16 :
2233 fields->f_u16 = value;
2237 /* xgettext:c-format */
2238 fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"),
2244 /* Function to call before using the instruction builder tables. */
2247 frv_cgen_init_ibld_table (CGEN_CPU_DESC cd)
2249 cd->insert_handlers = & frv_cgen_insert_handlers[0];
2250 cd->extract_handlers = & frv_cgen_extract_handlers[0];
2252 cd->insert_operand = frv_cgen_insert_operand;
2253 cd->extract_operand = frv_cgen_extract_operand;
2255 cd->get_int_operand = frv_cgen_get_int_operand;
2256 cd->set_int_operand = frv_cgen_set_int_operand;
2257 cd->get_vma_operand = frv_cgen_get_vma_operand;
2258 cd->set_vma_operand = frv_cgen_set_vma_operand;