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 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006, 2007,
7 2008, 2010 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
);
213 if (CGEN_INSN_LSB0_P
)
214 shift
= (word_offset
+ start
+ 1) - length
;
216 shift
= total_length
- (word_offset
+ start
+ length
);
217 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
220 #else /* ! CGEN_INT_INSN_P */
223 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
225 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
228 #endif /* ! CGEN_INT_INSN_P */
233 /* Default insn builder (insert handler).
234 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
235 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
236 recorded in host byte order, otherwise BUFFER is an array of bytes
237 and the value is recorded in target byte order).
238 The result is an error message or NULL if success. */
241 insert_insn_normal (CGEN_CPU_DESC cd
,
242 const CGEN_INSN
* insn
,
243 CGEN_FIELDS
* fields
,
244 CGEN_INSN_BYTES_PTR buffer
,
247 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
249 const CGEN_SYNTAX_CHAR_TYPE
* syn
;
251 CGEN_INIT_INSERT (cd
);
252 value
= CGEN_INSN_BASE_VALUE (insn
);
254 /* If we're recording insns as numbers (rather than a string of bytes),
255 target byte order handling is deferred until later. */
259 put_insn_int_value (cd
, buffer
, cd
->base_insn_bitsize
,
260 CGEN_FIELDS_BITSIZE (fields
), value
);
264 cgen_put_insn_value (cd
, buffer
, min ((unsigned) cd
->base_insn_bitsize
,
265 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
268 #endif /* ! CGEN_INT_INSN_P */
270 /* ??? It would be better to scan the format's fields.
271 Still need to be able to insert a value based on the operand though;
272 e.g. storing a branch displacement that got resolved later.
273 Needs more thought first. */
275 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
279 if (CGEN_SYNTAX_CHAR_P (* syn
))
282 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
292 /* Cover function to store an insn value into an integral insn. Must go here
293 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
296 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
297 CGEN_INSN_BYTES_PTR buf
,
302 /* For architectures with insns smaller than the base-insn-bitsize,
303 length may be too big. */
304 if (length
> insn_length
)
308 int shift
= insn_length
- length
;
309 /* Written this way to avoid undefined behaviour. */
310 CGEN_INSN_INT mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
312 *buf
= (*buf
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
317 /* Operand extraction. */
319 #if ! CGEN_INT_INSN_P
321 /* Subroutine of extract_normal.
322 Ensure sufficient bytes are cached in EX_INFO.
323 OFFSET is the offset in bytes from the start of the insn of the value.
324 BYTES is the length of the needed value.
325 Returns 1 for success, 0 for failure. */
327 static CGEN_INLINE
int
328 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
329 CGEN_EXTRACT_INFO
*ex_info
,
334 /* It's doubtful that the middle part has already been fetched so
335 we don't optimize that case. kiss. */
337 disassemble_info
*info
= (disassemble_info
*) ex_info
->dis_info
;
339 /* First do a quick check. */
340 mask
= (1 << bytes
) - 1;
341 if (((ex_info
->valid
>> offset
) & mask
) == mask
)
344 /* Search for the first byte we need to read. */
345 for (mask
= 1 << offset
; bytes
> 0; --bytes
, ++offset
, mask
<<= 1)
346 if (! (mask
& ex_info
->valid
))
354 status
= (*info
->read_memory_func
)
355 (pc
, ex_info
->insn_bytes
+ offset
, bytes
, info
);
359 (*info
->memory_error_func
) (status
, pc
, info
);
363 ex_info
->valid
|= ((1 << bytes
) - 1) << offset
;
369 /* Subroutine of extract_normal. */
371 static CGEN_INLINE
long
372 extract_1 (CGEN_CPU_DESC cd
,
373 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
378 bfd_vma pc ATTRIBUTE_UNUSED
)
383 x
= cgen_get_insn_value (cd
, bufp
, word_length
);
385 if (CGEN_INSN_LSB0_P
)
386 shift
= (start
+ 1) - length
;
388 shift
= (word_length
- (start
+ length
));
392 #endif /* ! CGEN_INT_INSN_P */
394 /* Default extraction routine.
396 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
397 or sometimes less for cases like the m32r where the base insn size is 32
398 but some insns are 16 bits.
399 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
400 but for generality we take a bitmask of all of them.
401 WORD_OFFSET is the offset in bits from the start of the insn of the value.
402 WORD_LENGTH is the length of the word in bits in which the value resides.
403 START is the starting bit number in the word, architecture origin.
404 LENGTH is the length of VALUE in bits.
405 TOTAL_LENGTH is the total length of the insn in bits.
407 Returns 1 for success, 0 for failure. */
409 /* ??? The return code isn't properly used. wip. */
411 /* ??? This doesn't handle bfd_vma's. Create another function when
415 extract_normal (CGEN_CPU_DESC cd
,
416 #if ! CGEN_INT_INSN_P
417 CGEN_EXTRACT_INFO
*ex_info
,
419 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
421 CGEN_INSN_INT insn_value
,
423 unsigned int word_offset
,
426 unsigned int word_length
,
427 unsigned int total_length
,
428 #if ! CGEN_INT_INSN_P
431 bfd_vma pc ATTRIBUTE_UNUSED
,
437 /* If LENGTH is zero, this operand doesn't contribute to the value
438 so give it a standard value of zero. */
445 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
448 /* For architectures with insns smaller than the insn-base-bitsize,
449 word_length may be too big. */
450 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
452 if (word_offset
+ word_length
> total_length
)
453 word_length
= total_length
- word_offset
;
456 /* Does the value reside in INSN_VALUE, and at the right alignment? */
458 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
460 if (CGEN_INSN_LSB0_P
)
461 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
463 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
466 #if ! CGEN_INT_INSN_P
470 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
472 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
475 if (fill_cache (cd
, ex_info
, word_offset
/ 8, word_length
/ 8, pc
) == 0)
478 value
= extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
);
481 #endif /* ! CGEN_INT_INSN_P */
483 /* Written this way to avoid undefined behaviour. */
484 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
488 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
489 && (value
& (1L << (length
- 1))))
497 /* Default insn extractor.
499 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
500 The extracted fields are stored in FIELDS.
501 EX_INFO is used to handle reading variable length insns.
502 Return the length of the insn in bits, or 0 if no match,
503 or -1 if an error occurs fetching data (memory_error_func will have
507 extract_insn_normal (CGEN_CPU_DESC cd
,
508 const CGEN_INSN
*insn
,
509 CGEN_EXTRACT_INFO
*ex_info
,
510 CGEN_INSN_INT insn_value
,
514 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
515 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
517 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
519 CGEN_INIT_EXTRACT (cd
);
521 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
525 if (CGEN_SYNTAX_CHAR_P (*syn
))
528 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
529 ex_info
, insn_value
, fields
, pc
);
534 /* We recognized and successfully extracted this insn. */
535 return CGEN_INSN_BITSIZE (insn
);
538 /* Machine generated code added here. */
540 const char * frv_cgen_insert_operand
541 (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
543 /* Main entry point for operand insertion.
545 This function is basically just a big switch statement. Earlier versions
546 used tables to look up the function to use, but
547 - if the table contains both assembler and disassembler functions then
548 the disassembler contains much of the assembler and vice-versa,
549 - there's a lot of inlining possibilities as things grow,
550 - using a switch statement avoids the function call overhead.
552 This function could be moved into `parse_insn_normal', but keeping it
553 separate makes clear the interface between `parse_insn_normal' and each of
554 the handlers. It's also needed by GAS to insert operands that couldn't be
555 resolved during parsing. */
558 frv_cgen_insert_operand (CGEN_CPU_DESC cd
,
560 CGEN_FIELDS
* fields
,
561 CGEN_INSN_BYTES_PTR buffer
,
562 bfd_vma pc ATTRIBUTE_UNUSED
)
564 const char * errmsg
= NULL
;
565 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
569 case FRV_OPERAND_A0
:
570 errmsg
= insert_normal (cd
, fields
->f_A
, 0, 0, 17, 1, 32, total_length
, buffer
);
572 case FRV_OPERAND_A1
:
573 errmsg
= insert_normal (cd
, fields
->f_A
, 0, 0, 17, 1, 32, total_length
, buffer
);
575 case FRV_OPERAND_ACC40SI
:
576 errmsg
= insert_normal (cd
, fields
->f_ACC40Si
, 0, 0, 17, 6, 32, total_length
, buffer
);
578 case FRV_OPERAND_ACC40SK
:
579 errmsg
= insert_normal (cd
, fields
->f_ACC40Sk
, 0, 0, 30, 6, 32, total_length
, buffer
);
581 case FRV_OPERAND_ACC40UI
:
582 errmsg
= insert_normal (cd
, fields
->f_ACC40Ui
, 0, 0, 17, 6, 32, total_length
, buffer
);
584 case FRV_OPERAND_ACC40UK
:
585 errmsg
= insert_normal (cd
, fields
->f_ACC40Uk
, 0, 0, 30, 6, 32, total_length
, buffer
);
587 case FRV_OPERAND_ACCGI
:
588 errmsg
= insert_normal (cd
, fields
->f_ACCGi
, 0, 0, 17, 6, 32, total_length
, buffer
);
590 case FRV_OPERAND_ACCGK
:
591 errmsg
= insert_normal (cd
, fields
->f_ACCGk
, 0, 0, 30, 6, 32, total_length
, buffer
);
593 case FRV_OPERAND_CCI
:
594 errmsg
= insert_normal (cd
, fields
->f_CCi
, 0, 0, 11, 3, 32, total_length
, buffer
);
596 case FRV_OPERAND_CPRDOUBLEK
:
597 errmsg
= insert_normal (cd
, fields
->f_CPRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
599 case FRV_OPERAND_CPRI
:
600 errmsg
= insert_normal (cd
, fields
->f_CPRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
602 case FRV_OPERAND_CPRJ
:
603 errmsg
= insert_normal (cd
, fields
->f_CPRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
605 case FRV_OPERAND_CPRK
:
606 errmsg
= insert_normal (cd
, fields
->f_CPRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
608 case FRV_OPERAND_CRI
:
609 errmsg
= insert_normal (cd
, fields
->f_CRi
, 0, 0, 14, 3, 32, total_length
, buffer
);
611 case FRV_OPERAND_CRJ
:
612 errmsg
= insert_normal (cd
, fields
->f_CRj
, 0, 0, 2, 3, 32, total_length
, buffer
);
614 case FRV_OPERAND_CRJ_FLOAT
:
615 errmsg
= insert_normal (cd
, fields
->f_CRj_float
, 0, 0, 26, 2, 32, total_length
, buffer
);
617 case FRV_OPERAND_CRJ_INT
:
619 long value
= fields
->f_CRj_int
;
620 value
= ((value
) - (4));
621 errmsg
= insert_normal (cd
, value
, 0, 0, 26, 2, 32, total_length
, buffer
);
624 case FRV_OPERAND_CRK
:
625 errmsg
= insert_normal (cd
, fields
->f_CRk
, 0, 0, 27, 3, 32, total_length
, buffer
);
627 case FRV_OPERAND_FCCI_1
:
628 errmsg
= insert_normal (cd
, fields
->f_FCCi_1
, 0, 0, 11, 2, 32, total_length
, buffer
);
630 case FRV_OPERAND_FCCI_2
:
631 errmsg
= insert_normal (cd
, fields
->f_FCCi_2
, 0, 0, 26, 2, 32, total_length
, buffer
);
633 case FRV_OPERAND_FCCI_3
:
634 errmsg
= insert_normal (cd
, fields
->f_FCCi_3
, 0, 0, 1, 2, 32, total_length
, buffer
);
636 case FRV_OPERAND_FCCK
:
637 errmsg
= insert_normal (cd
, fields
->f_FCCk
, 0, 0, 26, 2, 32, total_length
, buffer
);
639 case FRV_OPERAND_FRDOUBLEI
:
640 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
642 case FRV_OPERAND_FRDOUBLEJ
:
643 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
645 case FRV_OPERAND_FRDOUBLEK
:
646 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
648 case FRV_OPERAND_FRI
:
649 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
651 case FRV_OPERAND_FRINTI
:
652 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
654 case FRV_OPERAND_FRINTIEVEN
:
655 errmsg
= insert_normal (cd
, fields
->f_FRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
657 case FRV_OPERAND_FRINTJ
:
658 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
660 case FRV_OPERAND_FRINTJEVEN
:
661 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
663 case FRV_OPERAND_FRINTK
:
664 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
666 case FRV_OPERAND_FRINTKEVEN
:
667 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
669 case FRV_OPERAND_FRJ
:
670 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
672 case FRV_OPERAND_FRK
:
673 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
675 case FRV_OPERAND_FRKHI
:
676 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
678 case FRV_OPERAND_FRKLO
:
679 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
681 case FRV_OPERAND_GRDOUBLEK
:
682 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
684 case FRV_OPERAND_GRI
:
685 errmsg
= insert_normal (cd
, fields
->f_GRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
687 case FRV_OPERAND_GRJ
:
688 errmsg
= insert_normal (cd
, fields
->f_GRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
690 case FRV_OPERAND_GRK
:
691 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
693 case FRV_OPERAND_GRKHI
:
694 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
696 case FRV_OPERAND_GRKLO
:
697 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
699 case FRV_OPERAND_ICCI_1
:
700 errmsg
= insert_normal (cd
, fields
->f_ICCi_1
, 0, 0, 11, 2, 32, total_length
, buffer
);
702 case FRV_OPERAND_ICCI_2
:
703 errmsg
= insert_normal (cd
, fields
->f_ICCi_2
, 0, 0, 26, 2, 32, total_length
, buffer
);
705 case FRV_OPERAND_ICCI_3
:
706 errmsg
= insert_normal (cd
, fields
->f_ICCi_3
, 0, 0, 1, 2, 32, total_length
, buffer
);
708 case FRV_OPERAND_LI
:
709 errmsg
= insert_normal (cd
, fields
->f_LI
, 0, 0, 25, 1, 32, total_length
, buffer
);
711 case FRV_OPERAND_LRAD
:
712 errmsg
= insert_normal (cd
, fields
->f_LRAD
, 0, 0, 4, 1, 32, total_length
, buffer
);
714 case FRV_OPERAND_LRAE
:
715 errmsg
= insert_normal (cd
, fields
->f_LRAE
, 0, 0, 5, 1, 32, total_length
, buffer
);
717 case FRV_OPERAND_LRAS
:
718 errmsg
= insert_normal (cd
, fields
->f_LRAS
, 0, 0, 3, 1, 32, total_length
, buffer
);
720 case FRV_OPERAND_TLBPRL
:
721 errmsg
= insert_normal (cd
, fields
->f_TLBPRL
, 0, 0, 25, 1, 32, total_length
, buffer
);
723 case FRV_OPERAND_TLBPROPX
:
724 errmsg
= insert_normal (cd
, fields
->f_TLBPRopx
, 0, 0, 28, 3, 32, total_length
, buffer
);
726 case FRV_OPERAND_AE
:
727 errmsg
= insert_normal (cd
, fields
->f_ae
, 0, 0, 25, 1, 32, total_length
, buffer
);
729 case FRV_OPERAND_CALLANN
:
730 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
732 case FRV_OPERAND_CCOND
:
733 errmsg
= insert_normal (cd
, fields
->f_ccond
, 0, 0, 12, 1, 32, total_length
, buffer
);
735 case FRV_OPERAND_COND
:
736 errmsg
= insert_normal (cd
, fields
->f_cond
, 0, 0, 8, 1, 32, total_length
, buffer
);
738 case FRV_OPERAND_D12
:
739 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
741 case FRV_OPERAND_DEBUG
:
742 errmsg
= insert_normal (cd
, fields
->f_debug
, 0, 0, 25, 1, 32, total_length
, buffer
);
744 case FRV_OPERAND_EIR
:
745 errmsg
= insert_normal (cd
, fields
->f_eir
, 0, 0, 17, 6, 32, total_length
, buffer
);
747 case FRV_OPERAND_HINT
:
748 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
750 case FRV_OPERAND_HINT_NOT_TAKEN
:
751 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
753 case FRV_OPERAND_HINT_TAKEN
:
754 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
756 case FRV_OPERAND_LABEL16
:
758 long value
= fields
->f_label16
;
759 value
= ((SI
) (((value
) - (pc
))) >> (2));
760 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 15, 16, 32, total_length
, buffer
);
763 case FRV_OPERAND_LABEL24
:
766 FLD (f_labelH6
) = ((SI
) (((FLD (f_label24
)) - (pc
))) >> (20));
767 FLD (f_labelL18
) = ((((UINT
) (((FLD (f_label24
)) - (pc
))) >> (2))) & (262143));
769 errmsg
= insert_normal (cd
, fields
->f_labelH6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, buffer
);
772 errmsg
= insert_normal (cd
, fields
->f_labelL18
, 0, 0, 17, 18, 32, total_length
, buffer
);
777 case FRV_OPERAND_LDANN
:
778 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
780 case FRV_OPERAND_LDDANN
:
781 errmsg
= insert_normal (cd
, fields
->f_reloc_ann
, 0, 0, 0, 0, 32, total_length
, buffer
);
783 case FRV_OPERAND_LOCK
:
784 errmsg
= insert_normal (cd
, fields
->f_lock
, 0, 0, 25, 1, 32, total_length
, buffer
);
786 case FRV_OPERAND_PACK
:
787 errmsg
= insert_normal (cd
, fields
->f_pack
, 0, 0, 31, 1, 32, total_length
, buffer
);
789 case FRV_OPERAND_S10
:
790 errmsg
= insert_normal (cd
, fields
->f_s10
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, buffer
);
792 case FRV_OPERAND_S12
:
793 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
795 case FRV_OPERAND_S16
:
796 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
798 case FRV_OPERAND_S5
:
799 errmsg
= insert_normal (cd
, fields
->f_s5
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, buffer
);
801 case FRV_OPERAND_S6
:
802 errmsg
= insert_normal (cd
, fields
->f_s6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, buffer
);
804 case FRV_OPERAND_S6_1
:
805 errmsg
= insert_normal (cd
, fields
->f_s6_1
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, buffer
);
807 case FRV_OPERAND_SLO16
:
808 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
810 case FRV_OPERAND_SPR
:
813 FLD (f_spr_h
) = ((UINT
) (FLD (f_spr
)) >> (6));
814 FLD (f_spr_l
) = ((FLD (f_spr
)) & (63));
816 errmsg
= insert_normal (cd
, fields
->f_spr_h
, 0, 0, 30, 6, 32, total_length
, buffer
);
819 errmsg
= insert_normal (cd
, fields
->f_spr_l
, 0, 0, 17, 6, 32, total_length
, buffer
);
824 case FRV_OPERAND_U12
:
827 FLD (f_u12_h
) = ((SI
) (FLD (f_u12
)) >> (6));
828 FLD (f_u12_l
) = ((FLD (f_u12
)) & (63));
830 errmsg
= insert_normal (cd
, fields
->f_u12_h
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, buffer
);
833 errmsg
= insert_normal (cd
, fields
->f_u12_l
, 0, 0, 5, 6, 32, total_length
, buffer
);
838 case FRV_OPERAND_U16
:
839 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
841 case FRV_OPERAND_U6
:
842 errmsg
= insert_normal (cd
, fields
->f_u6
, 0, 0, 5, 6, 32, total_length
, buffer
);
844 case FRV_OPERAND_UHI16
:
845 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
847 case FRV_OPERAND_ULO16
:
848 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
852 /* xgettext:c-format */
853 fprintf (stderr
, _("Unrecognized field %d while building insn.\n"),
861 int frv_cgen_extract_operand
862 (CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
864 /* Main entry point for operand extraction.
865 The result is <= 0 for error, >0 for success.
866 ??? Actual values aren't well defined right now.
868 This function is basically just a big switch statement. Earlier versions
869 used tables to look up the function to use, but
870 - if the table contains both assembler and disassembler functions then
871 the disassembler contains much of the assembler and vice-versa,
872 - there's a lot of inlining possibilities as things grow,
873 - using a switch statement avoids the function call overhead.
875 This function could be moved into `print_insn_normal', but keeping it
876 separate makes clear the interface between `print_insn_normal' and each of
880 frv_cgen_extract_operand (CGEN_CPU_DESC cd
,
882 CGEN_EXTRACT_INFO
*ex_info
,
883 CGEN_INSN_INT insn_value
,
884 CGEN_FIELDS
* fields
,
887 /* Assume success (for those operands that are nops). */
889 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
893 case FRV_OPERAND_A0
:
894 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 1, 32, total_length
, pc
, & fields
->f_A
);
896 case FRV_OPERAND_A1
:
897 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 1, 32, total_length
, pc
, & fields
->f_A
);
899 case FRV_OPERAND_ACC40SI
:
900 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Si
);
902 case FRV_OPERAND_ACC40SK
:
903 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Sk
);
905 case FRV_OPERAND_ACC40UI
:
906 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Ui
);
908 case FRV_OPERAND_ACC40UK
:
909 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Uk
);
911 case FRV_OPERAND_ACCGI
:
912 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACCGi
);
914 case FRV_OPERAND_ACCGK
:
915 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACCGk
);
917 case FRV_OPERAND_CCI
:
918 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 3, 32, total_length
, pc
, & fields
->f_CCi
);
920 case FRV_OPERAND_CPRDOUBLEK
:
921 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
923 case FRV_OPERAND_CPRI
:
924 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_CPRi
);
926 case FRV_OPERAND_CPRJ
:
927 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_CPRj
);
929 case FRV_OPERAND_CPRK
:
930 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
932 case FRV_OPERAND_CRI
:
933 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 14, 3, 32, total_length
, pc
, & fields
->f_CRi
);
935 case FRV_OPERAND_CRJ
:
936 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 2, 3, 32, total_length
, pc
, & fields
->f_CRj
);
938 case FRV_OPERAND_CRJ_FLOAT
:
939 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_CRj_float
);
941 case FRV_OPERAND_CRJ_INT
:
944 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & value
);
945 value
= ((value
) + (4));
946 fields
->f_CRj_int
= value
;
949 case FRV_OPERAND_CRK
:
950 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 27, 3, 32, total_length
, pc
, & fields
->f_CRk
);
952 case FRV_OPERAND_FCCI_1
:
953 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_FCCi_1
);
955 case FRV_OPERAND_FCCI_2
:
956 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCi_2
);
958 case FRV_OPERAND_FCCI_3
:
959 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_FCCi_3
);
961 case FRV_OPERAND_FCCK
:
962 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCk
);
964 case FRV_OPERAND_FRDOUBLEI
:
965 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
967 case FRV_OPERAND_FRDOUBLEJ
:
968 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
970 case FRV_OPERAND_FRDOUBLEK
:
971 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
973 case FRV_OPERAND_FRI
:
974 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
976 case FRV_OPERAND_FRINTI
:
977 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
979 case FRV_OPERAND_FRINTIEVEN
:
980 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
982 case FRV_OPERAND_FRINTJ
:
983 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
985 case FRV_OPERAND_FRINTJEVEN
:
986 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
988 case FRV_OPERAND_FRINTK
:
989 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
991 case FRV_OPERAND_FRINTKEVEN
:
992 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
994 case FRV_OPERAND_FRJ
:
995 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
997 case FRV_OPERAND_FRK
:
998 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1000 case FRV_OPERAND_FRKHI
:
1001 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1003 case FRV_OPERAND_FRKLO
:
1004 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
1006 case FRV_OPERAND_GRDOUBLEK
:
1007 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1009 case FRV_OPERAND_GRI
:
1010 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_GRi
);
1012 case FRV_OPERAND_GRJ
:
1013 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_GRj
);
1015 case FRV_OPERAND_GRK
:
1016 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1018 case FRV_OPERAND_GRKHI
:
1019 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1021 case FRV_OPERAND_GRKLO
:
1022 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
1024 case FRV_OPERAND_ICCI_1
:
1025 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_ICCi_1
);
1027 case FRV_OPERAND_ICCI_2
:
1028 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_ICCi_2
);
1030 case FRV_OPERAND_ICCI_3
:
1031 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_ICCi_3
);
1033 case FRV_OPERAND_LI
:
1034 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_LI
);
1036 case FRV_OPERAND_LRAD
:
1037 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 1, 32, total_length
, pc
, & fields
->f_LRAD
);
1039 case FRV_OPERAND_LRAE
:
1040 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 1, 32, total_length
, pc
, & fields
->f_LRAE
);
1042 case FRV_OPERAND_LRAS
:
1043 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 3, 1, 32, total_length
, pc
, & fields
->f_LRAS
);
1045 case FRV_OPERAND_TLBPRL
:
1046 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_TLBPRL
);
1048 case FRV_OPERAND_TLBPROPX
:
1049 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 28, 3, 32, total_length
, pc
, & fields
->f_TLBPRopx
);
1051 case FRV_OPERAND_AE
:
1052 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_ae
);
1054 case FRV_OPERAND_CALLANN
:
1055 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 0, 0, 32, total_length
, pc
, & fields
->f_reloc_ann
);
1057 case FRV_OPERAND_CCOND
:
1058 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 1, 32, total_length
, pc
, & fields
->f_ccond
);
1060 case FRV_OPERAND_COND
:
1061 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 1, 32, total_length
, pc
, & fields
->f_cond
);
1063 case FRV_OPERAND_D12
:
1064 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1066 case FRV_OPERAND_DEBUG
:
1067 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_debug
);
1069 case FRV_OPERAND_EIR
:
1070 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_eir
);
1072 case FRV_OPERAND_HINT
:
1073 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1075 case FRV_OPERAND_HINT_NOT_TAKEN
:
1076 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1078 case FRV_OPERAND_HINT_TAKEN
:
1079 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1081 case FRV_OPERAND_LABEL16
:
1084 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
);
1085 value
= ((((value
) << (2))) + (pc
));
1086 fields
->f_label16
= value
;
1089 case FRV_OPERAND_LABEL24
:
1091 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, pc
, & fields
->f_labelH6
);
1092 if (length
<= 0) break;
1093 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 18, 32, total_length
, pc
, & fields
->f_labelL18
);
1094 if (length
<= 0) break;
1096 FLD (f_label24
) = ((((((((FLD (f_labelH6
)) << (18))) | (FLD (f_labelL18
)))) << (2))) + (pc
));
1100 case FRV_OPERAND_LDANN
:
1101 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 0, 0, 32, total_length
, pc
, & fields
->f_reloc_ann
);
1103 case FRV_OPERAND_LDDANN
:
1104 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 0, 0, 32, total_length
, pc
, & fields
->f_reloc_ann
);
1106 case FRV_OPERAND_LOCK
:
1107 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_lock
);
1109 case FRV_OPERAND_PACK
:
1110 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 31, 1, 32, total_length
, pc
, & fields
->f_pack
);
1112 case FRV_OPERAND_S10
:
1113 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, pc
, & fields
->f_s10
);
1115 case FRV_OPERAND_S12
:
1116 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1118 case FRV_OPERAND_S16
:
1119 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1121 case FRV_OPERAND_S5
:
1122 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, pc
, & fields
->f_s5
);
1124 case FRV_OPERAND_S6
:
1125 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, pc
, & fields
->f_s6
);
1127 case FRV_OPERAND_S6_1
:
1128 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, pc
, & fields
->f_s6_1
);
1130 case FRV_OPERAND_SLO16
:
1131 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1133 case FRV_OPERAND_SPR
:
1135 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_spr_h
);
1136 if (length
<= 0) break;
1137 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_spr_l
);
1138 if (length
<= 0) break;
1140 FLD (f_spr
) = ((((FLD (f_spr_h
)) << (6))) | (FLD (f_spr_l
)));
1144 case FRV_OPERAND_U12
:
1146 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, pc
, & fields
->f_u12_h
);
1147 if (length
<= 0) break;
1148 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u12_l
);
1149 if (length
<= 0) break;
1151 FLD (f_u12
) = ((((FLD (f_u12_h
)) << (6))) | (FLD (f_u12_l
)));
1155 case FRV_OPERAND_U16
:
1156 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1158 case FRV_OPERAND_U6
:
1159 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u6
);
1161 case FRV_OPERAND_UHI16
:
1162 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1164 case FRV_OPERAND_ULO16
:
1165 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1169 /* xgettext:c-format */
1170 fprintf (stderr
, _("Unrecognized field %d while decoding insn.\n"),
1178 cgen_insert_fn
* const frv_cgen_insert_handlers
[] =
1183 cgen_extract_fn
* const frv_cgen_extract_handlers
[] =
1185 extract_insn_normal
,
1188 int frv_cgen_get_int_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
1189 bfd_vma
frv_cgen_get_vma_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
1191 /* Getting values from cgen_fields is handled by a collection of functions.
1192 They are distinguished by the type of the VALUE argument they return.
1193 TODO: floating point, inlining support, remove cases where result type
1197 frv_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1199 const CGEN_FIELDS
* fields
)
1205 case FRV_OPERAND_A0
:
1206 value
= fields
->f_A
;
1208 case FRV_OPERAND_A1
:
1209 value
= fields
->f_A
;
1211 case FRV_OPERAND_ACC40SI
:
1212 value
= fields
->f_ACC40Si
;
1214 case FRV_OPERAND_ACC40SK
:
1215 value
= fields
->f_ACC40Sk
;
1217 case FRV_OPERAND_ACC40UI
:
1218 value
= fields
->f_ACC40Ui
;
1220 case FRV_OPERAND_ACC40UK
:
1221 value
= fields
->f_ACC40Uk
;
1223 case FRV_OPERAND_ACCGI
:
1224 value
= fields
->f_ACCGi
;
1226 case FRV_OPERAND_ACCGK
:
1227 value
= fields
->f_ACCGk
;
1229 case FRV_OPERAND_CCI
:
1230 value
= fields
->f_CCi
;
1232 case FRV_OPERAND_CPRDOUBLEK
:
1233 value
= fields
->f_CPRk
;
1235 case FRV_OPERAND_CPRI
:
1236 value
= fields
->f_CPRi
;
1238 case FRV_OPERAND_CPRJ
:
1239 value
= fields
->f_CPRj
;
1241 case FRV_OPERAND_CPRK
:
1242 value
= fields
->f_CPRk
;
1244 case FRV_OPERAND_CRI
:
1245 value
= fields
->f_CRi
;
1247 case FRV_OPERAND_CRJ
:
1248 value
= fields
->f_CRj
;
1250 case FRV_OPERAND_CRJ_FLOAT
:
1251 value
= fields
->f_CRj_float
;
1253 case FRV_OPERAND_CRJ_INT
:
1254 value
= fields
->f_CRj_int
;
1256 case FRV_OPERAND_CRK
:
1257 value
= fields
->f_CRk
;
1259 case FRV_OPERAND_FCCI_1
:
1260 value
= fields
->f_FCCi_1
;
1262 case FRV_OPERAND_FCCI_2
:
1263 value
= fields
->f_FCCi_2
;
1265 case FRV_OPERAND_FCCI_3
:
1266 value
= fields
->f_FCCi_3
;
1268 case FRV_OPERAND_FCCK
:
1269 value
= fields
->f_FCCk
;
1271 case FRV_OPERAND_FRDOUBLEI
:
1272 value
= fields
->f_FRi
;
1274 case FRV_OPERAND_FRDOUBLEJ
:
1275 value
= fields
->f_FRj
;
1277 case FRV_OPERAND_FRDOUBLEK
:
1278 value
= fields
->f_FRk
;
1280 case FRV_OPERAND_FRI
:
1281 value
= fields
->f_FRi
;
1283 case FRV_OPERAND_FRINTI
:
1284 value
= fields
->f_FRi
;
1286 case FRV_OPERAND_FRINTIEVEN
:
1287 value
= fields
->f_FRi
;
1289 case FRV_OPERAND_FRINTJ
:
1290 value
= fields
->f_FRj
;
1292 case FRV_OPERAND_FRINTJEVEN
:
1293 value
= fields
->f_FRj
;
1295 case FRV_OPERAND_FRINTK
:
1296 value
= fields
->f_FRk
;
1298 case FRV_OPERAND_FRINTKEVEN
:
1299 value
= fields
->f_FRk
;
1301 case FRV_OPERAND_FRJ
:
1302 value
= fields
->f_FRj
;
1304 case FRV_OPERAND_FRK
:
1305 value
= fields
->f_FRk
;
1307 case FRV_OPERAND_FRKHI
:
1308 value
= fields
->f_FRk
;
1310 case FRV_OPERAND_FRKLO
:
1311 value
= fields
->f_FRk
;
1313 case FRV_OPERAND_GRDOUBLEK
:
1314 value
= fields
->f_GRk
;
1316 case FRV_OPERAND_GRI
:
1317 value
= fields
->f_GRi
;
1319 case FRV_OPERAND_GRJ
:
1320 value
= fields
->f_GRj
;
1322 case FRV_OPERAND_GRK
:
1323 value
= fields
->f_GRk
;
1325 case FRV_OPERAND_GRKHI
:
1326 value
= fields
->f_GRk
;
1328 case FRV_OPERAND_GRKLO
:
1329 value
= fields
->f_GRk
;
1331 case FRV_OPERAND_ICCI_1
:
1332 value
= fields
->f_ICCi_1
;
1334 case FRV_OPERAND_ICCI_2
:
1335 value
= fields
->f_ICCi_2
;
1337 case FRV_OPERAND_ICCI_3
:
1338 value
= fields
->f_ICCi_3
;
1340 case FRV_OPERAND_LI
:
1341 value
= fields
->f_LI
;
1343 case FRV_OPERAND_LRAD
:
1344 value
= fields
->f_LRAD
;
1346 case FRV_OPERAND_LRAE
:
1347 value
= fields
->f_LRAE
;
1349 case FRV_OPERAND_LRAS
:
1350 value
= fields
->f_LRAS
;
1352 case FRV_OPERAND_TLBPRL
:
1353 value
= fields
->f_TLBPRL
;
1355 case FRV_OPERAND_TLBPROPX
:
1356 value
= fields
->f_TLBPRopx
;
1358 case FRV_OPERAND_AE
:
1359 value
= fields
->f_ae
;
1361 case FRV_OPERAND_CALLANN
:
1362 value
= fields
->f_reloc_ann
;
1364 case FRV_OPERAND_CCOND
:
1365 value
= fields
->f_ccond
;
1367 case FRV_OPERAND_COND
:
1368 value
= fields
->f_cond
;
1370 case FRV_OPERAND_D12
:
1371 value
= fields
->f_d12
;
1373 case FRV_OPERAND_DEBUG
:
1374 value
= fields
->f_debug
;
1376 case FRV_OPERAND_EIR
:
1377 value
= fields
->f_eir
;
1379 case FRV_OPERAND_HINT
:
1380 value
= fields
->f_hint
;
1382 case FRV_OPERAND_HINT_NOT_TAKEN
:
1383 value
= fields
->f_hint
;
1385 case FRV_OPERAND_HINT_TAKEN
:
1386 value
= fields
->f_hint
;
1388 case FRV_OPERAND_LABEL16
:
1389 value
= fields
->f_label16
;
1391 case FRV_OPERAND_LABEL24
:
1392 value
= fields
->f_label24
;
1394 case FRV_OPERAND_LDANN
:
1395 value
= fields
->f_reloc_ann
;
1397 case FRV_OPERAND_LDDANN
:
1398 value
= fields
->f_reloc_ann
;
1400 case FRV_OPERAND_LOCK
:
1401 value
= fields
->f_lock
;
1403 case FRV_OPERAND_PACK
:
1404 value
= fields
->f_pack
;
1406 case FRV_OPERAND_S10
:
1407 value
= fields
->f_s10
;
1409 case FRV_OPERAND_S12
:
1410 value
= fields
->f_d12
;
1412 case FRV_OPERAND_S16
:
1413 value
= fields
->f_s16
;
1415 case FRV_OPERAND_S5
:
1416 value
= fields
->f_s5
;
1418 case FRV_OPERAND_S6
:
1419 value
= fields
->f_s6
;
1421 case FRV_OPERAND_S6_1
:
1422 value
= fields
->f_s6_1
;
1424 case FRV_OPERAND_SLO16
:
1425 value
= fields
->f_s16
;
1427 case FRV_OPERAND_SPR
:
1428 value
= fields
->f_spr
;
1430 case FRV_OPERAND_U12
:
1431 value
= fields
->f_u12
;
1433 case FRV_OPERAND_U16
:
1434 value
= fields
->f_u16
;
1436 case FRV_OPERAND_U6
:
1437 value
= fields
->f_u6
;
1439 case FRV_OPERAND_UHI16
:
1440 value
= fields
->f_u16
;
1442 case FRV_OPERAND_ULO16
:
1443 value
= fields
->f_u16
;
1447 /* xgettext:c-format */
1448 fprintf (stderr
, _("Unrecognized field %d while getting int operand.\n"),
1457 frv_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1459 const CGEN_FIELDS
* fields
)
1465 case FRV_OPERAND_A0
:
1466 value
= fields
->f_A
;
1468 case FRV_OPERAND_A1
:
1469 value
= fields
->f_A
;
1471 case FRV_OPERAND_ACC40SI
:
1472 value
= fields
->f_ACC40Si
;
1474 case FRV_OPERAND_ACC40SK
:
1475 value
= fields
->f_ACC40Sk
;
1477 case FRV_OPERAND_ACC40UI
:
1478 value
= fields
->f_ACC40Ui
;
1480 case FRV_OPERAND_ACC40UK
:
1481 value
= fields
->f_ACC40Uk
;
1483 case FRV_OPERAND_ACCGI
:
1484 value
= fields
->f_ACCGi
;
1486 case FRV_OPERAND_ACCGK
:
1487 value
= fields
->f_ACCGk
;
1489 case FRV_OPERAND_CCI
:
1490 value
= fields
->f_CCi
;
1492 case FRV_OPERAND_CPRDOUBLEK
:
1493 value
= fields
->f_CPRk
;
1495 case FRV_OPERAND_CPRI
:
1496 value
= fields
->f_CPRi
;
1498 case FRV_OPERAND_CPRJ
:
1499 value
= fields
->f_CPRj
;
1501 case FRV_OPERAND_CPRK
:
1502 value
= fields
->f_CPRk
;
1504 case FRV_OPERAND_CRI
:
1505 value
= fields
->f_CRi
;
1507 case FRV_OPERAND_CRJ
:
1508 value
= fields
->f_CRj
;
1510 case FRV_OPERAND_CRJ_FLOAT
:
1511 value
= fields
->f_CRj_float
;
1513 case FRV_OPERAND_CRJ_INT
:
1514 value
= fields
->f_CRj_int
;
1516 case FRV_OPERAND_CRK
:
1517 value
= fields
->f_CRk
;
1519 case FRV_OPERAND_FCCI_1
:
1520 value
= fields
->f_FCCi_1
;
1522 case FRV_OPERAND_FCCI_2
:
1523 value
= fields
->f_FCCi_2
;
1525 case FRV_OPERAND_FCCI_3
:
1526 value
= fields
->f_FCCi_3
;
1528 case FRV_OPERAND_FCCK
:
1529 value
= fields
->f_FCCk
;
1531 case FRV_OPERAND_FRDOUBLEI
:
1532 value
= fields
->f_FRi
;
1534 case FRV_OPERAND_FRDOUBLEJ
:
1535 value
= fields
->f_FRj
;
1537 case FRV_OPERAND_FRDOUBLEK
:
1538 value
= fields
->f_FRk
;
1540 case FRV_OPERAND_FRI
:
1541 value
= fields
->f_FRi
;
1543 case FRV_OPERAND_FRINTI
:
1544 value
= fields
->f_FRi
;
1546 case FRV_OPERAND_FRINTIEVEN
:
1547 value
= fields
->f_FRi
;
1549 case FRV_OPERAND_FRINTJ
:
1550 value
= fields
->f_FRj
;
1552 case FRV_OPERAND_FRINTJEVEN
:
1553 value
= fields
->f_FRj
;
1555 case FRV_OPERAND_FRINTK
:
1556 value
= fields
->f_FRk
;
1558 case FRV_OPERAND_FRINTKEVEN
:
1559 value
= fields
->f_FRk
;
1561 case FRV_OPERAND_FRJ
:
1562 value
= fields
->f_FRj
;
1564 case FRV_OPERAND_FRK
:
1565 value
= fields
->f_FRk
;
1567 case FRV_OPERAND_FRKHI
:
1568 value
= fields
->f_FRk
;
1570 case FRV_OPERAND_FRKLO
:
1571 value
= fields
->f_FRk
;
1573 case FRV_OPERAND_GRDOUBLEK
:
1574 value
= fields
->f_GRk
;
1576 case FRV_OPERAND_GRI
:
1577 value
= fields
->f_GRi
;
1579 case FRV_OPERAND_GRJ
:
1580 value
= fields
->f_GRj
;
1582 case FRV_OPERAND_GRK
:
1583 value
= fields
->f_GRk
;
1585 case FRV_OPERAND_GRKHI
:
1586 value
= fields
->f_GRk
;
1588 case FRV_OPERAND_GRKLO
:
1589 value
= fields
->f_GRk
;
1591 case FRV_OPERAND_ICCI_1
:
1592 value
= fields
->f_ICCi_1
;
1594 case FRV_OPERAND_ICCI_2
:
1595 value
= fields
->f_ICCi_2
;
1597 case FRV_OPERAND_ICCI_3
:
1598 value
= fields
->f_ICCi_3
;
1600 case FRV_OPERAND_LI
:
1601 value
= fields
->f_LI
;
1603 case FRV_OPERAND_LRAD
:
1604 value
= fields
->f_LRAD
;
1606 case FRV_OPERAND_LRAE
:
1607 value
= fields
->f_LRAE
;
1609 case FRV_OPERAND_LRAS
:
1610 value
= fields
->f_LRAS
;
1612 case FRV_OPERAND_TLBPRL
:
1613 value
= fields
->f_TLBPRL
;
1615 case FRV_OPERAND_TLBPROPX
:
1616 value
= fields
->f_TLBPRopx
;
1618 case FRV_OPERAND_AE
:
1619 value
= fields
->f_ae
;
1621 case FRV_OPERAND_CALLANN
:
1622 value
= fields
->f_reloc_ann
;
1624 case FRV_OPERAND_CCOND
:
1625 value
= fields
->f_ccond
;
1627 case FRV_OPERAND_COND
:
1628 value
= fields
->f_cond
;
1630 case FRV_OPERAND_D12
:
1631 value
= fields
->f_d12
;
1633 case FRV_OPERAND_DEBUG
:
1634 value
= fields
->f_debug
;
1636 case FRV_OPERAND_EIR
:
1637 value
= fields
->f_eir
;
1639 case FRV_OPERAND_HINT
:
1640 value
= fields
->f_hint
;
1642 case FRV_OPERAND_HINT_NOT_TAKEN
:
1643 value
= fields
->f_hint
;
1645 case FRV_OPERAND_HINT_TAKEN
:
1646 value
= fields
->f_hint
;
1648 case FRV_OPERAND_LABEL16
:
1649 value
= fields
->f_label16
;
1651 case FRV_OPERAND_LABEL24
:
1652 value
= fields
->f_label24
;
1654 case FRV_OPERAND_LDANN
:
1655 value
= fields
->f_reloc_ann
;
1657 case FRV_OPERAND_LDDANN
:
1658 value
= fields
->f_reloc_ann
;
1660 case FRV_OPERAND_LOCK
:
1661 value
= fields
->f_lock
;
1663 case FRV_OPERAND_PACK
:
1664 value
= fields
->f_pack
;
1666 case FRV_OPERAND_S10
:
1667 value
= fields
->f_s10
;
1669 case FRV_OPERAND_S12
:
1670 value
= fields
->f_d12
;
1672 case FRV_OPERAND_S16
:
1673 value
= fields
->f_s16
;
1675 case FRV_OPERAND_S5
:
1676 value
= fields
->f_s5
;
1678 case FRV_OPERAND_S6
:
1679 value
= fields
->f_s6
;
1681 case FRV_OPERAND_S6_1
:
1682 value
= fields
->f_s6_1
;
1684 case FRV_OPERAND_SLO16
:
1685 value
= fields
->f_s16
;
1687 case FRV_OPERAND_SPR
:
1688 value
= fields
->f_spr
;
1690 case FRV_OPERAND_U12
:
1691 value
= fields
->f_u12
;
1693 case FRV_OPERAND_U16
:
1694 value
= fields
->f_u16
;
1696 case FRV_OPERAND_U6
:
1697 value
= fields
->f_u6
;
1699 case FRV_OPERAND_UHI16
:
1700 value
= fields
->f_u16
;
1702 case FRV_OPERAND_ULO16
:
1703 value
= fields
->f_u16
;
1707 /* xgettext:c-format */
1708 fprintf (stderr
, _("Unrecognized field %d while getting vma operand.\n"),
1716 void frv_cgen_set_int_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int);
1717 void frv_cgen_set_vma_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
);
1719 /* Stuffing values in cgen_fields is handled by a collection of functions.
1720 They are distinguished by the type of the VALUE argument they accept.
1721 TODO: floating point, inlining support, remove cases where argument type
1725 frv_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1727 CGEN_FIELDS
* fields
,
1732 case FRV_OPERAND_A0
:
1733 fields
->f_A
= value
;
1735 case FRV_OPERAND_A1
:
1736 fields
->f_A
= value
;
1738 case FRV_OPERAND_ACC40SI
:
1739 fields
->f_ACC40Si
= value
;
1741 case FRV_OPERAND_ACC40SK
:
1742 fields
->f_ACC40Sk
= value
;
1744 case FRV_OPERAND_ACC40UI
:
1745 fields
->f_ACC40Ui
= value
;
1747 case FRV_OPERAND_ACC40UK
:
1748 fields
->f_ACC40Uk
= value
;
1750 case FRV_OPERAND_ACCGI
:
1751 fields
->f_ACCGi
= value
;
1753 case FRV_OPERAND_ACCGK
:
1754 fields
->f_ACCGk
= value
;
1756 case FRV_OPERAND_CCI
:
1757 fields
->f_CCi
= value
;
1759 case FRV_OPERAND_CPRDOUBLEK
:
1760 fields
->f_CPRk
= value
;
1762 case FRV_OPERAND_CPRI
:
1763 fields
->f_CPRi
= value
;
1765 case FRV_OPERAND_CPRJ
:
1766 fields
->f_CPRj
= value
;
1768 case FRV_OPERAND_CPRK
:
1769 fields
->f_CPRk
= value
;
1771 case FRV_OPERAND_CRI
:
1772 fields
->f_CRi
= value
;
1774 case FRV_OPERAND_CRJ
:
1775 fields
->f_CRj
= value
;
1777 case FRV_OPERAND_CRJ_FLOAT
:
1778 fields
->f_CRj_float
= value
;
1780 case FRV_OPERAND_CRJ_INT
:
1781 fields
->f_CRj_int
= value
;
1783 case FRV_OPERAND_CRK
:
1784 fields
->f_CRk
= value
;
1786 case FRV_OPERAND_FCCI_1
:
1787 fields
->f_FCCi_1
= value
;
1789 case FRV_OPERAND_FCCI_2
:
1790 fields
->f_FCCi_2
= value
;
1792 case FRV_OPERAND_FCCI_3
:
1793 fields
->f_FCCi_3
= value
;
1795 case FRV_OPERAND_FCCK
:
1796 fields
->f_FCCk
= value
;
1798 case FRV_OPERAND_FRDOUBLEI
:
1799 fields
->f_FRi
= value
;
1801 case FRV_OPERAND_FRDOUBLEJ
:
1802 fields
->f_FRj
= value
;
1804 case FRV_OPERAND_FRDOUBLEK
:
1805 fields
->f_FRk
= value
;
1807 case FRV_OPERAND_FRI
:
1808 fields
->f_FRi
= value
;
1810 case FRV_OPERAND_FRINTI
:
1811 fields
->f_FRi
= value
;
1813 case FRV_OPERAND_FRINTIEVEN
:
1814 fields
->f_FRi
= value
;
1816 case FRV_OPERAND_FRINTJ
:
1817 fields
->f_FRj
= value
;
1819 case FRV_OPERAND_FRINTJEVEN
:
1820 fields
->f_FRj
= value
;
1822 case FRV_OPERAND_FRINTK
:
1823 fields
->f_FRk
= value
;
1825 case FRV_OPERAND_FRINTKEVEN
:
1826 fields
->f_FRk
= value
;
1828 case FRV_OPERAND_FRJ
:
1829 fields
->f_FRj
= value
;
1831 case FRV_OPERAND_FRK
:
1832 fields
->f_FRk
= value
;
1834 case FRV_OPERAND_FRKHI
:
1835 fields
->f_FRk
= value
;
1837 case FRV_OPERAND_FRKLO
:
1838 fields
->f_FRk
= value
;
1840 case FRV_OPERAND_GRDOUBLEK
:
1841 fields
->f_GRk
= value
;
1843 case FRV_OPERAND_GRI
:
1844 fields
->f_GRi
= value
;
1846 case FRV_OPERAND_GRJ
:
1847 fields
->f_GRj
= value
;
1849 case FRV_OPERAND_GRK
:
1850 fields
->f_GRk
= value
;
1852 case FRV_OPERAND_GRKHI
:
1853 fields
->f_GRk
= value
;
1855 case FRV_OPERAND_GRKLO
:
1856 fields
->f_GRk
= value
;
1858 case FRV_OPERAND_ICCI_1
:
1859 fields
->f_ICCi_1
= value
;
1861 case FRV_OPERAND_ICCI_2
:
1862 fields
->f_ICCi_2
= value
;
1864 case FRV_OPERAND_ICCI_3
:
1865 fields
->f_ICCi_3
= value
;
1867 case FRV_OPERAND_LI
:
1868 fields
->f_LI
= value
;
1870 case FRV_OPERAND_LRAD
:
1871 fields
->f_LRAD
= value
;
1873 case FRV_OPERAND_LRAE
:
1874 fields
->f_LRAE
= value
;
1876 case FRV_OPERAND_LRAS
:
1877 fields
->f_LRAS
= value
;
1879 case FRV_OPERAND_TLBPRL
:
1880 fields
->f_TLBPRL
= value
;
1882 case FRV_OPERAND_TLBPROPX
:
1883 fields
->f_TLBPRopx
= value
;
1885 case FRV_OPERAND_AE
:
1886 fields
->f_ae
= value
;
1888 case FRV_OPERAND_CALLANN
:
1889 fields
->f_reloc_ann
= value
;
1891 case FRV_OPERAND_CCOND
:
1892 fields
->f_ccond
= value
;
1894 case FRV_OPERAND_COND
:
1895 fields
->f_cond
= value
;
1897 case FRV_OPERAND_D12
:
1898 fields
->f_d12
= value
;
1900 case FRV_OPERAND_DEBUG
:
1901 fields
->f_debug
= value
;
1903 case FRV_OPERAND_EIR
:
1904 fields
->f_eir
= value
;
1906 case FRV_OPERAND_HINT
:
1907 fields
->f_hint
= value
;
1909 case FRV_OPERAND_HINT_NOT_TAKEN
:
1910 fields
->f_hint
= value
;
1912 case FRV_OPERAND_HINT_TAKEN
:
1913 fields
->f_hint
= value
;
1915 case FRV_OPERAND_LABEL16
:
1916 fields
->f_label16
= value
;
1918 case FRV_OPERAND_LABEL24
:
1919 fields
->f_label24
= value
;
1921 case FRV_OPERAND_LDANN
:
1922 fields
->f_reloc_ann
= value
;
1924 case FRV_OPERAND_LDDANN
:
1925 fields
->f_reloc_ann
= value
;
1927 case FRV_OPERAND_LOCK
:
1928 fields
->f_lock
= value
;
1930 case FRV_OPERAND_PACK
:
1931 fields
->f_pack
= value
;
1933 case FRV_OPERAND_S10
:
1934 fields
->f_s10
= value
;
1936 case FRV_OPERAND_S12
:
1937 fields
->f_d12
= value
;
1939 case FRV_OPERAND_S16
:
1940 fields
->f_s16
= value
;
1942 case FRV_OPERAND_S5
:
1943 fields
->f_s5
= value
;
1945 case FRV_OPERAND_S6
:
1946 fields
->f_s6
= value
;
1948 case FRV_OPERAND_S6_1
:
1949 fields
->f_s6_1
= value
;
1951 case FRV_OPERAND_SLO16
:
1952 fields
->f_s16
= value
;
1954 case FRV_OPERAND_SPR
:
1955 fields
->f_spr
= value
;
1957 case FRV_OPERAND_U12
:
1958 fields
->f_u12
= value
;
1960 case FRV_OPERAND_U16
:
1961 fields
->f_u16
= value
;
1963 case FRV_OPERAND_U6
:
1964 fields
->f_u6
= value
;
1966 case FRV_OPERAND_UHI16
:
1967 fields
->f_u16
= value
;
1969 case FRV_OPERAND_ULO16
:
1970 fields
->f_u16
= value
;
1974 /* xgettext:c-format */
1975 fprintf (stderr
, _("Unrecognized field %d while setting int operand.\n"),
1982 frv_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1984 CGEN_FIELDS
* fields
,
1989 case FRV_OPERAND_A0
:
1990 fields
->f_A
= value
;
1992 case FRV_OPERAND_A1
:
1993 fields
->f_A
= value
;
1995 case FRV_OPERAND_ACC40SI
:
1996 fields
->f_ACC40Si
= value
;
1998 case FRV_OPERAND_ACC40SK
:
1999 fields
->f_ACC40Sk
= value
;
2001 case FRV_OPERAND_ACC40UI
:
2002 fields
->f_ACC40Ui
= value
;
2004 case FRV_OPERAND_ACC40UK
:
2005 fields
->f_ACC40Uk
= value
;
2007 case FRV_OPERAND_ACCGI
:
2008 fields
->f_ACCGi
= value
;
2010 case FRV_OPERAND_ACCGK
:
2011 fields
->f_ACCGk
= value
;
2013 case FRV_OPERAND_CCI
:
2014 fields
->f_CCi
= value
;
2016 case FRV_OPERAND_CPRDOUBLEK
:
2017 fields
->f_CPRk
= value
;
2019 case FRV_OPERAND_CPRI
:
2020 fields
->f_CPRi
= value
;
2022 case FRV_OPERAND_CPRJ
:
2023 fields
->f_CPRj
= value
;
2025 case FRV_OPERAND_CPRK
:
2026 fields
->f_CPRk
= value
;
2028 case FRV_OPERAND_CRI
:
2029 fields
->f_CRi
= value
;
2031 case FRV_OPERAND_CRJ
:
2032 fields
->f_CRj
= value
;
2034 case FRV_OPERAND_CRJ_FLOAT
:
2035 fields
->f_CRj_float
= value
;
2037 case FRV_OPERAND_CRJ_INT
:
2038 fields
->f_CRj_int
= value
;
2040 case FRV_OPERAND_CRK
:
2041 fields
->f_CRk
= value
;
2043 case FRV_OPERAND_FCCI_1
:
2044 fields
->f_FCCi_1
= value
;
2046 case FRV_OPERAND_FCCI_2
:
2047 fields
->f_FCCi_2
= value
;
2049 case FRV_OPERAND_FCCI_3
:
2050 fields
->f_FCCi_3
= value
;
2052 case FRV_OPERAND_FCCK
:
2053 fields
->f_FCCk
= value
;
2055 case FRV_OPERAND_FRDOUBLEI
:
2056 fields
->f_FRi
= value
;
2058 case FRV_OPERAND_FRDOUBLEJ
:
2059 fields
->f_FRj
= value
;
2061 case FRV_OPERAND_FRDOUBLEK
:
2062 fields
->f_FRk
= value
;
2064 case FRV_OPERAND_FRI
:
2065 fields
->f_FRi
= value
;
2067 case FRV_OPERAND_FRINTI
:
2068 fields
->f_FRi
= value
;
2070 case FRV_OPERAND_FRINTIEVEN
:
2071 fields
->f_FRi
= value
;
2073 case FRV_OPERAND_FRINTJ
:
2074 fields
->f_FRj
= value
;
2076 case FRV_OPERAND_FRINTJEVEN
:
2077 fields
->f_FRj
= value
;
2079 case FRV_OPERAND_FRINTK
:
2080 fields
->f_FRk
= value
;
2082 case FRV_OPERAND_FRINTKEVEN
:
2083 fields
->f_FRk
= value
;
2085 case FRV_OPERAND_FRJ
:
2086 fields
->f_FRj
= value
;
2088 case FRV_OPERAND_FRK
:
2089 fields
->f_FRk
= value
;
2091 case FRV_OPERAND_FRKHI
:
2092 fields
->f_FRk
= value
;
2094 case FRV_OPERAND_FRKLO
:
2095 fields
->f_FRk
= value
;
2097 case FRV_OPERAND_GRDOUBLEK
:
2098 fields
->f_GRk
= value
;
2100 case FRV_OPERAND_GRI
:
2101 fields
->f_GRi
= value
;
2103 case FRV_OPERAND_GRJ
:
2104 fields
->f_GRj
= value
;
2106 case FRV_OPERAND_GRK
:
2107 fields
->f_GRk
= value
;
2109 case FRV_OPERAND_GRKHI
:
2110 fields
->f_GRk
= value
;
2112 case FRV_OPERAND_GRKLO
:
2113 fields
->f_GRk
= value
;
2115 case FRV_OPERAND_ICCI_1
:
2116 fields
->f_ICCi_1
= value
;
2118 case FRV_OPERAND_ICCI_2
:
2119 fields
->f_ICCi_2
= value
;
2121 case FRV_OPERAND_ICCI_3
:
2122 fields
->f_ICCi_3
= value
;
2124 case FRV_OPERAND_LI
:
2125 fields
->f_LI
= value
;
2127 case FRV_OPERAND_LRAD
:
2128 fields
->f_LRAD
= value
;
2130 case FRV_OPERAND_LRAE
:
2131 fields
->f_LRAE
= value
;
2133 case FRV_OPERAND_LRAS
:
2134 fields
->f_LRAS
= value
;
2136 case FRV_OPERAND_TLBPRL
:
2137 fields
->f_TLBPRL
= value
;
2139 case FRV_OPERAND_TLBPROPX
:
2140 fields
->f_TLBPRopx
= value
;
2142 case FRV_OPERAND_AE
:
2143 fields
->f_ae
= value
;
2145 case FRV_OPERAND_CALLANN
:
2146 fields
->f_reloc_ann
= value
;
2148 case FRV_OPERAND_CCOND
:
2149 fields
->f_ccond
= value
;
2151 case FRV_OPERAND_COND
:
2152 fields
->f_cond
= value
;
2154 case FRV_OPERAND_D12
:
2155 fields
->f_d12
= value
;
2157 case FRV_OPERAND_DEBUG
:
2158 fields
->f_debug
= value
;
2160 case FRV_OPERAND_EIR
:
2161 fields
->f_eir
= value
;
2163 case FRV_OPERAND_HINT
:
2164 fields
->f_hint
= value
;
2166 case FRV_OPERAND_HINT_NOT_TAKEN
:
2167 fields
->f_hint
= value
;
2169 case FRV_OPERAND_HINT_TAKEN
:
2170 fields
->f_hint
= value
;
2172 case FRV_OPERAND_LABEL16
:
2173 fields
->f_label16
= value
;
2175 case FRV_OPERAND_LABEL24
:
2176 fields
->f_label24
= value
;
2178 case FRV_OPERAND_LDANN
:
2179 fields
->f_reloc_ann
= value
;
2181 case FRV_OPERAND_LDDANN
:
2182 fields
->f_reloc_ann
= value
;
2184 case FRV_OPERAND_LOCK
:
2185 fields
->f_lock
= value
;
2187 case FRV_OPERAND_PACK
:
2188 fields
->f_pack
= value
;
2190 case FRV_OPERAND_S10
:
2191 fields
->f_s10
= value
;
2193 case FRV_OPERAND_S12
:
2194 fields
->f_d12
= value
;
2196 case FRV_OPERAND_S16
:
2197 fields
->f_s16
= value
;
2199 case FRV_OPERAND_S5
:
2200 fields
->f_s5
= value
;
2202 case FRV_OPERAND_S6
:
2203 fields
->f_s6
= value
;
2205 case FRV_OPERAND_S6_1
:
2206 fields
->f_s6_1
= value
;
2208 case FRV_OPERAND_SLO16
:
2209 fields
->f_s16
= value
;
2211 case FRV_OPERAND_SPR
:
2212 fields
->f_spr
= value
;
2214 case FRV_OPERAND_U12
:
2215 fields
->f_u12
= value
;
2217 case FRV_OPERAND_U16
:
2218 fields
->f_u16
= value
;
2220 case FRV_OPERAND_U6
:
2221 fields
->f_u6
= value
;
2223 case FRV_OPERAND_UHI16
:
2224 fields
->f_u16
= value
;
2226 case FRV_OPERAND_ULO16
:
2227 fields
->f_u16
= value
;
2231 /* xgettext:c-format */
2232 fprintf (stderr
, _("Unrecognized field %d while setting vma operand.\n"),
2238 /* Function to call before using the instruction builder tables. */
2241 frv_cgen_init_ibld_table (CGEN_CPU_DESC cd
)
2243 cd
->insert_handlers
= & frv_cgen_insert_handlers
[0];
2244 cd
->extract_handlers
= & frv_cgen_extract_handlers
[0];
2246 cd
->insert_operand
= frv_cgen_insert_operand
;
2247 cd
->extract_operand
= frv_cgen_extract_operand
;
2249 cd
->get_int_operand
= frv_cgen_get_int_operand
;
2250 cd
->set_int_operand
= frv_cgen_set_int_operand
;
2251 cd
->get_vma_operand
= frv_cgen_get_vma_operand
;
2252 cd
->set_vma_operand
= frv_cgen_set_vma_operand
;