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-2019 Free Software Foundation, Inc.
9 This file is part of libopcodes.
11 This library is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
16 It is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
25 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
36 #include "cgen/basic-modes.h"
38 #include "safe-ctype.h"
41 #define min(a,b) ((a) < (b) ? (a) : (b))
43 #define max(a,b) ((a) > (b) ? (a) : (b))
45 /* Used by the ifield rtx function. */
46 #define FLD(f) (fields->f)
48 static const char * insert_normal
49 (CGEN_CPU_DESC
, long, unsigned int, unsigned int, unsigned int,
50 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR
);
51 static const char * insert_insn_normal
52 (CGEN_CPU_DESC
, const CGEN_INSN
*,
53 CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
54 static int extract_normal
55 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
,
56 unsigned int, unsigned int, unsigned int, unsigned int,
57 unsigned int, unsigned int, bfd_vma
, long *);
58 static int extract_insn_normal
59 (CGEN_CPU_DESC
, const CGEN_INSN
*, CGEN_EXTRACT_INFO
*,
60 CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
62 static void put_insn_int_value
63 (CGEN_CPU_DESC
, CGEN_INSN_BYTES_PTR
, int, int, CGEN_INSN_INT
);
66 static CGEN_INLINE
void insert_1
67 (CGEN_CPU_DESC
, unsigned long, int, int, int, unsigned char *);
68 static CGEN_INLINE
int fill_cache
69 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, bfd_vma
);
70 static CGEN_INLINE
long extract_1
71 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, int, unsigned char *, bfd_vma
);
74 /* Operand insertion. */
78 /* Subroutine of insert_normal. */
80 static CGEN_INLINE
void
81 insert_1 (CGEN_CPU_DESC cd
,
91 x
= cgen_get_insn_value (cd
, bufp
, word_length
);
93 /* Written this way to avoid undefined behaviour. */
94 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
96 shift
= (start
+ 1) - length
;
98 shift
= (word_length
- (start
+ length
));
99 x
= (x
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
101 cgen_put_insn_value (cd
, bufp
, word_length
, (bfd_vma
) x
);
104 #endif /* ! CGEN_INT_INSN_P */
106 /* Default insertion routine.
108 ATTRS is a mask of the boolean attributes.
109 WORD_OFFSET is the offset in bits from the start of the insn of the value.
110 WORD_LENGTH is the length of the word in bits in which the value resides.
111 START is the starting bit number in the word, architecture origin.
112 LENGTH is the length of VALUE in bits.
113 TOTAL_LENGTH is the total length of the insn in bits.
115 The result is an error message or NULL if success. */
117 /* ??? This duplicates functionality with bfd's howto table and
118 bfd_install_relocation. */
119 /* ??? This doesn't handle bfd_vma's. Create another function when
123 insert_normal (CGEN_CPU_DESC cd
,
126 unsigned int word_offset
,
129 unsigned int word_length
,
130 unsigned int total_length
,
131 CGEN_INSN_BYTES_PTR buffer
)
133 static char errbuf
[100];
134 /* Written this way to avoid undefined behaviour. */
135 unsigned long mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
137 /* If LENGTH is zero, this operand doesn't contribute to the value. */
141 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
144 /* For architectures with insns smaller than the base-insn-bitsize,
145 word_length may be too big. */
146 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
149 && word_length
> total_length
)
150 word_length
= total_length
;
153 /* Ensure VALUE will fit. */
154 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGN_OPT
))
156 long minval
= - (1L << (length
- 1));
157 unsigned long maxval
= mask
;
159 if ((value
> 0 && (unsigned long) value
> maxval
)
162 /* xgettext:c-format */
164 _("operand out of range (%ld not between %ld and %lu)"),
165 value
, minval
, maxval
);
169 else if (! CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
))
171 unsigned long maxval
= mask
;
172 unsigned long val
= (unsigned long) value
;
174 /* For hosts with a word size > 32 check to see if value has been sign
175 extended beyond 32 bits. If so then ignore these higher sign bits
176 as the user is attempting to store a 32-bit signed value into an
177 unsigned 32-bit field which is allowed. */
178 if (sizeof (unsigned long) > 4 && ((value
>> 32) == -1))
183 /* xgettext:c-format */
185 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
192 if (! cgen_signed_overflow_ok_p (cd
))
194 long minval
= - (1L << (length
- 1));
195 long maxval
= (1L << (length
- 1)) - 1;
197 if (value
< minval
|| value
> maxval
)
200 /* xgettext:c-format */
201 (errbuf
, _("operand out of range (%ld not between %ld and %ld)"),
202 value
, minval
, maxval
);
211 int shift_within_word
, shift_to_word
, shift
;
213 /* How to shift the value to BIT0 of the word. */
214 shift_to_word
= total_length
- (word_offset
+ word_length
);
216 /* How to shift the value to the field within the word. */
217 if (CGEN_INSN_LSB0_P
)
218 shift_within_word
= start
+ 1 - length
;
220 shift_within_word
= word_length
- start
- length
;
222 /* The total SHIFT, then mask in the value. */
223 shift
= shift_to_word
+ shift_within_word
;
224 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
227 #else /* ! CGEN_INT_INSN_P */
230 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
232 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
235 #endif /* ! CGEN_INT_INSN_P */
240 /* Default insn builder (insert handler).
241 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
242 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
243 recorded in host byte order, otherwise BUFFER is an array of bytes
244 and the value is recorded in target byte order).
245 The result is an error message or NULL if success. */
248 insert_insn_normal (CGEN_CPU_DESC cd
,
249 const CGEN_INSN
* insn
,
250 CGEN_FIELDS
* fields
,
251 CGEN_INSN_BYTES_PTR buffer
,
254 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
256 const CGEN_SYNTAX_CHAR_TYPE
* syn
;
258 CGEN_INIT_INSERT (cd
);
259 value
= CGEN_INSN_BASE_VALUE (insn
);
261 /* If we're recording insns as numbers (rather than a string of bytes),
262 target byte order handling is deferred until later. */
266 put_insn_int_value (cd
, buffer
, cd
->base_insn_bitsize
,
267 CGEN_FIELDS_BITSIZE (fields
), value
);
271 cgen_put_insn_value (cd
, buffer
, min ((unsigned) cd
->base_insn_bitsize
,
272 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
275 #endif /* ! CGEN_INT_INSN_P */
277 /* ??? It would be better to scan the format's fields.
278 Still need to be able to insert a value based on the operand though;
279 e.g. storing a branch displacement that got resolved later.
280 Needs more thought first. */
282 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
286 if (CGEN_SYNTAX_CHAR_P (* syn
))
289 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
299 /* Cover function to store an insn value into an integral insn. Must go here
300 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
303 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
304 CGEN_INSN_BYTES_PTR buf
,
309 /* For architectures with insns smaller than the base-insn-bitsize,
310 length may be too big. */
311 if (length
> insn_length
)
315 int shift
= insn_length
- length
;
316 /* Written this way to avoid undefined behaviour. */
317 CGEN_INSN_INT mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
319 *buf
= (*buf
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
324 /* Operand extraction. */
326 #if ! CGEN_INT_INSN_P
328 /* Subroutine of extract_normal.
329 Ensure sufficient bytes are cached in EX_INFO.
330 OFFSET is the offset in bytes from the start of the insn of the value.
331 BYTES is the length of the needed value.
332 Returns 1 for success, 0 for failure. */
334 static CGEN_INLINE
int
335 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
336 CGEN_EXTRACT_INFO
*ex_info
,
341 /* It's doubtful that the middle part has already been fetched so
342 we don't optimize that case. kiss. */
344 disassemble_info
*info
= (disassemble_info
*) ex_info
->dis_info
;
346 /* First do a quick check. */
347 mask
= (1 << bytes
) - 1;
348 if (((ex_info
->valid
>> offset
) & mask
) == mask
)
351 /* Search for the first byte we need to read. */
352 for (mask
= 1 << offset
; bytes
> 0; --bytes
, ++offset
, mask
<<= 1)
353 if (! (mask
& ex_info
->valid
))
361 status
= (*info
->read_memory_func
)
362 (pc
, ex_info
->insn_bytes
+ offset
, bytes
, info
);
366 (*info
->memory_error_func
) (status
, pc
, info
);
370 ex_info
->valid
|= ((1 << bytes
) - 1) << offset
;
376 /* Subroutine of extract_normal. */
378 static CGEN_INLINE
long
379 extract_1 (CGEN_CPU_DESC cd
,
380 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
385 bfd_vma pc ATTRIBUTE_UNUSED
)
390 x
= cgen_get_insn_value (cd
, bufp
, word_length
);
392 if (CGEN_INSN_LSB0_P
)
393 shift
= (start
+ 1) - length
;
395 shift
= (word_length
- (start
+ length
));
399 #endif /* ! CGEN_INT_INSN_P */
401 /* Default extraction routine.
403 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
404 or sometimes less for cases like the m32r where the base insn size is 32
405 but some insns are 16 bits.
406 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
407 but for generality we take a bitmask of all of them.
408 WORD_OFFSET is the offset in bits from the start of the insn of the value.
409 WORD_LENGTH is the length of the word in bits in which the value resides.
410 START is the starting bit number in the word, architecture origin.
411 LENGTH is the length of VALUE in bits.
412 TOTAL_LENGTH is the total length of the insn in bits.
414 Returns 1 for success, 0 for failure. */
416 /* ??? The return code isn't properly used. wip. */
418 /* ??? This doesn't handle bfd_vma's. Create another function when
422 extract_normal (CGEN_CPU_DESC cd
,
423 #if ! CGEN_INT_INSN_P
424 CGEN_EXTRACT_INFO
*ex_info
,
426 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
428 CGEN_INSN_INT insn_value
,
430 unsigned int word_offset
,
433 unsigned int word_length
,
434 unsigned int total_length
,
435 #if ! CGEN_INT_INSN_P
438 bfd_vma pc ATTRIBUTE_UNUSED
,
444 /* If LENGTH is zero, this operand doesn't contribute to the value
445 so give it a standard value of zero. */
452 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
455 /* For architectures with insns smaller than the insn-base-bitsize,
456 word_length may be too big. */
457 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
459 if (word_offset
+ word_length
> total_length
)
460 word_length
= total_length
- word_offset
;
463 /* Does the value reside in INSN_VALUE, and at the right alignment? */
465 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
467 if (CGEN_INSN_LSB0_P
)
468 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
470 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
473 #if ! CGEN_INT_INSN_P
477 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
479 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
482 if (fill_cache (cd
, ex_info
, word_offset
/ 8, word_length
/ 8, pc
) == 0)
485 value
= extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
);
488 #endif /* ! CGEN_INT_INSN_P */
490 /* Written this way to avoid undefined behaviour. */
491 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
495 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
496 && (value
& (1L << (length
- 1))))
504 /* Default insn extractor.
506 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
507 The extracted fields are stored in FIELDS.
508 EX_INFO is used to handle reading variable length insns.
509 Return the length of the insn in bits, or 0 if no match,
510 or -1 if an error occurs fetching data (memory_error_func will have
514 extract_insn_normal (CGEN_CPU_DESC cd
,
515 const CGEN_INSN
*insn
,
516 CGEN_EXTRACT_INFO
*ex_info
,
517 CGEN_INSN_INT insn_value
,
521 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
522 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
524 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
526 CGEN_INIT_EXTRACT (cd
);
528 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
532 if (CGEN_SYNTAX_CHAR_P (*syn
))
535 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
536 ex_info
, insn_value
, fields
, pc
);
541 /* We recognized and successfully extracted this insn. */
542 return CGEN_INSN_BITSIZE (insn
);
545 /* Machine generated code added here. */
547 const char * frv_cgen_insert_operand
548 (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
550 /* Main entry point for operand insertion.
552 This function is basically just a big switch statement. Earlier versions
553 used tables to look up the function to use, but
554 - if the table contains both assembler and disassembler functions then
555 the disassembler contains much of the assembler and vice-versa,
556 - there's a lot of inlining possibilities as things grow,
557 - using a switch statement avoids the function call overhead.
559 This function could be moved into `parse_insn_normal', but keeping it
560 separate makes clear the interface between `parse_insn_normal' and each of
561 the handlers. It's also needed by GAS to insert operands that couldn't be
562 resolved during parsing. */
565 frv_cgen_insert_operand (CGEN_CPU_DESC cd
,
567 CGEN_FIELDS
* fields
,
568 CGEN_INSN_BYTES_PTR buffer
,
569 bfd_vma pc ATTRIBUTE_UNUSED
)
571 const char * errmsg
= NULL
;
572 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
576 case FRV_OPERAND_A0
:
577 errmsg
= insert_normal (cd
, fields
->f_A
, 0, 0, 17, 1, 32, total_length
, buffer
);
579 case FRV_OPERAND_A1
:
580 errmsg
= insert_normal (cd
, fields
->f_A
, 0, 0, 17, 1, 32, total_length
, buffer
);
582 case FRV_OPERAND_ACC40SI
:
583 errmsg
= insert_normal (cd
, fields
->f_ACC40Si
, 0, 0, 17, 6, 32, total_length
, buffer
);
585 case FRV_OPERAND_ACC40SK
:
586 errmsg
= insert_normal (cd
, fields
->f_ACC40Sk
, 0, 0, 30, 6, 32, total_length
, buffer
);
588 case FRV_OPERAND_ACC40UI
:
589 errmsg
= insert_normal (cd
, fields
->f_ACC40Ui
, 0, 0, 17, 6, 32, total_length
, buffer
);
591 case FRV_OPERAND_ACC40UK
:
592 errmsg
= insert_normal (cd
, fields
->f_ACC40Uk
, 0, 0, 30, 6, 32, total_length
, buffer
);
594 case FRV_OPERAND_ACCGI
:
595 errmsg
= insert_normal (cd
, fields
->f_ACCGi
, 0, 0, 17, 6, 32, total_length
, buffer
);
597 case FRV_OPERAND_ACCGK
:
598 errmsg
= insert_normal (cd
, fields
->f_ACCGk
, 0, 0, 30, 6, 32, total_length
, buffer
);
600 case FRV_OPERAND_CCI
:
601 errmsg
= insert_normal (cd
, fields
->f_CCi
, 0, 0, 11, 3, 32, total_length
, buffer
);
603 case FRV_OPERAND_CPRDOUBLEK
:
604 errmsg
= insert_normal (cd
, fields
->f_CPRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
606 case FRV_OPERAND_CPRI
:
607 errmsg
= insert_normal (cd
, fields
->f_CPRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
609 case FRV_OPERAND_CPRJ
:
610 errmsg
= insert_normal (cd
, fields
->f_CPRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
612 case FRV_OPERAND_CPRK
:
613 errmsg
= insert_normal (cd
, fields
->f_CPRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
615 case FRV_OPERAND_CRI
:
616 errmsg
= insert_normal (cd
, fields
->f_CRi
, 0, 0, 14, 3, 32, total_length
, buffer
);
618 case FRV_OPERAND_CRJ
:
619 errmsg
= insert_normal (cd
, fields
->f_CRj
, 0, 0, 2, 3, 32, total_length
, buffer
);
621 case FRV_OPERAND_CRJ_FLOAT
:
622 errmsg
= insert_normal (cd
, fields
->f_CRj_float
, 0, 0, 26, 2, 32, total_length
, buffer
);
624 case FRV_OPERAND_CRJ_INT
:
626 long value
= fields
->f_CRj_int
;
627 value
= ((value
) - (4));
628 errmsg
= insert_normal (cd
, value
, 0, 0, 26, 2, 32, total_length
, buffer
);
631 case FRV_OPERAND_CRK
:
632 errmsg
= insert_normal (cd
, fields
->f_CRk
, 0, 0, 27, 3, 32, total_length
, buffer
);
634 case FRV_OPERAND_FCCI_1
:
635 errmsg
= insert_normal (cd
, fields
->f_FCCi_1
, 0, 0, 11, 2, 32, total_length
, buffer
);
637 case FRV_OPERAND_FCCI_2
:
638 errmsg
= insert_normal (cd
, fields
->f_FCCi_2
, 0, 0, 26, 2, 32, total_length
, buffer
);
640 case FRV_OPERAND_FCCI_3
:
641 errmsg
= insert_normal (cd
, fields
->f_FCCi_3
, 0, 0, 1, 2, 32, total_length
, buffer
);
643 case FRV_OPERAND_FCCK
:
644 errmsg
= insert_normal (cd
, fields
->f_FCCk
, 0, 0, 26, 2, 32, total_length
, buffer
);
646 case FRV_OPERAND_FRDOUBLEI
:
647 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
649 case FRV_OPERAND_FRDOUBLEJ
:
650 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
652 case FRV_OPERAND_FRDOUBLEK
:
653 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
655 case FRV_OPERAND_FRI
:
656 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
658 case FRV_OPERAND_FRINTI
:
659 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
661 case FRV_OPERAND_FRINTIEVEN
:
662 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
664 case FRV_OPERAND_FRINTJ
:
665 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
667 case FRV_OPERAND_FRINTJEVEN
:
668 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
670 case FRV_OPERAND_FRINTK
:
671 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
673 case FRV_OPERAND_FRINTKEVEN
:
674 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
676 case FRV_OPERAND_FRJ
:
677 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
679 case FRV_OPERAND_FRK
:
680 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
682 case FRV_OPERAND_FRKHI
:
683 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
685 case FRV_OPERAND_FRKLO
:
686 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
688 case FRV_OPERAND_GRDOUBLEK
:
689 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
691 case FRV_OPERAND_GRI
:
692 errmsg
= insert_normal (cd
, fields
->f_GRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
694 case FRV_OPERAND_GRJ
:
695 errmsg
= insert_normal (cd
, fields
->f_GRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
697 case FRV_OPERAND_GRK
:
698 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
700 case FRV_OPERAND_GRKHI
:
701 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
703 case FRV_OPERAND_GRKLO
:
704 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
706 case FRV_OPERAND_ICCI_1
:
707 errmsg
= insert_normal (cd
, fields
->f_ICCi_1
, 0, 0, 11, 2, 32, total_length
, buffer
);
709 case FRV_OPERAND_ICCI_2
:
710 errmsg
= insert_normal (cd
, fields
->f_ICCi_2
, 0, 0, 26, 2, 32, total_length
, buffer
);
712 case FRV_OPERAND_ICCI_3
:
713 errmsg
= insert_normal (cd
, fields
->f_ICCi_3
, 0, 0, 1, 2, 32, total_length
, buffer
);
715 case FRV_OPERAND_LI
:
716 errmsg
= insert_normal (cd
, fields
->f_LI
, 0, 0, 25, 1, 32, total_length
, buffer
);
718 case FRV_OPERAND_LRAD
:
719 errmsg
= insert_normal (cd
, fields
->f_LRAD
, 0, 0, 4, 1, 32, total_length
, buffer
);
721 case FRV_OPERAND_LRAE
:
722 errmsg
= insert_normal (cd
, fields
->f_LRAE
, 0, 0, 5, 1, 32, total_length
, buffer
);
724 case FRV_OPERAND_LRAS
:
725 errmsg
= insert_normal (cd
, fields
->f_LRAS
, 0, 0, 3, 1, 32, total_length
, buffer
);
727 case FRV_OPERAND_TLBPRL
:
728 errmsg
= insert_normal (cd
, fields
->f_TLBPRL
, 0, 0, 25, 1, 32, total_length
, buffer
);
730 case FRV_OPERAND_TLBPROPX
:
731 errmsg
= insert_normal (cd
, fields
->f_TLBPRopx
, 0, 0, 28, 3, 32, total_length
, buffer
);
733 case FRV_OPERAND_AE
:
734 errmsg
= insert_normal (cd
, fields
->f_ae
, 0, 0, 25, 1, 32, total_length
, buffer
);
736 case FRV_OPERAND_CALLANN
:
737 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
739 case FRV_OPERAND_CCOND
:
740 errmsg
= insert_normal (cd
, fields
->f_ccond
, 0, 0, 12, 1, 32, total_length
, buffer
);
742 case FRV_OPERAND_COND
:
743 errmsg
= insert_normal (cd
, fields
->f_cond
, 0, 0, 8, 1, 32, total_length
, buffer
);
745 case FRV_OPERAND_D12
:
746 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
748 case FRV_OPERAND_DEBUG
:
749 errmsg
= insert_normal (cd
, fields
->f_debug
, 0, 0, 25, 1, 32, total_length
, buffer
);
751 case FRV_OPERAND_EIR
:
752 errmsg
= insert_normal (cd
, fields
->f_eir
, 0, 0, 17, 6, 32, total_length
, buffer
);
754 case FRV_OPERAND_HINT
:
755 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
757 case FRV_OPERAND_HINT_NOT_TAKEN
:
758 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
760 case FRV_OPERAND_HINT_TAKEN
:
761 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
763 case FRV_OPERAND_LABEL16
:
765 long value
= fields
->f_label16
;
766 value
= ((SI
) (((value
) - (pc
))) >> (2));
767 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 15, 16, 32, total_length
, buffer
);
770 case FRV_OPERAND_LABEL24
:
773 FLD (f_labelH6
) = ((SI
) (((FLD (f_label24
)) - (pc
))) >> (20));
774 FLD (f_labelL18
) = ((((UINT
) (((FLD (f_label24
)) - (pc
))) >> (2))) & (262143));
776 errmsg
= insert_normal (cd
, fields
->f_labelH6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, buffer
);
779 errmsg
= insert_normal (cd
, fields
->f_labelL18
, 0, 0, 17, 18, 32, total_length
, buffer
);
784 case FRV_OPERAND_LDANN
:
785 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
787 case FRV_OPERAND_LDDANN
:
788 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
790 case FRV_OPERAND_LOCK
:
791 errmsg
= insert_normal (cd
, fields
->f_lock
, 0, 0, 25, 1, 32, total_length
, buffer
);
793 case FRV_OPERAND_PACK
:
794 errmsg
= insert_normal (cd
, fields
->f_pack
, 0, 0, 31, 1, 32, total_length
, buffer
);
796 case FRV_OPERAND_S10
:
797 errmsg
= insert_normal (cd
, fields
->f_s10
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, buffer
);
799 case FRV_OPERAND_S12
:
800 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
802 case FRV_OPERAND_S16
:
803 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
805 case FRV_OPERAND_S5
:
806 errmsg
= insert_normal (cd
, fields
->f_s5
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, buffer
);
808 case FRV_OPERAND_S6
:
809 errmsg
= insert_normal (cd
, fields
->f_s6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, buffer
);
811 case FRV_OPERAND_S6_1
:
812 errmsg
= insert_normal (cd
, fields
->f_s6_1
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, buffer
);
814 case FRV_OPERAND_SLO16
:
815 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
817 case FRV_OPERAND_SPR
:
820 FLD (f_spr_h
) = ((UINT
) (FLD (f_spr
)) >> (6));
821 FLD (f_spr_l
) = ((FLD (f_spr
)) & (63));
823 errmsg
= insert_normal (cd
, fields
->f_spr_h
, 0, 0, 30, 6, 32, total_length
, buffer
);
826 errmsg
= insert_normal (cd
, fields
->f_spr_l
, 0, 0, 17, 6, 32, total_length
, buffer
);
831 case FRV_OPERAND_U12
:
834 FLD (f_u12_h
) = ((SI
) (FLD (f_u12
)) >> (6));
835 FLD (f_u12_l
) = ((FLD (f_u12
)) & (63));
837 errmsg
= insert_normal (cd
, fields
->f_u12_h
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, buffer
);
840 errmsg
= insert_normal (cd
, fields
->f_u12_l
, 0, 0, 5, 6, 32, total_length
, buffer
);
845 case FRV_OPERAND_U16
:
846 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
848 case FRV_OPERAND_U6
:
849 errmsg
= insert_normal (cd
, fields
->f_u6
, 0, 0, 5, 6, 32, total_length
, buffer
);
851 case FRV_OPERAND_UHI16
:
852 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
854 case FRV_OPERAND_ULO16
:
855 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
859 /* xgettext:c-format */
860 opcodes_error_handler
861 (_("internal error: unrecognized field %d while building insn"),
869 int frv_cgen_extract_operand
870 (CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
872 /* Main entry point for operand extraction.
873 The result is <= 0 for error, >0 for success.
874 ??? Actual values aren't well defined right now.
876 This function is basically just a big switch statement. Earlier versions
877 used tables to look up the function to use, but
878 - if the table contains both assembler and disassembler functions then
879 the disassembler contains much of the assembler and vice-versa,
880 - there's a lot of inlining possibilities as things grow,
881 - using a switch statement avoids the function call overhead.
883 This function could be moved into `print_insn_normal', but keeping it
884 separate makes clear the interface between `print_insn_normal' and each of
888 frv_cgen_extract_operand (CGEN_CPU_DESC cd
,
890 CGEN_EXTRACT_INFO
*ex_info
,
891 CGEN_INSN_INT insn_value
,
892 CGEN_FIELDS
* fields
,
895 /* Assume success (for those operands that are nops). */
897 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
901 case FRV_OPERAND_A0
:
902 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 1, 32, total_length
, pc
, & fields
->f_A
);
904 case FRV_OPERAND_A1
:
905 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 1, 32, total_length
, pc
, & fields
->f_A
);
907 case FRV_OPERAND_ACC40SI
:
908 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Si
);
910 case FRV_OPERAND_ACC40SK
:
911 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Sk
);
913 case FRV_OPERAND_ACC40UI
:
914 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Ui
);
916 case FRV_OPERAND_ACC40UK
:
917 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Uk
);
919 case FRV_OPERAND_ACCGI
:
920 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACCGi
);
922 case FRV_OPERAND_ACCGK
:
923 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACCGk
);
925 case FRV_OPERAND_CCI
:
926 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 3, 32, total_length
, pc
, & fields
->f_CCi
);
928 case FRV_OPERAND_CPRDOUBLEK
:
929 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
931 case FRV_OPERAND_CPRI
:
932 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_CPRi
);
934 case FRV_OPERAND_CPRJ
:
935 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_CPRj
);
937 case FRV_OPERAND_CPRK
:
938 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
940 case FRV_OPERAND_CRI
:
941 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 14, 3, 32, total_length
, pc
, & fields
->f_CRi
);
943 case FRV_OPERAND_CRJ
:
944 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 2, 3, 32, total_length
, pc
, & fields
->f_CRj
);
946 case FRV_OPERAND_CRJ_FLOAT
:
947 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_CRj_float
);
949 case FRV_OPERAND_CRJ_INT
:
952 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & value
);
953 value
= ((value
) + (4));
954 fields
->f_CRj_int
= value
;
957 case FRV_OPERAND_CRK
:
958 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 27, 3, 32, total_length
, pc
, & fields
->f_CRk
);
960 case FRV_OPERAND_FCCI_1
:
961 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_FCCi_1
);
963 case FRV_OPERAND_FCCI_2
:
964 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCi_2
);
966 case FRV_OPERAND_FCCI_3
:
967 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_FCCi_3
);
969 case FRV_OPERAND_FCCK
:
970 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCk
);
972 case FRV_OPERAND_FRDOUBLEI
:
973 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
975 case FRV_OPERAND_FRDOUBLEJ
:
976 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
978 case FRV_OPERAND_FRDOUBLEK
:
979 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
981 case FRV_OPERAND_FRI
:
982 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
984 case FRV_OPERAND_FRINTI
:
985 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
987 case FRV_OPERAND_FRINTIEVEN
:
988 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
990 case FRV_OPERAND_FRINTJ
:
991 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
993 case FRV_OPERAND_FRINTJEVEN
:
994 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
996 case FRV_OPERAND_FRINTK
:
997 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
999 case FRV_OPERAND_FRINTKEVEN
:
1000 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1002 case FRV_OPERAND_FRJ
:
1003 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
1005 case FRV_OPERAND_FRK
:
1006 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1008 case FRV_OPERAND_FRKHI
:
1009 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1011 case FRV_OPERAND_FRKLO
:
1012 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1014 case FRV_OPERAND_GRDOUBLEK
:
1015 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1017 case FRV_OPERAND_GRI
:
1018 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_GRi
);
1020 case FRV_OPERAND_GRJ
:
1021 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_GRj
);
1023 case FRV_OPERAND_GRK
:
1024 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1026 case FRV_OPERAND_GRKHI
:
1027 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1029 case FRV_OPERAND_GRKLO
:
1030 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1032 case FRV_OPERAND_ICCI_1
:
1033 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_ICCi_1
);
1035 case FRV_OPERAND_ICCI_2
:
1036 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_ICCi_2
);
1038 case FRV_OPERAND_ICCI_3
:
1039 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_ICCi_3
);
1041 case FRV_OPERAND_LI
:
1042 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_LI
);
1044 case FRV_OPERAND_LRAD
:
1045 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 1, 32, total_length
, pc
, & fields
->f_LRAD
);
1047 case FRV_OPERAND_LRAE
:
1048 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 1, 32, total_length
, pc
, & fields
->f_LRAE
);
1050 case FRV_OPERAND_LRAS
:
1051 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 3, 1, 32, total_length
, pc
, & fields
->f_LRAS
);
1053 case FRV_OPERAND_TLBPRL
:
1054 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_TLBPRL
);
1056 case FRV_OPERAND_TLBPROPX
:
1057 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 28, 3, 32, total_length
, pc
, & fields
->f_TLBPRopx
);
1059 case FRV_OPERAND_AE
:
1060 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_ae
);
1062 case FRV_OPERAND_CALLANN
:
1063 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 0, 0, 32, total_length
, pc
, & fields
->f_reloc_ann
);
1065 case FRV_OPERAND_CCOND
:
1066 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 1, 32, total_length
, pc
, & fields
->f_ccond
);
1068 case FRV_OPERAND_COND
:
1069 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 1, 32, total_length
, pc
, & fields
->f_cond
);
1071 case FRV_OPERAND_D12
:
1072 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1074 case FRV_OPERAND_DEBUG
:
1075 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_debug
);
1077 case FRV_OPERAND_EIR
:
1078 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_eir
);
1080 case FRV_OPERAND_HINT
:
1081 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1083 case FRV_OPERAND_HINT_NOT_TAKEN
:
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_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_LABEL16
:
1092 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
);
1093 value
= ((((value
) << (2))) + (pc
));
1094 fields
->f_label16
= value
;
1097 case FRV_OPERAND_LABEL24
:
1099 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, pc
, & fields
->f_labelH6
);
1100 if (length
<= 0) break;
1101 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 18, 32, total_length
, pc
, & fields
->f_labelL18
);
1102 if (length
<= 0) break;
1104 FLD (f_label24
) = ((((((((FLD (f_labelH6
)) << (18))) | (FLD (f_labelL18
)))) << (2))) + (pc
));
1108 case FRV_OPERAND_LDANN
:
1109 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 0, 0, 32, total_length
, pc
, & fields
->f_reloc_ann
);
1111 case FRV_OPERAND_LDDANN
:
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_LOCK
:
1115 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_lock
);
1117 case FRV_OPERAND_PACK
:
1118 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 31, 1, 32, total_length
, pc
, & fields
->f_pack
);
1120 case FRV_OPERAND_S10
:
1121 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, pc
, & fields
->f_s10
);
1123 case FRV_OPERAND_S12
:
1124 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1126 case FRV_OPERAND_S16
:
1127 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1129 case FRV_OPERAND_S5
:
1130 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, pc
, & fields
->f_s5
);
1132 case FRV_OPERAND_S6
:
1133 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, pc
, & fields
->f_s6
);
1135 case FRV_OPERAND_S6_1
:
1136 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, pc
, & fields
->f_s6_1
);
1138 case FRV_OPERAND_SLO16
:
1139 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1141 case FRV_OPERAND_SPR
:
1143 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_spr_h
);
1144 if (length
<= 0) break;
1145 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_spr_l
);
1146 if (length
<= 0) break;
1148 FLD (f_spr
) = ((((FLD (f_spr_h
)) << (6))) | (FLD (f_spr_l
)));
1152 case FRV_OPERAND_U12
:
1154 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, pc
, & fields
->f_u12_h
);
1155 if (length
<= 0) break;
1156 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u12_l
);
1157 if (length
<= 0) break;
1159 FLD (f_u12
) = ((((FLD (f_u12_h
)) << (6))) | (FLD (f_u12_l
)));
1163 case FRV_OPERAND_U16
:
1164 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1166 case FRV_OPERAND_U6
:
1167 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u6
);
1169 case FRV_OPERAND_UHI16
:
1170 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1172 case FRV_OPERAND_ULO16
:
1173 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1177 /* xgettext:c-format */
1178 opcodes_error_handler
1179 (_("internal error: unrecognized field %d while decoding insn"),
1187 cgen_insert_fn
* const frv_cgen_insert_handlers
[] =
1192 cgen_extract_fn
* const frv_cgen_extract_handlers
[] =
1194 extract_insn_normal
,
1197 int frv_cgen_get_int_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
1198 bfd_vma
frv_cgen_get_vma_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
1200 /* Getting values from cgen_fields is handled by a collection of functions.
1201 They are distinguished by the type of the VALUE argument they return.
1202 TODO: floating point, inlining support, remove cases where result type
1206 frv_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1208 const CGEN_FIELDS
* fields
)
1214 case FRV_OPERAND_A0
:
1215 value
= fields
->f_A
;
1217 case FRV_OPERAND_A1
:
1218 value
= fields
->f_A
;
1220 case FRV_OPERAND_ACC40SI
:
1221 value
= fields
->f_ACC40Si
;
1223 case FRV_OPERAND_ACC40SK
:
1224 value
= fields
->f_ACC40Sk
;
1226 case FRV_OPERAND_ACC40UI
:
1227 value
= fields
->f_ACC40Ui
;
1229 case FRV_OPERAND_ACC40UK
:
1230 value
= fields
->f_ACC40Uk
;
1232 case FRV_OPERAND_ACCGI
:
1233 value
= fields
->f_ACCGi
;
1235 case FRV_OPERAND_ACCGK
:
1236 value
= fields
->f_ACCGk
;
1238 case FRV_OPERAND_CCI
:
1239 value
= fields
->f_CCi
;
1241 case FRV_OPERAND_CPRDOUBLEK
:
1242 value
= fields
->f_CPRk
;
1244 case FRV_OPERAND_CPRI
:
1245 value
= fields
->f_CPRi
;
1247 case FRV_OPERAND_CPRJ
:
1248 value
= fields
->f_CPRj
;
1250 case FRV_OPERAND_CPRK
:
1251 value
= fields
->f_CPRk
;
1253 case FRV_OPERAND_CRI
:
1254 value
= fields
->f_CRi
;
1256 case FRV_OPERAND_CRJ
:
1257 value
= fields
->f_CRj
;
1259 case FRV_OPERAND_CRJ_FLOAT
:
1260 value
= fields
->f_CRj_float
;
1262 case FRV_OPERAND_CRJ_INT
:
1263 value
= fields
->f_CRj_int
;
1265 case FRV_OPERAND_CRK
:
1266 value
= fields
->f_CRk
;
1268 case FRV_OPERAND_FCCI_1
:
1269 value
= fields
->f_FCCi_1
;
1271 case FRV_OPERAND_FCCI_2
:
1272 value
= fields
->f_FCCi_2
;
1274 case FRV_OPERAND_FCCI_3
:
1275 value
= fields
->f_FCCi_3
;
1277 case FRV_OPERAND_FCCK
:
1278 value
= fields
->f_FCCk
;
1280 case FRV_OPERAND_FRDOUBLEI
:
1281 value
= fields
->f_FRi
;
1283 case FRV_OPERAND_FRDOUBLEJ
:
1284 value
= fields
->f_FRj
;
1286 case FRV_OPERAND_FRDOUBLEK
:
1287 value
= fields
->f_FRk
;
1289 case FRV_OPERAND_FRI
:
1290 value
= fields
->f_FRi
;
1292 case FRV_OPERAND_FRINTI
:
1293 value
= fields
->f_FRi
;
1295 case FRV_OPERAND_FRINTIEVEN
:
1296 value
= fields
->f_FRi
;
1298 case FRV_OPERAND_FRINTJ
:
1299 value
= fields
->f_FRj
;
1301 case FRV_OPERAND_FRINTJEVEN
:
1302 value
= fields
->f_FRj
;
1304 case FRV_OPERAND_FRINTK
:
1305 value
= fields
->f_FRk
;
1307 case FRV_OPERAND_FRINTKEVEN
:
1308 value
= fields
->f_FRk
;
1310 case FRV_OPERAND_FRJ
:
1311 value
= fields
->f_FRj
;
1313 case FRV_OPERAND_FRK
:
1314 value
= fields
->f_FRk
;
1316 case FRV_OPERAND_FRKHI
:
1317 value
= fields
->f_FRk
;
1319 case FRV_OPERAND_FRKLO
:
1320 value
= fields
->f_FRk
;
1322 case FRV_OPERAND_GRDOUBLEK
:
1323 value
= fields
->f_GRk
;
1325 case FRV_OPERAND_GRI
:
1326 value
= fields
->f_GRi
;
1328 case FRV_OPERAND_GRJ
:
1329 value
= fields
->f_GRj
;
1331 case FRV_OPERAND_GRK
:
1332 value
= fields
->f_GRk
;
1334 case FRV_OPERAND_GRKHI
:
1335 value
= fields
->f_GRk
;
1337 case FRV_OPERAND_GRKLO
:
1338 value
= fields
->f_GRk
;
1340 case FRV_OPERAND_ICCI_1
:
1341 value
= fields
->f_ICCi_1
;
1343 case FRV_OPERAND_ICCI_2
:
1344 value
= fields
->f_ICCi_2
;
1346 case FRV_OPERAND_ICCI_3
:
1347 value
= fields
->f_ICCi_3
;
1349 case FRV_OPERAND_LI
:
1350 value
= fields
->f_LI
;
1352 case FRV_OPERAND_LRAD
:
1353 value
= fields
->f_LRAD
;
1355 case FRV_OPERAND_LRAE
:
1356 value
= fields
->f_LRAE
;
1358 case FRV_OPERAND_LRAS
:
1359 value
= fields
->f_LRAS
;
1361 case FRV_OPERAND_TLBPRL
:
1362 value
= fields
->f_TLBPRL
;
1364 case FRV_OPERAND_TLBPROPX
:
1365 value
= fields
->f_TLBPRopx
;
1367 case FRV_OPERAND_AE
:
1368 value
= fields
->f_ae
;
1370 case FRV_OPERAND_CALLANN
:
1371 value
= fields
->f_reloc_ann
;
1373 case FRV_OPERAND_CCOND
:
1374 value
= fields
->f_ccond
;
1376 case FRV_OPERAND_COND
:
1377 value
= fields
->f_cond
;
1379 case FRV_OPERAND_D12
:
1380 value
= fields
->f_d12
;
1382 case FRV_OPERAND_DEBUG
:
1383 value
= fields
->f_debug
;
1385 case FRV_OPERAND_EIR
:
1386 value
= fields
->f_eir
;
1388 case FRV_OPERAND_HINT
:
1389 value
= fields
->f_hint
;
1391 case FRV_OPERAND_HINT_NOT_TAKEN
:
1392 value
= fields
->f_hint
;
1394 case FRV_OPERAND_HINT_TAKEN
:
1395 value
= fields
->f_hint
;
1397 case FRV_OPERAND_LABEL16
:
1398 value
= fields
->f_label16
;
1400 case FRV_OPERAND_LABEL24
:
1401 value
= fields
->f_label24
;
1403 case FRV_OPERAND_LDANN
:
1404 value
= fields
->f_reloc_ann
;
1406 case FRV_OPERAND_LDDANN
:
1407 value
= fields
->f_reloc_ann
;
1409 case FRV_OPERAND_LOCK
:
1410 value
= fields
->f_lock
;
1412 case FRV_OPERAND_PACK
:
1413 value
= fields
->f_pack
;
1415 case FRV_OPERAND_S10
:
1416 value
= fields
->f_s10
;
1418 case FRV_OPERAND_S12
:
1419 value
= fields
->f_d12
;
1421 case FRV_OPERAND_S16
:
1422 value
= fields
->f_s16
;
1424 case FRV_OPERAND_S5
:
1425 value
= fields
->f_s5
;
1427 case FRV_OPERAND_S6
:
1428 value
= fields
->f_s6
;
1430 case FRV_OPERAND_S6_1
:
1431 value
= fields
->f_s6_1
;
1433 case FRV_OPERAND_SLO16
:
1434 value
= fields
->f_s16
;
1436 case FRV_OPERAND_SPR
:
1437 value
= fields
->f_spr
;
1439 case FRV_OPERAND_U12
:
1440 value
= fields
->f_u12
;
1442 case FRV_OPERAND_U16
:
1443 value
= fields
->f_u16
;
1445 case FRV_OPERAND_U6
:
1446 value
= fields
->f_u6
;
1448 case FRV_OPERAND_UHI16
:
1449 value
= fields
->f_u16
;
1451 case FRV_OPERAND_ULO16
:
1452 value
= fields
->f_u16
;
1456 /* xgettext:c-format */
1457 opcodes_error_handler
1458 (_("internal error: unrecognized field %d while getting int operand"),
1467 frv_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1469 const CGEN_FIELDS
* fields
)
1475 case FRV_OPERAND_A0
:
1476 value
= fields
->f_A
;
1478 case FRV_OPERAND_A1
:
1479 value
= fields
->f_A
;
1481 case FRV_OPERAND_ACC40SI
:
1482 value
= fields
->f_ACC40Si
;
1484 case FRV_OPERAND_ACC40SK
:
1485 value
= fields
->f_ACC40Sk
;
1487 case FRV_OPERAND_ACC40UI
:
1488 value
= fields
->f_ACC40Ui
;
1490 case FRV_OPERAND_ACC40UK
:
1491 value
= fields
->f_ACC40Uk
;
1493 case FRV_OPERAND_ACCGI
:
1494 value
= fields
->f_ACCGi
;
1496 case FRV_OPERAND_ACCGK
:
1497 value
= fields
->f_ACCGk
;
1499 case FRV_OPERAND_CCI
:
1500 value
= fields
->f_CCi
;
1502 case FRV_OPERAND_CPRDOUBLEK
:
1503 value
= fields
->f_CPRk
;
1505 case FRV_OPERAND_CPRI
:
1506 value
= fields
->f_CPRi
;
1508 case FRV_OPERAND_CPRJ
:
1509 value
= fields
->f_CPRj
;
1511 case FRV_OPERAND_CPRK
:
1512 value
= fields
->f_CPRk
;
1514 case FRV_OPERAND_CRI
:
1515 value
= fields
->f_CRi
;
1517 case FRV_OPERAND_CRJ
:
1518 value
= fields
->f_CRj
;
1520 case FRV_OPERAND_CRJ_FLOAT
:
1521 value
= fields
->f_CRj_float
;
1523 case FRV_OPERAND_CRJ_INT
:
1524 value
= fields
->f_CRj_int
;
1526 case FRV_OPERAND_CRK
:
1527 value
= fields
->f_CRk
;
1529 case FRV_OPERAND_FCCI_1
:
1530 value
= fields
->f_FCCi_1
;
1532 case FRV_OPERAND_FCCI_2
:
1533 value
= fields
->f_FCCi_2
;
1535 case FRV_OPERAND_FCCI_3
:
1536 value
= fields
->f_FCCi_3
;
1538 case FRV_OPERAND_FCCK
:
1539 value
= fields
->f_FCCk
;
1541 case FRV_OPERAND_FRDOUBLEI
:
1542 value
= fields
->f_FRi
;
1544 case FRV_OPERAND_FRDOUBLEJ
:
1545 value
= fields
->f_FRj
;
1547 case FRV_OPERAND_FRDOUBLEK
:
1548 value
= fields
->f_FRk
;
1550 case FRV_OPERAND_FRI
:
1551 value
= fields
->f_FRi
;
1553 case FRV_OPERAND_FRINTI
:
1554 value
= fields
->f_FRi
;
1556 case FRV_OPERAND_FRINTIEVEN
:
1557 value
= fields
->f_FRi
;
1559 case FRV_OPERAND_FRINTJ
:
1560 value
= fields
->f_FRj
;
1562 case FRV_OPERAND_FRINTJEVEN
:
1563 value
= fields
->f_FRj
;
1565 case FRV_OPERAND_FRINTK
:
1566 value
= fields
->f_FRk
;
1568 case FRV_OPERAND_FRINTKEVEN
:
1569 value
= fields
->f_FRk
;
1571 case FRV_OPERAND_FRJ
:
1572 value
= fields
->f_FRj
;
1574 case FRV_OPERAND_FRK
:
1575 value
= fields
->f_FRk
;
1577 case FRV_OPERAND_FRKHI
:
1578 value
= fields
->f_FRk
;
1580 case FRV_OPERAND_FRKLO
:
1581 value
= fields
->f_FRk
;
1583 case FRV_OPERAND_GRDOUBLEK
:
1584 value
= fields
->f_GRk
;
1586 case FRV_OPERAND_GRI
:
1587 value
= fields
->f_GRi
;
1589 case FRV_OPERAND_GRJ
:
1590 value
= fields
->f_GRj
;
1592 case FRV_OPERAND_GRK
:
1593 value
= fields
->f_GRk
;
1595 case FRV_OPERAND_GRKHI
:
1596 value
= fields
->f_GRk
;
1598 case FRV_OPERAND_GRKLO
:
1599 value
= fields
->f_GRk
;
1601 case FRV_OPERAND_ICCI_1
:
1602 value
= fields
->f_ICCi_1
;
1604 case FRV_OPERAND_ICCI_2
:
1605 value
= fields
->f_ICCi_2
;
1607 case FRV_OPERAND_ICCI_3
:
1608 value
= fields
->f_ICCi_3
;
1610 case FRV_OPERAND_LI
:
1611 value
= fields
->f_LI
;
1613 case FRV_OPERAND_LRAD
:
1614 value
= fields
->f_LRAD
;
1616 case FRV_OPERAND_LRAE
:
1617 value
= fields
->f_LRAE
;
1619 case FRV_OPERAND_LRAS
:
1620 value
= fields
->f_LRAS
;
1622 case FRV_OPERAND_TLBPRL
:
1623 value
= fields
->f_TLBPRL
;
1625 case FRV_OPERAND_TLBPROPX
:
1626 value
= fields
->f_TLBPRopx
;
1628 case FRV_OPERAND_AE
:
1629 value
= fields
->f_ae
;
1631 case FRV_OPERAND_CALLANN
:
1632 value
= fields
->f_reloc_ann
;
1634 case FRV_OPERAND_CCOND
:
1635 value
= fields
->f_ccond
;
1637 case FRV_OPERAND_COND
:
1638 value
= fields
->f_cond
;
1640 case FRV_OPERAND_D12
:
1641 value
= fields
->f_d12
;
1643 case FRV_OPERAND_DEBUG
:
1644 value
= fields
->f_debug
;
1646 case FRV_OPERAND_EIR
:
1647 value
= fields
->f_eir
;
1649 case FRV_OPERAND_HINT
:
1650 value
= fields
->f_hint
;
1652 case FRV_OPERAND_HINT_NOT_TAKEN
:
1653 value
= fields
->f_hint
;
1655 case FRV_OPERAND_HINT_TAKEN
:
1656 value
= fields
->f_hint
;
1658 case FRV_OPERAND_LABEL16
:
1659 value
= fields
->f_label16
;
1661 case FRV_OPERAND_LABEL24
:
1662 value
= fields
->f_label24
;
1664 case FRV_OPERAND_LDANN
:
1665 value
= fields
->f_reloc_ann
;
1667 case FRV_OPERAND_LDDANN
:
1668 value
= fields
->f_reloc_ann
;
1670 case FRV_OPERAND_LOCK
:
1671 value
= fields
->f_lock
;
1673 case FRV_OPERAND_PACK
:
1674 value
= fields
->f_pack
;
1676 case FRV_OPERAND_S10
:
1677 value
= fields
->f_s10
;
1679 case FRV_OPERAND_S12
:
1680 value
= fields
->f_d12
;
1682 case FRV_OPERAND_S16
:
1683 value
= fields
->f_s16
;
1685 case FRV_OPERAND_S5
:
1686 value
= fields
->f_s5
;
1688 case FRV_OPERAND_S6
:
1689 value
= fields
->f_s6
;
1691 case FRV_OPERAND_S6_1
:
1692 value
= fields
->f_s6_1
;
1694 case FRV_OPERAND_SLO16
:
1695 value
= fields
->f_s16
;
1697 case FRV_OPERAND_SPR
:
1698 value
= fields
->f_spr
;
1700 case FRV_OPERAND_U12
:
1701 value
= fields
->f_u12
;
1703 case FRV_OPERAND_U16
:
1704 value
= fields
->f_u16
;
1706 case FRV_OPERAND_U6
:
1707 value
= fields
->f_u6
;
1709 case FRV_OPERAND_UHI16
:
1710 value
= fields
->f_u16
;
1712 case FRV_OPERAND_ULO16
:
1713 value
= fields
->f_u16
;
1717 /* xgettext:c-format */
1718 opcodes_error_handler
1719 (_("internal error: unrecognized field %d while getting vma operand"),
1727 void frv_cgen_set_int_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int);
1728 void frv_cgen_set_vma_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
);
1730 /* Stuffing values in cgen_fields is handled by a collection of functions.
1731 They are distinguished by the type of the VALUE argument they accept.
1732 TODO: floating point, inlining support, remove cases where argument type
1736 frv_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1738 CGEN_FIELDS
* fields
,
1743 case FRV_OPERAND_A0
:
1744 fields
->f_A
= value
;
1746 case FRV_OPERAND_A1
:
1747 fields
->f_A
= value
;
1749 case FRV_OPERAND_ACC40SI
:
1750 fields
->f_ACC40Si
= value
;
1752 case FRV_OPERAND_ACC40SK
:
1753 fields
->f_ACC40Sk
= value
;
1755 case FRV_OPERAND_ACC40UI
:
1756 fields
->f_ACC40Ui
= value
;
1758 case FRV_OPERAND_ACC40UK
:
1759 fields
->f_ACC40Uk
= value
;
1761 case FRV_OPERAND_ACCGI
:
1762 fields
->f_ACCGi
= value
;
1764 case FRV_OPERAND_ACCGK
:
1765 fields
->f_ACCGk
= value
;
1767 case FRV_OPERAND_CCI
:
1768 fields
->f_CCi
= value
;
1770 case FRV_OPERAND_CPRDOUBLEK
:
1771 fields
->f_CPRk
= value
;
1773 case FRV_OPERAND_CPRI
:
1774 fields
->f_CPRi
= value
;
1776 case FRV_OPERAND_CPRJ
:
1777 fields
->f_CPRj
= value
;
1779 case FRV_OPERAND_CPRK
:
1780 fields
->f_CPRk
= value
;
1782 case FRV_OPERAND_CRI
:
1783 fields
->f_CRi
= value
;
1785 case FRV_OPERAND_CRJ
:
1786 fields
->f_CRj
= value
;
1788 case FRV_OPERAND_CRJ_FLOAT
:
1789 fields
->f_CRj_float
= value
;
1791 case FRV_OPERAND_CRJ_INT
:
1792 fields
->f_CRj_int
= value
;
1794 case FRV_OPERAND_CRK
:
1795 fields
->f_CRk
= value
;
1797 case FRV_OPERAND_FCCI_1
:
1798 fields
->f_FCCi_1
= value
;
1800 case FRV_OPERAND_FCCI_2
:
1801 fields
->f_FCCi_2
= value
;
1803 case FRV_OPERAND_FCCI_3
:
1804 fields
->f_FCCi_3
= value
;
1806 case FRV_OPERAND_FCCK
:
1807 fields
->f_FCCk
= value
;
1809 case FRV_OPERAND_FRDOUBLEI
:
1810 fields
->f_FRi
= value
;
1812 case FRV_OPERAND_FRDOUBLEJ
:
1813 fields
->f_FRj
= value
;
1815 case FRV_OPERAND_FRDOUBLEK
:
1816 fields
->f_FRk
= value
;
1818 case FRV_OPERAND_FRI
:
1819 fields
->f_FRi
= value
;
1821 case FRV_OPERAND_FRINTI
:
1822 fields
->f_FRi
= value
;
1824 case FRV_OPERAND_FRINTIEVEN
:
1825 fields
->f_FRi
= value
;
1827 case FRV_OPERAND_FRINTJ
:
1828 fields
->f_FRj
= value
;
1830 case FRV_OPERAND_FRINTJEVEN
:
1831 fields
->f_FRj
= value
;
1833 case FRV_OPERAND_FRINTK
:
1834 fields
->f_FRk
= value
;
1836 case FRV_OPERAND_FRINTKEVEN
:
1837 fields
->f_FRk
= value
;
1839 case FRV_OPERAND_FRJ
:
1840 fields
->f_FRj
= value
;
1842 case FRV_OPERAND_FRK
:
1843 fields
->f_FRk
= value
;
1845 case FRV_OPERAND_FRKHI
:
1846 fields
->f_FRk
= value
;
1848 case FRV_OPERAND_FRKLO
:
1849 fields
->f_FRk
= value
;
1851 case FRV_OPERAND_GRDOUBLEK
:
1852 fields
->f_GRk
= value
;
1854 case FRV_OPERAND_GRI
:
1855 fields
->f_GRi
= value
;
1857 case FRV_OPERAND_GRJ
:
1858 fields
->f_GRj
= value
;
1860 case FRV_OPERAND_GRK
:
1861 fields
->f_GRk
= value
;
1863 case FRV_OPERAND_GRKHI
:
1864 fields
->f_GRk
= value
;
1866 case FRV_OPERAND_GRKLO
:
1867 fields
->f_GRk
= value
;
1869 case FRV_OPERAND_ICCI_1
:
1870 fields
->f_ICCi_1
= value
;
1872 case FRV_OPERAND_ICCI_2
:
1873 fields
->f_ICCi_2
= value
;
1875 case FRV_OPERAND_ICCI_3
:
1876 fields
->f_ICCi_3
= value
;
1878 case FRV_OPERAND_LI
:
1879 fields
->f_LI
= value
;
1881 case FRV_OPERAND_LRAD
:
1882 fields
->f_LRAD
= value
;
1884 case FRV_OPERAND_LRAE
:
1885 fields
->f_LRAE
= value
;
1887 case FRV_OPERAND_LRAS
:
1888 fields
->f_LRAS
= value
;
1890 case FRV_OPERAND_TLBPRL
:
1891 fields
->f_TLBPRL
= value
;
1893 case FRV_OPERAND_TLBPROPX
:
1894 fields
->f_TLBPRopx
= value
;
1896 case FRV_OPERAND_AE
:
1897 fields
->f_ae
= value
;
1899 case FRV_OPERAND_CALLANN
:
1900 fields
->f_reloc_ann
= value
;
1902 case FRV_OPERAND_CCOND
:
1903 fields
->f_ccond
= value
;
1905 case FRV_OPERAND_COND
:
1906 fields
->f_cond
= value
;
1908 case FRV_OPERAND_D12
:
1909 fields
->f_d12
= value
;
1911 case FRV_OPERAND_DEBUG
:
1912 fields
->f_debug
= value
;
1914 case FRV_OPERAND_EIR
:
1915 fields
->f_eir
= value
;
1917 case FRV_OPERAND_HINT
:
1918 fields
->f_hint
= value
;
1920 case FRV_OPERAND_HINT_NOT_TAKEN
:
1921 fields
->f_hint
= value
;
1923 case FRV_OPERAND_HINT_TAKEN
:
1924 fields
->f_hint
= value
;
1926 case FRV_OPERAND_LABEL16
:
1927 fields
->f_label16
= value
;
1929 case FRV_OPERAND_LABEL24
:
1930 fields
->f_label24
= value
;
1932 case FRV_OPERAND_LDANN
:
1933 fields
->f_reloc_ann
= value
;
1935 case FRV_OPERAND_LDDANN
:
1936 fields
->f_reloc_ann
= value
;
1938 case FRV_OPERAND_LOCK
:
1939 fields
->f_lock
= value
;
1941 case FRV_OPERAND_PACK
:
1942 fields
->f_pack
= value
;
1944 case FRV_OPERAND_S10
:
1945 fields
->f_s10
= value
;
1947 case FRV_OPERAND_S12
:
1948 fields
->f_d12
= value
;
1950 case FRV_OPERAND_S16
:
1951 fields
->f_s16
= value
;
1953 case FRV_OPERAND_S5
:
1954 fields
->f_s5
= value
;
1956 case FRV_OPERAND_S6
:
1957 fields
->f_s6
= value
;
1959 case FRV_OPERAND_S6_1
:
1960 fields
->f_s6_1
= value
;
1962 case FRV_OPERAND_SLO16
:
1963 fields
->f_s16
= value
;
1965 case FRV_OPERAND_SPR
:
1966 fields
->f_spr
= value
;
1968 case FRV_OPERAND_U12
:
1969 fields
->f_u12
= value
;
1971 case FRV_OPERAND_U16
:
1972 fields
->f_u16
= value
;
1974 case FRV_OPERAND_U6
:
1975 fields
->f_u6
= value
;
1977 case FRV_OPERAND_UHI16
:
1978 fields
->f_u16
= value
;
1980 case FRV_OPERAND_ULO16
:
1981 fields
->f_u16
= value
;
1985 /* xgettext:c-format */
1986 opcodes_error_handler
1987 (_("internal error: unrecognized field %d while setting int operand"),
1994 frv_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1996 CGEN_FIELDS
* fields
,
2001 case FRV_OPERAND_A0
:
2002 fields
->f_A
= value
;
2004 case FRV_OPERAND_A1
:
2005 fields
->f_A
= value
;
2007 case FRV_OPERAND_ACC40SI
:
2008 fields
->f_ACC40Si
= value
;
2010 case FRV_OPERAND_ACC40SK
:
2011 fields
->f_ACC40Sk
= value
;
2013 case FRV_OPERAND_ACC40UI
:
2014 fields
->f_ACC40Ui
= value
;
2016 case FRV_OPERAND_ACC40UK
:
2017 fields
->f_ACC40Uk
= value
;
2019 case FRV_OPERAND_ACCGI
:
2020 fields
->f_ACCGi
= value
;
2022 case FRV_OPERAND_ACCGK
:
2023 fields
->f_ACCGk
= value
;
2025 case FRV_OPERAND_CCI
:
2026 fields
->f_CCi
= value
;
2028 case FRV_OPERAND_CPRDOUBLEK
:
2029 fields
->f_CPRk
= value
;
2031 case FRV_OPERAND_CPRI
:
2032 fields
->f_CPRi
= value
;
2034 case FRV_OPERAND_CPRJ
:
2035 fields
->f_CPRj
= value
;
2037 case FRV_OPERAND_CPRK
:
2038 fields
->f_CPRk
= value
;
2040 case FRV_OPERAND_CRI
:
2041 fields
->f_CRi
= value
;
2043 case FRV_OPERAND_CRJ
:
2044 fields
->f_CRj
= value
;
2046 case FRV_OPERAND_CRJ_FLOAT
:
2047 fields
->f_CRj_float
= value
;
2049 case FRV_OPERAND_CRJ_INT
:
2050 fields
->f_CRj_int
= value
;
2052 case FRV_OPERAND_CRK
:
2053 fields
->f_CRk
= value
;
2055 case FRV_OPERAND_FCCI_1
:
2056 fields
->f_FCCi_1
= value
;
2058 case FRV_OPERAND_FCCI_2
:
2059 fields
->f_FCCi_2
= value
;
2061 case FRV_OPERAND_FCCI_3
:
2062 fields
->f_FCCi_3
= value
;
2064 case FRV_OPERAND_FCCK
:
2065 fields
->f_FCCk
= value
;
2067 case FRV_OPERAND_FRDOUBLEI
:
2068 fields
->f_FRi
= value
;
2070 case FRV_OPERAND_FRDOUBLEJ
:
2071 fields
->f_FRj
= value
;
2073 case FRV_OPERAND_FRDOUBLEK
:
2074 fields
->f_FRk
= value
;
2076 case FRV_OPERAND_FRI
:
2077 fields
->f_FRi
= value
;
2079 case FRV_OPERAND_FRINTI
:
2080 fields
->f_FRi
= value
;
2082 case FRV_OPERAND_FRINTIEVEN
:
2083 fields
->f_FRi
= value
;
2085 case FRV_OPERAND_FRINTJ
:
2086 fields
->f_FRj
= value
;
2088 case FRV_OPERAND_FRINTJEVEN
:
2089 fields
->f_FRj
= value
;
2091 case FRV_OPERAND_FRINTK
:
2092 fields
->f_FRk
= value
;
2094 case FRV_OPERAND_FRINTKEVEN
:
2095 fields
->f_FRk
= value
;
2097 case FRV_OPERAND_FRJ
:
2098 fields
->f_FRj
= value
;
2100 case FRV_OPERAND_FRK
:
2101 fields
->f_FRk
= value
;
2103 case FRV_OPERAND_FRKHI
:
2104 fields
->f_FRk
= value
;
2106 case FRV_OPERAND_FRKLO
:
2107 fields
->f_FRk
= value
;
2109 case FRV_OPERAND_GRDOUBLEK
:
2110 fields
->f_GRk
= value
;
2112 case FRV_OPERAND_GRI
:
2113 fields
->f_GRi
= value
;
2115 case FRV_OPERAND_GRJ
:
2116 fields
->f_GRj
= value
;
2118 case FRV_OPERAND_GRK
:
2119 fields
->f_GRk
= value
;
2121 case FRV_OPERAND_GRKHI
:
2122 fields
->f_GRk
= value
;
2124 case FRV_OPERAND_GRKLO
:
2125 fields
->f_GRk
= value
;
2127 case FRV_OPERAND_ICCI_1
:
2128 fields
->f_ICCi_1
= value
;
2130 case FRV_OPERAND_ICCI_2
:
2131 fields
->f_ICCi_2
= value
;
2133 case FRV_OPERAND_ICCI_3
:
2134 fields
->f_ICCi_3
= value
;
2136 case FRV_OPERAND_LI
:
2137 fields
->f_LI
= value
;
2139 case FRV_OPERAND_LRAD
:
2140 fields
->f_LRAD
= value
;
2142 case FRV_OPERAND_LRAE
:
2143 fields
->f_LRAE
= value
;
2145 case FRV_OPERAND_LRAS
:
2146 fields
->f_LRAS
= value
;
2148 case FRV_OPERAND_TLBPRL
:
2149 fields
->f_TLBPRL
= value
;
2151 case FRV_OPERAND_TLBPROPX
:
2152 fields
->f_TLBPRopx
= value
;
2154 case FRV_OPERAND_AE
:
2155 fields
->f_ae
= value
;
2157 case FRV_OPERAND_CALLANN
:
2158 fields
->f_reloc_ann
= value
;
2160 case FRV_OPERAND_CCOND
:
2161 fields
->f_ccond
= value
;
2163 case FRV_OPERAND_COND
:
2164 fields
->f_cond
= value
;
2166 case FRV_OPERAND_D12
:
2167 fields
->f_d12
= value
;
2169 case FRV_OPERAND_DEBUG
:
2170 fields
->f_debug
= value
;
2172 case FRV_OPERAND_EIR
:
2173 fields
->f_eir
= value
;
2175 case FRV_OPERAND_HINT
:
2176 fields
->f_hint
= value
;
2178 case FRV_OPERAND_HINT_NOT_TAKEN
:
2179 fields
->f_hint
= value
;
2181 case FRV_OPERAND_HINT_TAKEN
:
2182 fields
->f_hint
= value
;
2184 case FRV_OPERAND_LABEL16
:
2185 fields
->f_label16
= value
;
2187 case FRV_OPERAND_LABEL24
:
2188 fields
->f_label24
= value
;
2190 case FRV_OPERAND_LDANN
:
2191 fields
->f_reloc_ann
= value
;
2193 case FRV_OPERAND_LDDANN
:
2194 fields
->f_reloc_ann
= value
;
2196 case FRV_OPERAND_LOCK
:
2197 fields
->f_lock
= value
;
2199 case FRV_OPERAND_PACK
:
2200 fields
->f_pack
= value
;
2202 case FRV_OPERAND_S10
:
2203 fields
->f_s10
= value
;
2205 case FRV_OPERAND_S12
:
2206 fields
->f_d12
= value
;
2208 case FRV_OPERAND_S16
:
2209 fields
->f_s16
= value
;
2211 case FRV_OPERAND_S5
:
2212 fields
->f_s5
= value
;
2214 case FRV_OPERAND_S6
:
2215 fields
->f_s6
= value
;
2217 case FRV_OPERAND_S6_1
:
2218 fields
->f_s6_1
= value
;
2220 case FRV_OPERAND_SLO16
:
2221 fields
->f_s16
= value
;
2223 case FRV_OPERAND_SPR
:
2224 fields
->f_spr
= value
;
2226 case FRV_OPERAND_U12
:
2227 fields
->f_u12
= value
;
2229 case FRV_OPERAND_U16
:
2230 fields
->f_u16
= value
;
2232 case FRV_OPERAND_U6
:
2233 fields
->f_u6
= value
;
2235 case FRV_OPERAND_UHI16
:
2236 fields
->f_u16
= value
;
2238 case FRV_OPERAND_ULO16
:
2239 fields
->f_u16
= value
;
2243 /* xgettext:c-format */
2244 opcodes_error_handler
2245 (_("internal error: unrecognized field %d while setting vma operand"),
2251 /* Function to call before using the instruction builder tables. */
2254 frv_cgen_init_ibld_table (CGEN_CPU_DESC cd
)
2256 cd
->insert_handlers
= & frv_cgen_insert_handlers
[0];
2257 cd
->extract_handlers
= & frv_cgen_extract_handlers
[0];
2259 cd
->insert_operand
= frv_cgen_insert_operand
;
2260 cd
->extract_operand
= frv_cgen_extract_operand
;
2262 cd
->get_int_operand
= frv_cgen_get_int_operand
;
2263 cd
->set_int_operand
= frv_cgen_set_int_operand
;
2264 cd
->get_vma_operand
= frv_cgen_get_vma_operand
;
2265 cd
->set_vma_operand
= frv_cgen_set_vma_operand
;