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 Free Software Foundation, Inc.
8 This file is part of the GNU Binutils and GDB, the GNU debugger.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software Foundation, Inc.,
22 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
36 #include "safe-ctype.h"
39 #define min(a,b) ((a) < (b) ? (a) : (b))
41 #define max(a,b) ((a) > (b) ? (a) : (b))
43 /* Used by the ifield rtx function. */
44 #define FLD(f) (fields->f)
46 static const char * insert_normal
47 PARAMS ((CGEN_CPU_DESC
, long, unsigned int, unsigned int, unsigned int,
48 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR
));
49 static const char * insert_insn_normal
50 PARAMS ((CGEN_CPU_DESC
, const CGEN_INSN
*,
51 CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
));
52 static int extract_normal
53 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
,
54 unsigned int, unsigned int, unsigned int, unsigned int,
55 unsigned int, unsigned int, bfd_vma
, long *));
56 static int extract_insn_normal
57 PARAMS ((CGEN_CPU_DESC
, const CGEN_INSN
*, CGEN_EXTRACT_INFO
*,
58 CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
));
60 static void put_insn_int_value
61 PARAMS ((CGEN_CPU_DESC
, CGEN_INSN_BYTES_PTR
, int, int, CGEN_INSN_INT
));
64 static CGEN_INLINE
void insert_1
65 PARAMS ((CGEN_CPU_DESC
, unsigned long, int, int, int, unsigned char *));
66 static CGEN_INLINE
int fill_cache
67 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, bfd_vma
));
68 static CGEN_INLINE
long extract_1
69 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, int,
70 unsigned char *, bfd_vma
));
73 /* Operand insertion. */
77 /* Subroutine of insert_normal. */
79 static CGEN_INLINE
void
80 insert_1 (cd
, value
, start
, length
, word_length
, bufp
)
83 int start
,length
,word_length
;
89 x
= cgen_get_insn_value (cd
, bufp
, word_length
);
91 /* Written this way to avoid undefined behaviour. */
92 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
94 shift
= (start
+ 1) - length
;
96 shift
= (word_length
- (start
+ length
));
97 x
= (x
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
99 cgen_put_insn_value (cd
, bufp
, word_length
, (bfd_vma
) x
);
102 #endif /* ! CGEN_INT_INSN_P */
104 /* Default insertion routine.
106 ATTRS is a mask of the boolean attributes.
107 WORD_OFFSET is the offset in bits from the start of the insn of the value.
108 WORD_LENGTH is the length of the word in bits in which the value resides.
109 START is the starting bit number in the word, architecture origin.
110 LENGTH is the length of VALUE in bits.
111 TOTAL_LENGTH is the total length of the insn in bits.
113 The result is an error message or NULL if success. */
115 /* ??? This duplicates functionality with bfd's howto table and
116 bfd_install_relocation. */
117 /* ??? This doesn't handle bfd_vma's. Create another function when
121 insert_normal (cd
, value
, attrs
, word_offset
, start
, length
, word_length
,
122 total_length
, buffer
)
126 unsigned int word_offset
, start
, length
, word_length
, total_length
;
127 CGEN_INSN_BYTES_PTR buffer
;
129 static char errbuf
[100];
130 /* Written this way to avoid undefined behaviour. */
131 unsigned long mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
133 /* If LENGTH is zero, this operand doesn't contribute to the value. */
143 if (word_length
> 32)
146 /* For architectures with insns smaller than the base-insn-bitsize,
147 word_length may be too big. */
148 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
151 && word_length
> total_length
)
152 word_length
= total_length
;
155 /* Ensure VALUE will fit. */
156 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGN_OPT
))
158 long minval
= - (1L << (length
- 1));
159 unsigned long maxval
= mask
;
161 if ((value
> 0 && (unsigned long) value
> maxval
)
164 /* xgettext:c-format */
166 _("operand out of range (%ld not between %ld and %lu)"),
167 value
, minval
, maxval
);
171 else if (! CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
))
173 unsigned long maxval
= mask
;
175 if ((unsigned long) value
> maxval
)
177 /* xgettext:c-format */
179 _("operand out of range (%lu not between 0 and %lu)"),
186 if (! cgen_signed_overflow_ok_p (cd
))
188 long minval
= - (1L << (length
- 1));
189 long maxval
= (1L << (length
- 1)) - 1;
191 if (value
< minval
|| value
> maxval
)
194 /* xgettext:c-format */
195 (errbuf
, _("operand out of range (%ld not between %ld and %ld)"),
196 value
, minval
, maxval
);
207 if (CGEN_INSN_LSB0_P
)
208 shift
= (word_offset
+ start
+ 1) - length
;
210 shift
= total_length
- (word_offset
+ start
+ length
);
211 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
214 #else /* ! CGEN_INT_INSN_P */
217 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
219 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
222 #endif /* ! CGEN_INT_INSN_P */
227 /* Default insn builder (insert handler).
228 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
229 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
230 recorded in host byte order, otherwise BUFFER is an array of bytes
231 and the value is recorded in target byte order).
232 The result is an error message or NULL if success. */
235 insert_insn_normal (cd
, insn
, fields
, buffer
, pc
)
237 const CGEN_INSN
* insn
;
238 CGEN_FIELDS
* fields
;
239 CGEN_INSN_BYTES_PTR buffer
;
242 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
244 const CGEN_SYNTAX_CHAR_TYPE
* syn
;
246 CGEN_INIT_INSERT (cd
);
247 value
= CGEN_INSN_BASE_VALUE (insn
);
249 /* If we're recording insns as numbers (rather than a string of bytes),
250 target byte order handling is deferred until later. */
254 put_insn_int_value (cd
, buffer
, cd
->base_insn_bitsize
,
255 CGEN_FIELDS_BITSIZE (fields
), value
);
259 cgen_put_insn_value (cd
, buffer
, min ((unsigned) cd
->base_insn_bitsize
,
260 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
263 #endif /* ! CGEN_INT_INSN_P */
265 /* ??? It would be better to scan the format's fields.
266 Still need to be able to insert a value based on the operand though;
267 e.g. storing a branch displacement that got resolved later.
268 Needs more thought first. */
270 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
274 if (CGEN_SYNTAX_CHAR_P (* syn
))
277 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
287 /* Cover function to store an insn value into an integral insn. Must go here
288 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
291 put_insn_int_value (cd
, buf
, length
, insn_length
, value
)
292 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
293 CGEN_INSN_BYTES_PTR buf
;
298 /* For architectures with insns smaller than the base-insn-bitsize,
299 length may be too big. */
300 if (length
> insn_length
)
304 int shift
= insn_length
- length
;
305 /* Written this way to avoid undefined behaviour. */
306 CGEN_INSN_INT mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
307 *buf
= (*buf
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
312 /* Operand extraction. */
314 #if ! CGEN_INT_INSN_P
316 /* Subroutine of extract_normal.
317 Ensure sufficient bytes are cached in EX_INFO.
318 OFFSET is the offset in bytes from the start of the insn of the value.
319 BYTES is the length of the needed value.
320 Returns 1 for success, 0 for failure. */
322 static CGEN_INLINE
int
323 fill_cache (cd
, ex_info
, offset
, bytes
, pc
)
324 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
325 CGEN_EXTRACT_INFO
*ex_info
;
329 /* It's doubtful that the middle part has already been fetched so
330 we don't optimize that case. kiss. */
332 disassemble_info
*info
= (disassemble_info
*) ex_info
->dis_info
;
334 /* First do a quick check. */
335 mask
= (1 << bytes
) - 1;
336 if (((ex_info
->valid
>> offset
) & mask
) == mask
)
339 /* Search for the first byte we need to read. */
340 for (mask
= 1 << offset
; bytes
> 0; --bytes
, ++offset
, mask
<<= 1)
341 if (! (mask
& ex_info
->valid
))
349 status
= (*info
->read_memory_func
)
350 (pc
, ex_info
->insn_bytes
+ offset
, bytes
, info
);
354 (*info
->memory_error_func
) (status
, pc
, info
);
358 ex_info
->valid
|= ((1 << bytes
) - 1) << offset
;
364 /* Subroutine of extract_normal. */
366 static CGEN_INLINE
long
367 extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
)
369 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
;
370 int start
,length
,word_length
;
372 bfd_vma pc ATTRIBUTE_UNUSED
;
377 int big_p
= CGEN_CPU_INSN_ENDIAN (cd
) == CGEN_ENDIAN_BIG
;
379 x
= cgen_get_insn_value (cd
, bufp
, word_length
);
381 if (CGEN_INSN_LSB0_P
)
382 shift
= (start
+ 1) - length
;
384 shift
= (word_length
- (start
+ length
));
388 #endif /* ! CGEN_INT_INSN_P */
390 /* Default extraction routine.
392 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
393 or sometimes less for cases like the m32r where the base insn size is 32
394 but some insns are 16 bits.
395 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
396 but for generality we take a bitmask of all of them.
397 WORD_OFFSET is the offset in bits from the start of the insn of the value.
398 WORD_LENGTH is the length of the word in bits in which the value resides.
399 START is the starting bit number in the word, architecture origin.
400 LENGTH is the length of VALUE in bits.
401 TOTAL_LENGTH is the total length of the insn in bits.
403 Returns 1 for success, 0 for failure. */
405 /* ??? The return code isn't properly used. wip. */
407 /* ??? This doesn't handle bfd_vma's. Create another function when
411 extract_normal (cd
, ex_info
, insn_value
, attrs
, word_offset
, start
, length
,
412 word_length
, total_length
, pc
, valuep
)
414 #if ! CGEN_INT_INSN_P
415 CGEN_EXTRACT_INFO
*ex_info
;
417 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
;
419 CGEN_INSN_INT insn_value
;
421 unsigned int word_offset
, start
, length
, word_length
, total_length
;
422 #if ! CGEN_INT_INSN_P
425 bfd_vma pc ATTRIBUTE_UNUSED
;
431 /* If LENGTH is zero, this operand doesn't contribute to the value
432 so give it a standard value of zero. */
445 if (word_length
> 32)
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
)
453 && word_length
> total_length
)
454 word_length
= total_length
;
457 /* Does the value reside in INSN_VALUE, and at the right alignment? */
459 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
461 if (CGEN_INSN_LSB0_P
)
462 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
464 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
467 #if ! CGEN_INT_INSN_P
471 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
473 if (word_length
> 32)
476 if (fill_cache (cd
, ex_info
, word_offset
/ 8, word_length
/ 8, pc
) == 0)
479 value
= extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
);
482 #endif /* ! CGEN_INT_INSN_P */
484 /* Written this way to avoid undefined behaviour. */
485 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
489 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
490 && (value
& (1L << (length
- 1))))
498 /* Default insn extractor.
500 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
501 The extracted fields are stored in FIELDS.
502 EX_INFO is used to handle reading variable length insns.
503 Return the length of the insn in bits, or 0 if no match,
504 or -1 if an error occurs fetching data (memory_error_func will have
508 extract_insn_normal (cd
, insn
, ex_info
, insn_value
, fields
, pc
)
510 const CGEN_INSN
*insn
;
511 CGEN_EXTRACT_INFO
*ex_info
;
512 CGEN_INSN_INT insn_value
;
516 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
517 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
519 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
521 CGEN_INIT_EXTRACT (cd
);
523 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
527 if (CGEN_SYNTAX_CHAR_P (*syn
))
530 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
531 ex_info
, insn_value
, fields
, pc
);
536 /* We recognized and successfully extracted this insn. */
537 return CGEN_INSN_BITSIZE (insn
);
540 /* machine generated code added here */
542 const char * frv_cgen_insert_operand
543 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
));
545 /* Main entry point for operand insertion.
547 This function is basically just a big switch statement. Earlier versions
548 used tables to look up the function to use, but
549 - if the table contains both assembler and disassembler functions then
550 the disassembler contains much of the assembler and vice-versa,
551 - there's a lot of inlining possibilities as things grow,
552 - using a switch statement avoids the function call overhead.
554 This function could be moved into `parse_insn_normal', but keeping it
555 separate makes clear the interface between `parse_insn_normal' and each of
556 the handlers. It's also needed by GAS to insert operands that couldn't be
557 resolved during parsing. */
560 frv_cgen_insert_operand (cd
, opindex
, fields
, buffer
, pc
)
563 CGEN_FIELDS
* fields
;
564 CGEN_INSN_BYTES_PTR buffer
;
565 bfd_vma pc ATTRIBUTE_UNUSED
;
567 const char * errmsg
= NULL
;
568 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
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_FRINTJ
:
655 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
657 case FRV_OPERAND_FRINTK
:
658 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
660 case FRV_OPERAND_FRJ
:
661 errmsg
= insert_normal (cd
, fields
->f_FRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
663 case FRV_OPERAND_FRK
:
664 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
666 case FRV_OPERAND_FRKHI
:
667 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
669 case FRV_OPERAND_FRKLO
:
670 errmsg
= insert_normal (cd
, fields
->f_FRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
672 case FRV_OPERAND_GRDOUBLEK
:
673 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
675 case FRV_OPERAND_GRI
:
676 errmsg
= insert_normal (cd
, fields
->f_GRi
, 0, 0, 17, 6, 32, total_length
, buffer
);
678 case FRV_OPERAND_GRJ
:
679 errmsg
= insert_normal (cd
, fields
->f_GRj
, 0, 0, 5, 6, 32, total_length
, buffer
);
681 case FRV_OPERAND_GRK
:
682 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
684 case FRV_OPERAND_GRKHI
:
685 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
687 case FRV_OPERAND_GRKLO
:
688 errmsg
= insert_normal (cd
, fields
->f_GRk
, 0, 0, 30, 6, 32, total_length
, buffer
);
690 case FRV_OPERAND_ICCI_1
:
691 errmsg
= insert_normal (cd
, fields
->f_ICCi_1
, 0, 0, 11, 2, 32, total_length
, buffer
);
693 case FRV_OPERAND_ICCI_2
:
694 errmsg
= insert_normal (cd
, fields
->f_ICCi_2
, 0, 0, 26, 2, 32, total_length
, buffer
);
696 case FRV_OPERAND_ICCI_3
:
697 errmsg
= insert_normal (cd
, fields
->f_ICCi_3
, 0, 0, 1, 2, 32, total_length
, buffer
);
699 case FRV_OPERAND_LI
:
700 errmsg
= insert_normal (cd
, fields
->f_LI
, 0, 0, 25, 1, 32, total_length
, buffer
);
702 case FRV_OPERAND_AE
:
703 errmsg
= insert_normal (cd
, fields
->f_ae
, 0, 0, 25, 1, 32, total_length
, buffer
);
705 case FRV_OPERAND_CCOND
:
706 errmsg
= insert_normal (cd
, fields
->f_ccond
, 0, 0, 12, 1, 32, total_length
, buffer
);
708 case FRV_OPERAND_COND
:
709 errmsg
= insert_normal (cd
, fields
->f_cond
, 0, 0, 8, 1, 32, total_length
, buffer
);
711 case FRV_OPERAND_D12
:
712 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
714 case FRV_OPERAND_DEBUG
:
715 errmsg
= insert_normal (cd
, fields
->f_debug
, 0, 0, 25, 1, 32, total_length
, buffer
);
717 case FRV_OPERAND_EIR
:
718 errmsg
= insert_normal (cd
, fields
->f_eir
, 0, 0, 17, 6, 32, total_length
, buffer
);
720 case FRV_OPERAND_HINT
:
721 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
723 case FRV_OPERAND_HINT_NOT_TAKEN
:
724 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
726 case FRV_OPERAND_HINT_TAKEN
:
727 errmsg
= insert_normal (cd
, fields
->f_hint
, 0, 0, 17, 2, 32, total_length
, buffer
);
729 case FRV_OPERAND_LABEL16
:
731 long value
= fields
->f_label16
;
732 value
= ((int) (((value
) - (pc
))) >> (2));
733 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 15, 16, 32, total_length
, buffer
);
736 case FRV_OPERAND_LABEL24
:
739 FLD (f_labelH6
) = ((int) (((FLD (f_label24
)) - (pc
))) >> (20));
740 FLD (f_labelL18
) = ((((unsigned int) (((FLD (f_label24
)) - (pc
))) >> (2))) & (262143));
742 errmsg
= insert_normal (cd
, fields
->f_labelH6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, buffer
);
745 errmsg
= insert_normal (cd
, fields
->f_labelL18
, 0, 0, 17, 18, 32, total_length
, buffer
);
750 case FRV_OPERAND_LOCK
:
751 errmsg
= insert_normal (cd
, fields
->f_lock
, 0, 0, 25, 1, 32, total_length
, buffer
);
753 case FRV_OPERAND_PACK
:
754 errmsg
= insert_normal (cd
, fields
->f_pack
, 0, 0, 31, 1, 32, total_length
, buffer
);
756 case FRV_OPERAND_S10
:
757 errmsg
= insert_normal (cd
, fields
->f_s10
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, buffer
);
759 case FRV_OPERAND_S12
:
760 errmsg
= insert_normal (cd
, fields
->f_d12
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, buffer
);
762 case FRV_OPERAND_S16
:
763 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
765 case FRV_OPERAND_S5
:
766 errmsg
= insert_normal (cd
, fields
->f_s5
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, buffer
);
768 case FRV_OPERAND_S6
:
769 errmsg
= insert_normal (cd
, fields
->f_s6
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, buffer
);
771 case FRV_OPERAND_S6_1
:
772 errmsg
= insert_normal (cd
, fields
->f_s6_1
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, buffer
);
774 case FRV_OPERAND_SLO16
:
775 errmsg
= insert_normal (cd
, fields
->f_s16
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, buffer
);
777 case FRV_OPERAND_SPR
:
780 FLD (f_spr_h
) = ((unsigned int) (FLD (f_spr
)) >> (6));
781 FLD (f_spr_l
) = ((FLD (f_spr
)) & (63));
783 errmsg
= insert_normal (cd
, fields
->f_spr_h
, 0, 0, 30, 6, 32, total_length
, buffer
);
786 errmsg
= insert_normal (cd
, fields
->f_spr_l
, 0, 0, 17, 6, 32, total_length
, buffer
);
791 case FRV_OPERAND_U12
:
794 FLD (f_u12_h
) = ((int) (FLD (f_u12
)) >> (6));
795 FLD (f_u12_l
) = ((FLD (f_u12
)) & (63));
797 errmsg
= insert_normal (cd
, fields
->f_u12_h
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, buffer
);
800 errmsg
= insert_normal (cd
, fields
->f_u12_l
, 0, 0, 5, 6, 32, total_length
, buffer
);
805 case FRV_OPERAND_U16
:
806 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
808 case FRV_OPERAND_U6
:
809 errmsg
= insert_normal (cd
, fields
->f_u6
, 0, 0, 5, 6, 32, total_length
, buffer
);
811 case FRV_OPERAND_UHI16
:
812 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
814 case FRV_OPERAND_ULO16
:
815 errmsg
= insert_normal (cd
, fields
->f_u16
, 0, 0, 15, 16, 32, total_length
, buffer
);
819 /* xgettext:c-format */
820 fprintf (stderr
, _("Unrecognized field %d while building insn.\n"),
828 int frv_cgen_extract_operand
829 PARAMS ((CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
,
830 CGEN_FIELDS
*, bfd_vma
));
832 /* Main entry point for operand extraction.
833 The result is <= 0 for error, >0 for success.
834 ??? Actual values aren't well defined right now.
836 This function is basically just a big switch statement. Earlier versions
837 used tables to look up the function to use, but
838 - if the table contains both assembler and disassembler functions then
839 the disassembler contains much of the assembler and vice-versa,
840 - there's a lot of inlining possibilities as things grow,
841 - using a switch statement avoids the function call overhead.
843 This function could be moved into `print_insn_normal', but keeping it
844 separate makes clear the interface between `print_insn_normal' and each of
848 frv_cgen_extract_operand (cd
, opindex
, ex_info
, insn_value
, fields
, pc
)
851 CGEN_EXTRACT_INFO
*ex_info
;
852 CGEN_INSN_INT insn_value
;
853 CGEN_FIELDS
* fields
;
856 /* Assume success (for those operands that are nops). */
858 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
863 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 1, 32, total_length
, pc
, & fields
->f_A
);
865 case FRV_OPERAND_ACC40SI
:
866 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Si
);
868 case FRV_OPERAND_ACC40SK
:
869 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Sk
);
871 case FRV_OPERAND_ACC40UI
:
872 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACC40Ui
);
874 case FRV_OPERAND_ACC40UK
:
875 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACC40Uk
);
877 case FRV_OPERAND_ACCGI
:
878 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_ACCGi
);
880 case FRV_OPERAND_ACCGK
:
881 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_ACCGk
);
883 case FRV_OPERAND_CCI
:
884 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 3, 32, total_length
, pc
, & fields
->f_CCi
);
886 case FRV_OPERAND_CPRDOUBLEK
:
887 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
889 case FRV_OPERAND_CPRI
:
890 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_CPRi
);
892 case FRV_OPERAND_CPRJ
:
893 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_CPRj
);
895 case FRV_OPERAND_CPRK
:
896 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_CPRk
);
898 case FRV_OPERAND_CRI
:
899 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 14, 3, 32, total_length
, pc
, & fields
->f_CRi
);
901 case FRV_OPERAND_CRJ
:
902 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 2, 3, 32, total_length
, pc
, & fields
->f_CRj
);
904 case FRV_OPERAND_CRJ_FLOAT
:
905 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_CRj_float
);
907 case FRV_OPERAND_CRJ_INT
:
910 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & value
);
911 value
= ((value
) + (4));
912 fields
->f_CRj_int
= value
;
915 case FRV_OPERAND_CRK
:
916 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 27, 3, 32, total_length
, pc
, & fields
->f_CRk
);
918 case FRV_OPERAND_FCCI_1
:
919 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_FCCi_1
);
921 case FRV_OPERAND_FCCI_2
:
922 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCi_2
);
924 case FRV_OPERAND_FCCI_3
:
925 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_FCCi_3
);
927 case FRV_OPERAND_FCCK
:
928 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_FCCk
);
930 case FRV_OPERAND_FRDOUBLEI
:
931 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
933 case FRV_OPERAND_FRDOUBLEJ
:
934 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
936 case FRV_OPERAND_FRDOUBLEK
:
937 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
939 case FRV_OPERAND_FRI
:
940 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
942 case FRV_OPERAND_FRINTI
:
943 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_FRi
);
945 case FRV_OPERAND_FRINTJ
:
946 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
948 case FRV_OPERAND_FRINTK
:
949 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
951 case FRV_OPERAND_FRJ
:
952 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_FRj
);
954 case FRV_OPERAND_FRK
:
955 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
957 case FRV_OPERAND_FRKHI
:
958 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
960 case FRV_OPERAND_FRKLO
:
961 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_FRk
);
963 case FRV_OPERAND_GRDOUBLEK
:
964 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
966 case FRV_OPERAND_GRI
:
967 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_GRi
);
969 case FRV_OPERAND_GRJ
:
970 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_GRj
);
972 case FRV_OPERAND_GRK
:
973 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
975 case FRV_OPERAND_GRKHI
:
976 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
978 case FRV_OPERAND_GRKLO
:
979 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_GRk
);
981 case FRV_OPERAND_ICCI_1
:
982 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 11, 2, 32, total_length
, pc
, & fields
->f_ICCi_1
);
984 case FRV_OPERAND_ICCI_2
:
985 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 26, 2, 32, total_length
, pc
, & fields
->f_ICCi_2
);
987 case FRV_OPERAND_ICCI_3
:
988 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 1, 2, 32, total_length
, pc
, & fields
->f_ICCi_3
);
990 case FRV_OPERAND_LI
:
991 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_LI
);
993 case FRV_OPERAND_AE
:
994 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_ae
);
996 case FRV_OPERAND_CCOND
:
997 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 1, 32, total_length
, pc
, & fields
->f_ccond
);
999 case FRV_OPERAND_COND
:
1000 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 1, 32, total_length
, pc
, & fields
->f_cond
);
1002 case FRV_OPERAND_D12
:
1003 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1005 case FRV_OPERAND_DEBUG
:
1006 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_debug
);
1008 case FRV_OPERAND_EIR
:
1009 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_eir
);
1011 case FRV_OPERAND_HINT
:
1012 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1014 case FRV_OPERAND_HINT_NOT_TAKEN
:
1015 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1017 case FRV_OPERAND_HINT_TAKEN
:
1018 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 2, 32, total_length
, pc
, & fields
->f_hint
);
1020 case FRV_OPERAND_LABEL16
:
1023 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
);
1024 value
= ((((value
) << (2))) + (pc
));
1025 fields
->f_label16
= value
;
1028 case FRV_OPERAND_LABEL24
:
1030 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 30, 6, 32, total_length
, pc
, & fields
->f_labelH6
);
1031 if (length
<= 0) break;
1032 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 18, 32, total_length
, pc
, & fields
->f_labelL18
);
1033 if (length
<= 0) break;
1035 FLD (f_label24
) = ((((((((FLD (f_labelH6
)) << (18))) | (FLD (f_labelL18
)))) << (2))) + (pc
));
1039 case FRV_OPERAND_LOCK
:
1040 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 25, 1, 32, total_length
, pc
, & fields
->f_lock
);
1042 case FRV_OPERAND_PACK
:
1043 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 31, 1, 32, total_length
, pc
, & fields
->f_pack
);
1045 case FRV_OPERAND_S10
:
1046 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 9, 10, 32, total_length
, pc
, & fields
->f_s10
);
1048 case FRV_OPERAND_S12
:
1049 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 12, 32, total_length
, pc
, & fields
->f_d12
);
1051 case FRV_OPERAND_S16
:
1052 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1054 case FRV_OPERAND_S5
:
1055 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 5, 32, total_length
, pc
, & fields
->f_s5
);
1057 case FRV_OPERAND_S6
:
1058 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 5, 6, 32, total_length
, pc
, & fields
->f_s6
);
1060 case FRV_OPERAND_S6_1
:
1061 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 11, 6, 32, total_length
, pc
, & fields
->f_s6_1
);
1063 case FRV_OPERAND_SLO16
:
1064 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 15, 16, 32, total_length
, pc
, & fields
->f_s16
);
1066 case FRV_OPERAND_SPR
:
1068 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 30, 6, 32, total_length
, pc
, & fields
->f_spr_h
);
1069 if (length
<= 0) break;
1070 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 17, 6, 32, total_length
, pc
, & fields
->f_spr_l
);
1071 if (length
<= 0) break;
1073 FLD (f_spr
) = ((((FLD (f_spr_h
)) << (6))) | (FLD (f_spr_l
)));
1077 case FRV_OPERAND_U12
:
1079 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 17, 6, 32, total_length
, pc
, & fields
->f_u12_h
);
1080 if (length
<= 0) break;
1081 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u12_l
);
1082 if (length
<= 0) break;
1084 FLD (f_u12
) = ((((FLD (f_u12_h
)) << (6))) | (FLD (f_u12_l
)));
1088 case FRV_OPERAND_U16
:
1089 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1091 case FRV_OPERAND_U6
:
1092 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 5, 6, 32, total_length
, pc
, & fields
->f_u6
);
1094 case FRV_OPERAND_UHI16
:
1095 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1097 case FRV_OPERAND_ULO16
:
1098 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 15, 16, 32, total_length
, pc
, & fields
->f_u16
);
1102 /* xgettext:c-format */
1103 fprintf (stderr
, _("Unrecognized field %d while decoding insn.\n"),
1111 cgen_insert_fn
* const frv_cgen_insert_handlers
[] =
1116 cgen_extract_fn
* const frv_cgen_extract_handlers
[] =
1118 extract_insn_normal
,
1121 int frv_cgen_get_int_operand
1122 PARAMS ((CGEN_CPU_DESC
, int, const CGEN_FIELDS
*));
1123 bfd_vma frv_cgen_get_vma_operand
1124 PARAMS ((CGEN_CPU_DESC
, int, const CGEN_FIELDS
*));
1126 /* Getting values from cgen_fields is handled by a collection of functions.
1127 They are distinguished by the type of the VALUE argument they return.
1128 TODO: floating point, inlining support, remove cases where result type
1132 frv_cgen_get_int_operand (cd
, opindex
, fields
)
1133 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1135 const CGEN_FIELDS
* fields
;
1141 case FRV_OPERAND_A
:
1142 value
= fields
->f_A
;
1144 case FRV_OPERAND_ACC40SI
:
1145 value
= fields
->f_ACC40Si
;
1147 case FRV_OPERAND_ACC40SK
:
1148 value
= fields
->f_ACC40Sk
;
1150 case FRV_OPERAND_ACC40UI
:
1151 value
= fields
->f_ACC40Ui
;
1153 case FRV_OPERAND_ACC40UK
:
1154 value
= fields
->f_ACC40Uk
;
1156 case FRV_OPERAND_ACCGI
:
1157 value
= fields
->f_ACCGi
;
1159 case FRV_OPERAND_ACCGK
:
1160 value
= fields
->f_ACCGk
;
1162 case FRV_OPERAND_CCI
:
1163 value
= fields
->f_CCi
;
1165 case FRV_OPERAND_CPRDOUBLEK
:
1166 value
= fields
->f_CPRk
;
1168 case FRV_OPERAND_CPRI
:
1169 value
= fields
->f_CPRi
;
1171 case FRV_OPERAND_CPRJ
:
1172 value
= fields
->f_CPRj
;
1174 case FRV_OPERAND_CPRK
:
1175 value
= fields
->f_CPRk
;
1177 case FRV_OPERAND_CRI
:
1178 value
= fields
->f_CRi
;
1180 case FRV_OPERAND_CRJ
:
1181 value
= fields
->f_CRj
;
1183 case FRV_OPERAND_CRJ_FLOAT
:
1184 value
= fields
->f_CRj_float
;
1186 case FRV_OPERAND_CRJ_INT
:
1187 value
= fields
->f_CRj_int
;
1189 case FRV_OPERAND_CRK
:
1190 value
= fields
->f_CRk
;
1192 case FRV_OPERAND_FCCI_1
:
1193 value
= fields
->f_FCCi_1
;
1195 case FRV_OPERAND_FCCI_2
:
1196 value
= fields
->f_FCCi_2
;
1198 case FRV_OPERAND_FCCI_3
:
1199 value
= fields
->f_FCCi_3
;
1201 case FRV_OPERAND_FCCK
:
1202 value
= fields
->f_FCCk
;
1204 case FRV_OPERAND_FRDOUBLEI
:
1205 value
= fields
->f_FRi
;
1207 case FRV_OPERAND_FRDOUBLEJ
:
1208 value
= fields
->f_FRj
;
1210 case FRV_OPERAND_FRDOUBLEK
:
1211 value
= fields
->f_FRk
;
1213 case FRV_OPERAND_FRI
:
1214 value
= fields
->f_FRi
;
1216 case FRV_OPERAND_FRINTI
:
1217 value
= fields
->f_FRi
;
1219 case FRV_OPERAND_FRINTJ
:
1220 value
= fields
->f_FRj
;
1222 case FRV_OPERAND_FRINTK
:
1223 value
= fields
->f_FRk
;
1225 case FRV_OPERAND_FRJ
:
1226 value
= fields
->f_FRj
;
1228 case FRV_OPERAND_FRK
:
1229 value
= fields
->f_FRk
;
1231 case FRV_OPERAND_FRKHI
:
1232 value
= fields
->f_FRk
;
1234 case FRV_OPERAND_FRKLO
:
1235 value
= fields
->f_FRk
;
1237 case FRV_OPERAND_GRDOUBLEK
:
1238 value
= fields
->f_GRk
;
1240 case FRV_OPERAND_GRI
:
1241 value
= fields
->f_GRi
;
1243 case FRV_OPERAND_GRJ
:
1244 value
= fields
->f_GRj
;
1246 case FRV_OPERAND_GRK
:
1247 value
= fields
->f_GRk
;
1249 case FRV_OPERAND_GRKHI
:
1250 value
= fields
->f_GRk
;
1252 case FRV_OPERAND_GRKLO
:
1253 value
= fields
->f_GRk
;
1255 case FRV_OPERAND_ICCI_1
:
1256 value
= fields
->f_ICCi_1
;
1258 case FRV_OPERAND_ICCI_2
:
1259 value
= fields
->f_ICCi_2
;
1261 case FRV_OPERAND_ICCI_3
:
1262 value
= fields
->f_ICCi_3
;
1264 case FRV_OPERAND_LI
:
1265 value
= fields
->f_LI
;
1267 case FRV_OPERAND_AE
:
1268 value
= fields
->f_ae
;
1270 case FRV_OPERAND_CCOND
:
1271 value
= fields
->f_ccond
;
1273 case FRV_OPERAND_COND
:
1274 value
= fields
->f_cond
;
1276 case FRV_OPERAND_D12
:
1277 value
= fields
->f_d12
;
1279 case FRV_OPERAND_DEBUG
:
1280 value
= fields
->f_debug
;
1282 case FRV_OPERAND_EIR
:
1283 value
= fields
->f_eir
;
1285 case FRV_OPERAND_HINT
:
1286 value
= fields
->f_hint
;
1288 case FRV_OPERAND_HINT_NOT_TAKEN
:
1289 value
= fields
->f_hint
;
1291 case FRV_OPERAND_HINT_TAKEN
:
1292 value
= fields
->f_hint
;
1294 case FRV_OPERAND_LABEL16
:
1295 value
= fields
->f_label16
;
1297 case FRV_OPERAND_LABEL24
:
1298 value
= fields
->f_label24
;
1300 case FRV_OPERAND_LOCK
:
1301 value
= fields
->f_lock
;
1303 case FRV_OPERAND_PACK
:
1304 value
= fields
->f_pack
;
1306 case FRV_OPERAND_S10
:
1307 value
= fields
->f_s10
;
1309 case FRV_OPERAND_S12
:
1310 value
= fields
->f_d12
;
1312 case FRV_OPERAND_S16
:
1313 value
= fields
->f_s16
;
1315 case FRV_OPERAND_S5
:
1316 value
= fields
->f_s5
;
1318 case FRV_OPERAND_S6
:
1319 value
= fields
->f_s6
;
1321 case FRV_OPERAND_S6_1
:
1322 value
= fields
->f_s6_1
;
1324 case FRV_OPERAND_SLO16
:
1325 value
= fields
->f_s16
;
1327 case FRV_OPERAND_SPR
:
1328 value
= fields
->f_spr
;
1330 case FRV_OPERAND_U12
:
1331 value
= fields
->f_u12
;
1333 case FRV_OPERAND_U16
:
1334 value
= fields
->f_u16
;
1336 case FRV_OPERAND_U6
:
1337 value
= fields
->f_u6
;
1339 case FRV_OPERAND_UHI16
:
1340 value
= fields
->f_u16
;
1342 case FRV_OPERAND_ULO16
:
1343 value
= fields
->f_u16
;
1347 /* xgettext:c-format */
1348 fprintf (stderr
, _("Unrecognized field %d while getting int operand.\n"),
1357 frv_cgen_get_vma_operand (cd
, opindex
, fields
)
1358 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1360 const CGEN_FIELDS
* fields
;
1366 case FRV_OPERAND_A
:
1367 value
= fields
->f_A
;
1369 case FRV_OPERAND_ACC40SI
:
1370 value
= fields
->f_ACC40Si
;
1372 case FRV_OPERAND_ACC40SK
:
1373 value
= fields
->f_ACC40Sk
;
1375 case FRV_OPERAND_ACC40UI
:
1376 value
= fields
->f_ACC40Ui
;
1378 case FRV_OPERAND_ACC40UK
:
1379 value
= fields
->f_ACC40Uk
;
1381 case FRV_OPERAND_ACCGI
:
1382 value
= fields
->f_ACCGi
;
1384 case FRV_OPERAND_ACCGK
:
1385 value
= fields
->f_ACCGk
;
1387 case FRV_OPERAND_CCI
:
1388 value
= fields
->f_CCi
;
1390 case FRV_OPERAND_CPRDOUBLEK
:
1391 value
= fields
->f_CPRk
;
1393 case FRV_OPERAND_CPRI
:
1394 value
= fields
->f_CPRi
;
1396 case FRV_OPERAND_CPRJ
:
1397 value
= fields
->f_CPRj
;
1399 case FRV_OPERAND_CPRK
:
1400 value
= fields
->f_CPRk
;
1402 case FRV_OPERAND_CRI
:
1403 value
= fields
->f_CRi
;
1405 case FRV_OPERAND_CRJ
:
1406 value
= fields
->f_CRj
;
1408 case FRV_OPERAND_CRJ_FLOAT
:
1409 value
= fields
->f_CRj_float
;
1411 case FRV_OPERAND_CRJ_INT
:
1412 value
= fields
->f_CRj_int
;
1414 case FRV_OPERAND_CRK
:
1415 value
= fields
->f_CRk
;
1417 case FRV_OPERAND_FCCI_1
:
1418 value
= fields
->f_FCCi_1
;
1420 case FRV_OPERAND_FCCI_2
:
1421 value
= fields
->f_FCCi_2
;
1423 case FRV_OPERAND_FCCI_3
:
1424 value
= fields
->f_FCCi_3
;
1426 case FRV_OPERAND_FCCK
:
1427 value
= fields
->f_FCCk
;
1429 case FRV_OPERAND_FRDOUBLEI
:
1430 value
= fields
->f_FRi
;
1432 case FRV_OPERAND_FRDOUBLEJ
:
1433 value
= fields
->f_FRj
;
1435 case FRV_OPERAND_FRDOUBLEK
:
1436 value
= fields
->f_FRk
;
1438 case FRV_OPERAND_FRI
:
1439 value
= fields
->f_FRi
;
1441 case FRV_OPERAND_FRINTI
:
1442 value
= fields
->f_FRi
;
1444 case FRV_OPERAND_FRINTJ
:
1445 value
= fields
->f_FRj
;
1447 case FRV_OPERAND_FRINTK
:
1448 value
= fields
->f_FRk
;
1450 case FRV_OPERAND_FRJ
:
1451 value
= fields
->f_FRj
;
1453 case FRV_OPERAND_FRK
:
1454 value
= fields
->f_FRk
;
1456 case FRV_OPERAND_FRKHI
:
1457 value
= fields
->f_FRk
;
1459 case FRV_OPERAND_FRKLO
:
1460 value
= fields
->f_FRk
;
1462 case FRV_OPERAND_GRDOUBLEK
:
1463 value
= fields
->f_GRk
;
1465 case FRV_OPERAND_GRI
:
1466 value
= fields
->f_GRi
;
1468 case FRV_OPERAND_GRJ
:
1469 value
= fields
->f_GRj
;
1471 case FRV_OPERAND_GRK
:
1472 value
= fields
->f_GRk
;
1474 case FRV_OPERAND_GRKHI
:
1475 value
= fields
->f_GRk
;
1477 case FRV_OPERAND_GRKLO
:
1478 value
= fields
->f_GRk
;
1480 case FRV_OPERAND_ICCI_1
:
1481 value
= fields
->f_ICCi_1
;
1483 case FRV_OPERAND_ICCI_2
:
1484 value
= fields
->f_ICCi_2
;
1486 case FRV_OPERAND_ICCI_3
:
1487 value
= fields
->f_ICCi_3
;
1489 case FRV_OPERAND_LI
:
1490 value
= fields
->f_LI
;
1492 case FRV_OPERAND_AE
:
1493 value
= fields
->f_ae
;
1495 case FRV_OPERAND_CCOND
:
1496 value
= fields
->f_ccond
;
1498 case FRV_OPERAND_COND
:
1499 value
= fields
->f_cond
;
1501 case FRV_OPERAND_D12
:
1502 value
= fields
->f_d12
;
1504 case FRV_OPERAND_DEBUG
:
1505 value
= fields
->f_debug
;
1507 case FRV_OPERAND_EIR
:
1508 value
= fields
->f_eir
;
1510 case FRV_OPERAND_HINT
:
1511 value
= fields
->f_hint
;
1513 case FRV_OPERAND_HINT_NOT_TAKEN
:
1514 value
= fields
->f_hint
;
1516 case FRV_OPERAND_HINT_TAKEN
:
1517 value
= fields
->f_hint
;
1519 case FRV_OPERAND_LABEL16
:
1520 value
= fields
->f_label16
;
1522 case FRV_OPERAND_LABEL24
:
1523 value
= fields
->f_label24
;
1525 case FRV_OPERAND_LOCK
:
1526 value
= fields
->f_lock
;
1528 case FRV_OPERAND_PACK
:
1529 value
= fields
->f_pack
;
1531 case FRV_OPERAND_S10
:
1532 value
= fields
->f_s10
;
1534 case FRV_OPERAND_S12
:
1535 value
= fields
->f_d12
;
1537 case FRV_OPERAND_S16
:
1538 value
= fields
->f_s16
;
1540 case FRV_OPERAND_S5
:
1541 value
= fields
->f_s5
;
1543 case FRV_OPERAND_S6
:
1544 value
= fields
->f_s6
;
1546 case FRV_OPERAND_S6_1
:
1547 value
= fields
->f_s6_1
;
1549 case FRV_OPERAND_SLO16
:
1550 value
= fields
->f_s16
;
1552 case FRV_OPERAND_SPR
:
1553 value
= fields
->f_spr
;
1555 case FRV_OPERAND_U12
:
1556 value
= fields
->f_u12
;
1558 case FRV_OPERAND_U16
:
1559 value
= fields
->f_u16
;
1561 case FRV_OPERAND_U6
:
1562 value
= fields
->f_u6
;
1564 case FRV_OPERAND_UHI16
:
1565 value
= fields
->f_u16
;
1567 case FRV_OPERAND_ULO16
:
1568 value
= fields
->f_u16
;
1572 /* xgettext:c-format */
1573 fprintf (stderr
, _("Unrecognized field %d while getting vma operand.\n"),
1581 void frv_cgen_set_int_operand
1582 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int));
1583 void frv_cgen_set_vma_operand
1584 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
));
1586 /* Stuffing values in cgen_fields is handled by a collection of functions.
1587 They are distinguished by the type of the VALUE argument they accept.
1588 TODO: floating point, inlining support, remove cases where argument type
1592 frv_cgen_set_int_operand (cd
, opindex
, fields
, value
)
1593 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1595 CGEN_FIELDS
* fields
;
1600 case FRV_OPERAND_A
:
1601 fields
->f_A
= value
;
1603 case FRV_OPERAND_ACC40SI
:
1604 fields
->f_ACC40Si
= value
;
1606 case FRV_OPERAND_ACC40SK
:
1607 fields
->f_ACC40Sk
= value
;
1609 case FRV_OPERAND_ACC40UI
:
1610 fields
->f_ACC40Ui
= value
;
1612 case FRV_OPERAND_ACC40UK
:
1613 fields
->f_ACC40Uk
= value
;
1615 case FRV_OPERAND_ACCGI
:
1616 fields
->f_ACCGi
= value
;
1618 case FRV_OPERAND_ACCGK
:
1619 fields
->f_ACCGk
= value
;
1621 case FRV_OPERAND_CCI
:
1622 fields
->f_CCi
= value
;
1624 case FRV_OPERAND_CPRDOUBLEK
:
1625 fields
->f_CPRk
= value
;
1627 case FRV_OPERAND_CPRI
:
1628 fields
->f_CPRi
= value
;
1630 case FRV_OPERAND_CPRJ
:
1631 fields
->f_CPRj
= value
;
1633 case FRV_OPERAND_CPRK
:
1634 fields
->f_CPRk
= value
;
1636 case FRV_OPERAND_CRI
:
1637 fields
->f_CRi
= value
;
1639 case FRV_OPERAND_CRJ
:
1640 fields
->f_CRj
= value
;
1642 case FRV_OPERAND_CRJ_FLOAT
:
1643 fields
->f_CRj_float
= value
;
1645 case FRV_OPERAND_CRJ_INT
:
1646 fields
->f_CRj_int
= value
;
1648 case FRV_OPERAND_CRK
:
1649 fields
->f_CRk
= value
;
1651 case FRV_OPERAND_FCCI_1
:
1652 fields
->f_FCCi_1
= value
;
1654 case FRV_OPERAND_FCCI_2
:
1655 fields
->f_FCCi_2
= value
;
1657 case FRV_OPERAND_FCCI_3
:
1658 fields
->f_FCCi_3
= value
;
1660 case FRV_OPERAND_FCCK
:
1661 fields
->f_FCCk
= value
;
1663 case FRV_OPERAND_FRDOUBLEI
:
1664 fields
->f_FRi
= value
;
1666 case FRV_OPERAND_FRDOUBLEJ
:
1667 fields
->f_FRj
= value
;
1669 case FRV_OPERAND_FRDOUBLEK
:
1670 fields
->f_FRk
= value
;
1672 case FRV_OPERAND_FRI
:
1673 fields
->f_FRi
= value
;
1675 case FRV_OPERAND_FRINTI
:
1676 fields
->f_FRi
= value
;
1678 case FRV_OPERAND_FRINTJ
:
1679 fields
->f_FRj
= value
;
1681 case FRV_OPERAND_FRINTK
:
1682 fields
->f_FRk
= value
;
1684 case FRV_OPERAND_FRJ
:
1685 fields
->f_FRj
= value
;
1687 case FRV_OPERAND_FRK
:
1688 fields
->f_FRk
= value
;
1690 case FRV_OPERAND_FRKHI
:
1691 fields
->f_FRk
= value
;
1693 case FRV_OPERAND_FRKLO
:
1694 fields
->f_FRk
= value
;
1696 case FRV_OPERAND_GRDOUBLEK
:
1697 fields
->f_GRk
= value
;
1699 case FRV_OPERAND_GRI
:
1700 fields
->f_GRi
= value
;
1702 case FRV_OPERAND_GRJ
:
1703 fields
->f_GRj
= value
;
1705 case FRV_OPERAND_GRK
:
1706 fields
->f_GRk
= value
;
1708 case FRV_OPERAND_GRKHI
:
1709 fields
->f_GRk
= value
;
1711 case FRV_OPERAND_GRKLO
:
1712 fields
->f_GRk
= value
;
1714 case FRV_OPERAND_ICCI_1
:
1715 fields
->f_ICCi_1
= value
;
1717 case FRV_OPERAND_ICCI_2
:
1718 fields
->f_ICCi_2
= value
;
1720 case FRV_OPERAND_ICCI_3
:
1721 fields
->f_ICCi_3
= value
;
1723 case FRV_OPERAND_LI
:
1724 fields
->f_LI
= value
;
1726 case FRV_OPERAND_AE
:
1727 fields
->f_ae
= value
;
1729 case FRV_OPERAND_CCOND
:
1730 fields
->f_ccond
= value
;
1732 case FRV_OPERAND_COND
:
1733 fields
->f_cond
= value
;
1735 case FRV_OPERAND_D12
:
1736 fields
->f_d12
= value
;
1738 case FRV_OPERAND_DEBUG
:
1739 fields
->f_debug
= value
;
1741 case FRV_OPERAND_EIR
:
1742 fields
->f_eir
= value
;
1744 case FRV_OPERAND_HINT
:
1745 fields
->f_hint
= value
;
1747 case FRV_OPERAND_HINT_NOT_TAKEN
:
1748 fields
->f_hint
= value
;
1750 case FRV_OPERAND_HINT_TAKEN
:
1751 fields
->f_hint
= value
;
1753 case FRV_OPERAND_LABEL16
:
1754 fields
->f_label16
= value
;
1756 case FRV_OPERAND_LABEL24
:
1757 fields
->f_label24
= value
;
1759 case FRV_OPERAND_LOCK
:
1760 fields
->f_lock
= value
;
1762 case FRV_OPERAND_PACK
:
1763 fields
->f_pack
= value
;
1765 case FRV_OPERAND_S10
:
1766 fields
->f_s10
= value
;
1768 case FRV_OPERAND_S12
:
1769 fields
->f_d12
= value
;
1771 case FRV_OPERAND_S16
:
1772 fields
->f_s16
= value
;
1774 case FRV_OPERAND_S5
:
1775 fields
->f_s5
= value
;
1777 case FRV_OPERAND_S6
:
1778 fields
->f_s6
= value
;
1780 case FRV_OPERAND_S6_1
:
1781 fields
->f_s6_1
= value
;
1783 case FRV_OPERAND_SLO16
:
1784 fields
->f_s16
= value
;
1786 case FRV_OPERAND_SPR
:
1787 fields
->f_spr
= value
;
1789 case FRV_OPERAND_U12
:
1790 fields
->f_u12
= value
;
1792 case FRV_OPERAND_U16
:
1793 fields
->f_u16
= value
;
1795 case FRV_OPERAND_U6
:
1796 fields
->f_u6
= value
;
1798 case FRV_OPERAND_UHI16
:
1799 fields
->f_u16
= value
;
1801 case FRV_OPERAND_ULO16
:
1802 fields
->f_u16
= value
;
1806 /* xgettext:c-format */
1807 fprintf (stderr
, _("Unrecognized field %d while setting int operand.\n"),
1814 frv_cgen_set_vma_operand (cd
, opindex
, fields
, value
)
1815 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1817 CGEN_FIELDS
* fields
;
1822 case FRV_OPERAND_A
:
1823 fields
->f_A
= value
;
1825 case FRV_OPERAND_ACC40SI
:
1826 fields
->f_ACC40Si
= value
;
1828 case FRV_OPERAND_ACC40SK
:
1829 fields
->f_ACC40Sk
= value
;
1831 case FRV_OPERAND_ACC40UI
:
1832 fields
->f_ACC40Ui
= value
;
1834 case FRV_OPERAND_ACC40UK
:
1835 fields
->f_ACC40Uk
= value
;
1837 case FRV_OPERAND_ACCGI
:
1838 fields
->f_ACCGi
= value
;
1840 case FRV_OPERAND_ACCGK
:
1841 fields
->f_ACCGk
= value
;
1843 case FRV_OPERAND_CCI
:
1844 fields
->f_CCi
= value
;
1846 case FRV_OPERAND_CPRDOUBLEK
:
1847 fields
->f_CPRk
= value
;
1849 case FRV_OPERAND_CPRI
:
1850 fields
->f_CPRi
= value
;
1852 case FRV_OPERAND_CPRJ
:
1853 fields
->f_CPRj
= value
;
1855 case FRV_OPERAND_CPRK
:
1856 fields
->f_CPRk
= value
;
1858 case FRV_OPERAND_CRI
:
1859 fields
->f_CRi
= value
;
1861 case FRV_OPERAND_CRJ
:
1862 fields
->f_CRj
= value
;
1864 case FRV_OPERAND_CRJ_FLOAT
:
1865 fields
->f_CRj_float
= value
;
1867 case FRV_OPERAND_CRJ_INT
:
1868 fields
->f_CRj_int
= value
;
1870 case FRV_OPERAND_CRK
:
1871 fields
->f_CRk
= value
;
1873 case FRV_OPERAND_FCCI_1
:
1874 fields
->f_FCCi_1
= value
;
1876 case FRV_OPERAND_FCCI_2
:
1877 fields
->f_FCCi_2
= value
;
1879 case FRV_OPERAND_FCCI_3
:
1880 fields
->f_FCCi_3
= value
;
1882 case FRV_OPERAND_FCCK
:
1883 fields
->f_FCCk
= value
;
1885 case FRV_OPERAND_FRDOUBLEI
:
1886 fields
->f_FRi
= value
;
1888 case FRV_OPERAND_FRDOUBLEJ
:
1889 fields
->f_FRj
= value
;
1891 case FRV_OPERAND_FRDOUBLEK
:
1892 fields
->f_FRk
= value
;
1894 case FRV_OPERAND_FRI
:
1895 fields
->f_FRi
= value
;
1897 case FRV_OPERAND_FRINTI
:
1898 fields
->f_FRi
= value
;
1900 case FRV_OPERAND_FRINTJ
:
1901 fields
->f_FRj
= value
;
1903 case FRV_OPERAND_FRINTK
:
1904 fields
->f_FRk
= value
;
1906 case FRV_OPERAND_FRJ
:
1907 fields
->f_FRj
= value
;
1909 case FRV_OPERAND_FRK
:
1910 fields
->f_FRk
= value
;
1912 case FRV_OPERAND_FRKHI
:
1913 fields
->f_FRk
= value
;
1915 case FRV_OPERAND_FRKLO
:
1916 fields
->f_FRk
= value
;
1918 case FRV_OPERAND_GRDOUBLEK
:
1919 fields
->f_GRk
= value
;
1921 case FRV_OPERAND_GRI
:
1922 fields
->f_GRi
= value
;
1924 case FRV_OPERAND_GRJ
:
1925 fields
->f_GRj
= value
;
1927 case FRV_OPERAND_GRK
:
1928 fields
->f_GRk
= value
;
1930 case FRV_OPERAND_GRKHI
:
1931 fields
->f_GRk
= value
;
1933 case FRV_OPERAND_GRKLO
:
1934 fields
->f_GRk
= value
;
1936 case FRV_OPERAND_ICCI_1
:
1937 fields
->f_ICCi_1
= value
;
1939 case FRV_OPERAND_ICCI_2
:
1940 fields
->f_ICCi_2
= value
;
1942 case FRV_OPERAND_ICCI_3
:
1943 fields
->f_ICCi_3
= value
;
1945 case FRV_OPERAND_LI
:
1946 fields
->f_LI
= value
;
1948 case FRV_OPERAND_AE
:
1949 fields
->f_ae
= value
;
1951 case FRV_OPERAND_CCOND
:
1952 fields
->f_ccond
= value
;
1954 case FRV_OPERAND_COND
:
1955 fields
->f_cond
= value
;
1957 case FRV_OPERAND_D12
:
1958 fields
->f_d12
= value
;
1960 case FRV_OPERAND_DEBUG
:
1961 fields
->f_debug
= value
;
1963 case FRV_OPERAND_EIR
:
1964 fields
->f_eir
= value
;
1966 case FRV_OPERAND_HINT
:
1967 fields
->f_hint
= value
;
1969 case FRV_OPERAND_HINT_NOT_TAKEN
:
1970 fields
->f_hint
= value
;
1972 case FRV_OPERAND_HINT_TAKEN
:
1973 fields
->f_hint
= value
;
1975 case FRV_OPERAND_LABEL16
:
1976 fields
->f_label16
= value
;
1978 case FRV_OPERAND_LABEL24
:
1979 fields
->f_label24
= value
;
1981 case FRV_OPERAND_LOCK
:
1982 fields
->f_lock
= value
;
1984 case FRV_OPERAND_PACK
:
1985 fields
->f_pack
= value
;
1987 case FRV_OPERAND_S10
:
1988 fields
->f_s10
= value
;
1990 case FRV_OPERAND_S12
:
1991 fields
->f_d12
= value
;
1993 case FRV_OPERAND_S16
:
1994 fields
->f_s16
= value
;
1996 case FRV_OPERAND_S5
:
1997 fields
->f_s5
= value
;
1999 case FRV_OPERAND_S6
:
2000 fields
->f_s6
= value
;
2002 case FRV_OPERAND_S6_1
:
2003 fields
->f_s6_1
= value
;
2005 case FRV_OPERAND_SLO16
:
2006 fields
->f_s16
= value
;
2008 case FRV_OPERAND_SPR
:
2009 fields
->f_spr
= value
;
2011 case FRV_OPERAND_U12
:
2012 fields
->f_u12
= value
;
2014 case FRV_OPERAND_U16
:
2015 fields
->f_u16
= value
;
2017 case FRV_OPERAND_U6
:
2018 fields
->f_u6
= value
;
2020 case FRV_OPERAND_UHI16
:
2021 fields
->f_u16
= value
;
2023 case FRV_OPERAND_ULO16
:
2024 fields
->f_u16
= value
;
2028 /* xgettext:c-format */
2029 fprintf (stderr
, _("Unrecognized field %d while setting vma operand.\n"),
2035 /* Function to call before using the instruction builder tables. */
2038 frv_cgen_init_ibld_table (cd
)
2041 cd
->insert_handlers
= & frv_cgen_insert_handlers
[0];
2042 cd
->extract_handlers
= & frv_cgen_extract_handlers
[0];
2044 cd
->insert_operand
= frv_cgen_insert_operand
;
2045 cd
->extract_operand
= frv_cgen_extract_operand
;
2047 cd
->get_int_operand
= frv_cgen_get_int_operand
;
2048 cd
->set_int_operand
= frv_cgen_set_int_operand
;
2049 cd
->get_vma_operand
= frv_cgen_get_vma_operand
;
2050 cd
->set_vma_operand
= frv_cgen_set_vma_operand
;