1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 /* Instruction building/extraction support for fr30. -*- C -*-
4 THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
5 - the resultant file is machine generated, cgen-ibld.in isn't
7 Copyright (C) 1996-2020 Free Software Foundation, Inc.
9 This file is part of libopcodes.
11 This library is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3, or (at your option)
16 It is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19 License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
25 /* ??? Eventually more and more of this stuff can go to cpu-independent files.
34 #include "fr30-desc.h"
36 #include "cgen/basic-modes.h"
38 #include "safe-ctype.h"
41 #define min(a,b) ((a) < (b) ? (a) : (b))
43 #define max(a,b) ((a) > (b) ? (a) : (b))
45 /* Used by the ifield rtx function. */
46 #define FLD(f) (fields->f)
48 static const char * insert_normal
49 (CGEN_CPU_DESC
, long, unsigned int, unsigned int, unsigned int,
50 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR
);
51 static const char * insert_insn_normal
52 (CGEN_CPU_DESC
, const CGEN_INSN
*,
53 CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
54 static int extract_normal
55 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
,
56 unsigned int, unsigned int, unsigned int, unsigned int,
57 unsigned int, unsigned int, bfd_vma
, long *);
58 static int extract_insn_normal
59 (CGEN_CPU_DESC
, const CGEN_INSN
*, CGEN_EXTRACT_INFO
*,
60 CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
62 static void put_insn_int_value
63 (CGEN_CPU_DESC
, CGEN_INSN_BYTES_PTR
, int, int, CGEN_INSN_INT
);
66 static CGEN_INLINE
void insert_1
67 (CGEN_CPU_DESC
, unsigned long, int, int, int, unsigned char *);
68 static CGEN_INLINE
int fill_cache
69 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, bfd_vma
);
70 static CGEN_INLINE
long extract_1
71 (CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, int, unsigned char *, bfd_vma
);
74 /* Operand insertion. */
78 /* Subroutine of insert_normal. */
80 static CGEN_INLINE
void
81 insert_1 (CGEN_CPU_DESC cd
,
91 x
= cgen_get_insn_value (cd
, bufp
, word_length
, cd
->endian
);
93 /* Written this way to avoid undefined behaviour. */
94 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
96 shift
= (start
+ 1) - length
;
98 shift
= (word_length
- (start
+ length
));
99 x
= (x
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
101 cgen_put_insn_value (cd
, bufp
, word_length
, (bfd_vma
) x
, cd
->endian
);
104 #endif /* ! CGEN_INT_INSN_P */
106 /* Default insertion routine.
108 ATTRS is a mask of the boolean attributes.
109 WORD_OFFSET is the offset in bits from the start of the insn of the value.
110 WORD_LENGTH is the length of the word in bits in which the value resides.
111 START is the starting bit number in the word, architecture origin.
112 LENGTH is the length of VALUE in bits.
113 TOTAL_LENGTH is the total length of the insn in bits.
115 The result is an error message or NULL if success. */
117 /* ??? This duplicates functionality with bfd's howto table and
118 bfd_install_relocation. */
119 /* ??? This doesn't handle bfd_vma's. Create another function when
123 insert_normal (CGEN_CPU_DESC cd
,
126 unsigned int word_offset
,
129 unsigned int word_length
,
130 unsigned int total_length
,
131 CGEN_INSN_BYTES_PTR buffer
)
133 static char errbuf
[100];
134 /* Written this way to avoid undefined behaviour. */
135 unsigned long mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
137 /* If LENGTH is zero, this operand doesn't contribute to the value. */
141 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
144 /* For architectures with insns smaller than the base-insn-bitsize,
145 word_length may be too big. */
146 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
149 && word_length
> total_length
)
150 word_length
= total_length
;
153 /* Ensure VALUE will fit. */
154 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGN_OPT
))
156 long minval
= - (1L << (length
- 1));
157 unsigned long maxval
= mask
;
159 if ((value
> 0 && (unsigned long) value
> maxval
)
162 /* xgettext:c-format */
164 _("operand out of range (%ld not between %ld and %lu)"),
165 value
, minval
, maxval
);
169 else if (! CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
))
171 unsigned long maxval
= mask
;
172 unsigned long val
= (unsigned long) value
;
174 /* For hosts with a word size > 32 check to see if value has been sign
175 extended beyond 32 bits. If so then ignore these higher sign bits
176 as the user is attempting to store a 32-bit signed value into an
177 unsigned 32-bit field which is allowed. */
178 if (sizeof (unsigned long) > 4 && ((value
>> 32) == -1))
183 /* xgettext:c-format */
185 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
192 if (! cgen_signed_overflow_ok_p (cd
))
194 long minval
= - (1L << (length
- 1));
195 long maxval
= (1L << (length
- 1)) - 1;
197 if (value
< minval
|| value
> maxval
)
200 /* xgettext:c-format */
201 (errbuf
, _("operand out of range (%ld not between %ld and %ld)"),
202 value
, minval
, maxval
);
211 int shift_within_word
, shift_to_word
, shift
;
213 /* How to shift the value to BIT0 of the word. */
214 shift_to_word
= total_length
- (word_offset
+ word_length
);
216 /* How to shift the value to the field within the word. */
217 if (CGEN_INSN_LSB0_P
)
218 shift_within_word
= start
+ 1 - length
;
220 shift_within_word
= word_length
- start
- length
;
222 /* The total SHIFT, then mask in the value. */
223 shift
= shift_to_word
+ shift_within_word
;
224 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
227 #else /* ! CGEN_INT_INSN_P */
230 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
232 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
235 #endif /* ! CGEN_INT_INSN_P */
240 /* Default insn builder (insert handler).
241 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
242 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
243 recorded in host byte order, otherwise BUFFER is an array of bytes
244 and the value is recorded in target byte order).
245 The result is an error message or NULL if success. */
248 insert_insn_normal (CGEN_CPU_DESC cd
,
249 const CGEN_INSN
* insn
,
250 CGEN_FIELDS
* fields
,
251 CGEN_INSN_BYTES_PTR buffer
,
254 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
256 const CGEN_SYNTAX_CHAR_TYPE
* syn
;
258 CGEN_INIT_INSERT (cd
);
259 value
= CGEN_INSN_BASE_VALUE (insn
);
261 /* If we're recording insns as numbers (rather than a string of bytes),
262 target byte order handling is deferred until later. */
266 put_insn_int_value (cd
, buffer
, cd
->base_insn_bitsize
,
267 CGEN_FIELDS_BITSIZE (fields
), value
);
271 cgen_put_insn_value (cd
, buffer
, min ((unsigned) cd
->base_insn_bitsize
,
272 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
273 value
, cd
->insn_endian
);
275 #endif /* ! CGEN_INT_INSN_P */
277 /* ??? It would be better to scan the format's fields.
278 Still need to be able to insert a value based on the operand though;
279 e.g. storing a branch displacement that got resolved later.
280 Needs more thought first. */
282 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
286 if (CGEN_SYNTAX_CHAR_P (* syn
))
289 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
299 /* Cover function to store an insn value into an integral insn. Must go here
300 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
303 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
304 CGEN_INSN_BYTES_PTR buf
,
309 /* For architectures with insns smaller than the base-insn-bitsize,
310 length may be too big. */
311 if (length
> insn_length
)
315 int shift
= insn_length
- length
;
316 /* Written this way to avoid undefined behaviour. */
317 CGEN_INSN_INT mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
319 *buf
= (*buf
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
324 /* Operand extraction. */
326 #if ! CGEN_INT_INSN_P
328 /* Subroutine of extract_normal.
329 Ensure sufficient bytes are cached in EX_INFO.
330 OFFSET is the offset in bytes from the start of the insn of the value.
331 BYTES is the length of the needed value.
332 Returns 1 for success, 0 for failure. */
334 static CGEN_INLINE
int
335 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
336 CGEN_EXTRACT_INFO
*ex_info
,
341 /* It's doubtful that the middle part has already been fetched so
342 we don't optimize that case. kiss. */
344 disassemble_info
*info
= (disassemble_info
*) ex_info
->dis_info
;
346 /* First do a quick check. */
347 mask
= (1 << bytes
) - 1;
348 if (((ex_info
->valid
>> offset
) & mask
) == mask
)
351 /* Search for the first byte we need to read. */
352 for (mask
= 1 << offset
; bytes
> 0; --bytes
, ++offset
, mask
<<= 1)
353 if (! (mask
& ex_info
->valid
))
361 status
= (*info
->read_memory_func
)
362 (pc
, ex_info
->insn_bytes
+ offset
, bytes
, info
);
366 (*info
->memory_error_func
) (status
, pc
, info
);
370 ex_info
->valid
|= ((1 << bytes
) - 1) << offset
;
376 /* Subroutine of extract_normal. */
378 static CGEN_INLINE
long
379 extract_1 (CGEN_CPU_DESC cd
,
380 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
385 bfd_vma pc ATTRIBUTE_UNUSED
)
390 x
= cgen_get_insn_value (cd
, bufp
, word_length
, cd
->endian
);
392 if (CGEN_INSN_LSB0_P
)
393 shift
= (start
+ 1) - length
;
395 shift
= (word_length
- (start
+ length
));
399 #endif /* ! CGEN_INT_INSN_P */
401 /* Default extraction routine.
403 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
404 or sometimes less for cases like the m32r where the base insn size is 32
405 but some insns are 16 bits.
406 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
407 but for generality we take a bitmask of all of them.
408 WORD_OFFSET is the offset in bits from the start of the insn of the value.
409 WORD_LENGTH is the length of the word in bits in which the value resides.
410 START is the starting bit number in the word, architecture origin.
411 LENGTH is the length of VALUE in bits.
412 TOTAL_LENGTH is the total length of the insn in bits.
414 Returns 1 for success, 0 for failure. */
416 /* ??? The return code isn't properly used. wip. */
418 /* ??? This doesn't handle bfd_vma's. Create another function when
422 extract_normal (CGEN_CPU_DESC cd
,
423 #if ! CGEN_INT_INSN_P
424 CGEN_EXTRACT_INFO
*ex_info
,
426 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
428 CGEN_INSN_INT insn_value
,
430 unsigned int word_offset
,
433 unsigned int word_length
,
434 unsigned int total_length
,
435 #if ! CGEN_INT_INSN_P
438 bfd_vma pc ATTRIBUTE_UNUSED
,
444 /* If LENGTH is zero, this operand doesn't contribute to the value
445 so give it a standard value of zero. */
452 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
455 /* For architectures with insns smaller than the insn-base-bitsize,
456 word_length may be too big. */
457 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
459 if (word_offset
+ word_length
> total_length
)
460 word_length
= total_length
- word_offset
;
463 /* Does the value reside in INSN_VALUE, and at the right alignment? */
465 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
467 if (CGEN_INSN_LSB0_P
)
468 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
470 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
473 #if ! CGEN_INT_INSN_P
477 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
479 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
482 if (fill_cache (cd
, ex_info
, word_offset
/ 8, word_length
/ 8, pc
) == 0)
488 value
= extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
);
491 #endif /* ! CGEN_INT_INSN_P */
493 /* Written this way to avoid undefined behaviour. */
494 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
498 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
499 && (value
& (1L << (length
- 1))))
507 /* Default insn extractor.
509 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
510 The extracted fields are stored in FIELDS.
511 EX_INFO is used to handle reading variable length insns.
512 Return the length of the insn in bits, or 0 if no match,
513 or -1 if an error occurs fetching data (memory_error_func will have
517 extract_insn_normal (CGEN_CPU_DESC cd
,
518 const CGEN_INSN
*insn
,
519 CGEN_EXTRACT_INFO
*ex_info
,
520 CGEN_INSN_INT insn_value
,
524 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
525 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
527 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
529 CGEN_INIT_EXTRACT (cd
);
531 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
535 if (CGEN_SYNTAX_CHAR_P (*syn
))
538 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
539 ex_info
, insn_value
, fields
, pc
);
544 /* We recognized and successfully extracted this insn. */
545 return CGEN_INSN_BITSIZE (insn
);
548 /* Machine generated code added here. */
550 const char * fr30_cgen_insert_operand
551 (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
553 /* Main entry point for operand insertion.
555 This function is basically just a big switch statement. Earlier versions
556 used tables to look up the function to use, but
557 - if the table contains both assembler and disassembler functions then
558 the disassembler contains much of the assembler and vice-versa,
559 - there's a lot of inlining possibilities as things grow,
560 - using a switch statement avoids the function call overhead.
562 This function could be moved into `parse_insn_normal', but keeping it
563 separate makes clear the interface between `parse_insn_normal' and each of
564 the handlers. It's also needed by GAS to insert operands that couldn't be
565 resolved during parsing. */
568 fr30_cgen_insert_operand (CGEN_CPU_DESC cd
,
570 CGEN_FIELDS
* fields
,
571 CGEN_INSN_BYTES_PTR buffer
,
572 bfd_vma pc ATTRIBUTE_UNUSED
)
574 const char * errmsg
= NULL
;
575 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
579 case FR30_OPERAND_CRI
:
580 errmsg
= insert_normal (cd
, fields
->f_CRi
, 0, 16, 12, 4, 16, total_length
, buffer
);
582 case FR30_OPERAND_CRJ
:
583 errmsg
= insert_normal (cd
, fields
->f_CRj
, 0, 16, 8, 4, 16, total_length
, buffer
);
585 case FR30_OPERAND_R13
:
587 case FR30_OPERAND_R14
:
589 case FR30_OPERAND_R15
:
591 case FR30_OPERAND_RI
:
592 errmsg
= insert_normal (cd
, fields
->f_Ri
, 0, 0, 12, 4, 16, total_length
, buffer
);
594 case FR30_OPERAND_RIC
:
595 errmsg
= insert_normal (cd
, fields
->f_Ric
, 0, 16, 12, 4, 16, total_length
, buffer
);
597 case FR30_OPERAND_RJ
:
598 errmsg
= insert_normal (cd
, fields
->f_Rj
, 0, 0, 8, 4, 16, total_length
, buffer
);
600 case FR30_OPERAND_RJC
:
601 errmsg
= insert_normal (cd
, fields
->f_Rjc
, 0, 16, 8, 4, 16, total_length
, buffer
);
603 case FR30_OPERAND_RS1
:
604 errmsg
= insert_normal (cd
, fields
->f_Rs1
, 0, 0, 8, 4, 16, total_length
, buffer
);
606 case FR30_OPERAND_RS2
:
607 errmsg
= insert_normal (cd
, fields
->f_Rs2
, 0, 0, 12, 4, 16, total_length
, buffer
);
609 case FR30_OPERAND_CC
:
610 errmsg
= insert_normal (cd
, fields
->f_cc
, 0, 0, 4, 4, 16, total_length
, buffer
);
612 case FR30_OPERAND_CCC
:
613 errmsg
= insert_normal (cd
, fields
->f_ccc
, 0, 16, 0, 8, 16, total_length
, buffer
);
615 case FR30_OPERAND_DIR10
:
617 long value
= fields
->f_dir10
;
618 value
= ((USI
) (value
) >> (2));
619 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
622 case FR30_OPERAND_DIR8
:
623 errmsg
= insert_normal (cd
, fields
->f_dir8
, 0, 0, 8, 8, 16, total_length
, buffer
);
625 case FR30_OPERAND_DIR9
:
627 long value
= fields
->f_dir9
;
628 value
= ((USI
) (value
) >> (1));
629 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
632 case FR30_OPERAND_DISP10
:
634 long value
= fields
->f_disp10
;
635 value
= ((SI
) (value
) >> (2));
636 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
639 case FR30_OPERAND_DISP8
:
640 errmsg
= insert_normal (cd
, fields
->f_disp8
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
642 case FR30_OPERAND_DISP9
:
644 long value
= fields
->f_disp9
;
645 value
= ((SI
) (value
) >> (1));
646 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
649 case FR30_OPERAND_I20
:
652 FLD (f_i20_4
) = ((UINT
) (FLD (f_i20
)) >> (16));
653 FLD (f_i20_16
) = ((FLD (f_i20
)) & (65535));
655 errmsg
= insert_normal (cd
, fields
->f_i20_4
, 0, 0, 8, 4, 16, total_length
, buffer
);
658 errmsg
= insert_normal (cd
, fields
->f_i20_16
, 0, 16, 0, 16, 16, total_length
, buffer
);
663 case FR30_OPERAND_I32
:
664 errmsg
= insert_normal (cd
, fields
->f_i32
, 0|(1<<CGEN_IFLD_SIGN_OPT
), 16, 0, 32, 32, total_length
, buffer
);
666 case FR30_OPERAND_I8
:
667 errmsg
= insert_normal (cd
, fields
->f_i8
, 0, 0, 4, 8, 16, total_length
, buffer
);
669 case FR30_OPERAND_LABEL12
:
671 long value
= fields
->f_rel12
;
672 value
= ((SI
) (((value
) - (((pc
) + (2))))) >> (1));
673 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 5, 11, 16, total_length
, buffer
);
676 case FR30_OPERAND_LABEL9
:
678 long value
= fields
->f_rel9
;
679 value
= ((SI
) (((value
) - (((pc
) + (2))))) >> (1));
680 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 8, 8, 16, total_length
, buffer
);
683 case FR30_OPERAND_M4
:
685 long value
= fields
->f_m4
;
686 value
= ((value
) & (15));
687 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 4, 16, total_length
, buffer
);
690 case FR30_OPERAND_PS
:
692 case FR30_OPERAND_REGLIST_HI_LD
:
693 errmsg
= insert_normal (cd
, fields
->f_reglist_hi_ld
, 0, 0, 8, 8, 16, total_length
, buffer
);
695 case FR30_OPERAND_REGLIST_HI_ST
:
696 errmsg
= insert_normal (cd
, fields
->f_reglist_hi_st
, 0, 0, 8, 8, 16, total_length
, buffer
);
698 case FR30_OPERAND_REGLIST_LOW_LD
:
699 errmsg
= insert_normal (cd
, fields
->f_reglist_low_ld
, 0, 0, 8, 8, 16, total_length
, buffer
);
701 case FR30_OPERAND_REGLIST_LOW_ST
:
702 errmsg
= insert_normal (cd
, fields
->f_reglist_low_st
, 0, 0, 8, 8, 16, total_length
, buffer
);
704 case FR30_OPERAND_S10
:
706 long value
= fields
->f_s10
;
707 value
= ((SI
) (value
) >> (2));
708 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 8, 8, 16, total_length
, buffer
);
711 case FR30_OPERAND_U10
:
713 long value
= fields
->f_u10
;
714 value
= ((USI
) (value
) >> (2));
715 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
718 case FR30_OPERAND_U4
:
719 errmsg
= insert_normal (cd
, fields
->f_u4
, 0, 0, 8, 4, 16, total_length
, buffer
);
721 case FR30_OPERAND_U4C
:
722 errmsg
= insert_normal (cd
, fields
->f_u4c
, 0, 0, 12, 4, 16, total_length
, buffer
);
724 case FR30_OPERAND_U8
:
725 errmsg
= insert_normal (cd
, fields
->f_u8
, 0, 0, 8, 8, 16, total_length
, buffer
);
727 case FR30_OPERAND_UDISP6
:
729 long value
= fields
->f_udisp6
;
730 value
= ((USI
) (value
) >> (2));
731 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 4, 16, total_length
, buffer
);
736 /* xgettext:c-format */
737 opcodes_error_handler
738 (_("internal error: unrecognized field %d while building insn"),
746 int fr30_cgen_extract_operand
747 (CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
749 /* Main entry point for operand extraction.
750 The result is <= 0 for error, >0 for success.
751 ??? Actual values aren't well defined right now.
753 This function is basically just a big switch statement. Earlier versions
754 used tables to look up the function to use, but
755 - if the table contains both assembler and disassembler functions then
756 the disassembler contains much of the assembler and vice-versa,
757 - there's a lot of inlining possibilities as things grow,
758 - using a switch statement avoids the function call overhead.
760 This function could be moved into `print_insn_normal', but keeping it
761 separate makes clear the interface between `print_insn_normal' and each of
765 fr30_cgen_extract_operand (CGEN_CPU_DESC cd
,
767 CGEN_EXTRACT_INFO
*ex_info
,
768 CGEN_INSN_INT insn_value
,
769 CGEN_FIELDS
* fields
,
772 /* Assume success (for those operands that are nops). */
774 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
778 case FR30_OPERAND_CRI
:
779 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 12, 4, 16, total_length
, pc
, & fields
->f_CRi
);
781 case FR30_OPERAND_CRJ
:
782 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 8, 4, 16, total_length
, pc
, & fields
->f_CRj
);
784 case FR30_OPERAND_R13
:
786 case FR30_OPERAND_R14
:
788 case FR30_OPERAND_R15
:
790 case FR30_OPERAND_RI
:
791 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_Ri
);
793 case FR30_OPERAND_RIC
:
794 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 12, 4, 16, total_length
, pc
, & fields
->f_Ric
);
796 case FR30_OPERAND_RJ
:
797 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_Rj
);
799 case FR30_OPERAND_RJC
:
800 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 8, 4, 16, total_length
, pc
, & fields
->f_Rjc
);
802 case FR30_OPERAND_RS1
:
803 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_Rs1
);
805 case FR30_OPERAND_RS2
:
806 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_Rs2
);
808 case FR30_OPERAND_CC
:
809 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 4, 16, total_length
, pc
, & fields
->f_cc
);
811 case FR30_OPERAND_CCC
:
812 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 0, 8, 16, total_length
, pc
, & fields
->f_ccc
);
814 case FR30_OPERAND_DIR10
:
817 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
818 value
= ((value
) << (2));
819 fields
->f_dir10
= value
;
822 case FR30_OPERAND_DIR8
:
823 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_dir8
);
825 case FR30_OPERAND_DIR9
:
828 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
829 value
= ((value
) << (1));
830 fields
->f_dir9
= value
;
833 case FR30_OPERAND_DISP10
:
836 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & value
);
837 value
= ((value
) * (4));
838 fields
->f_disp10
= value
;
841 case FR30_OPERAND_DISP8
:
842 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & fields
->f_disp8
);
844 case FR30_OPERAND_DISP9
:
847 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & value
);
848 value
= ((value
) * (2));
849 fields
->f_disp9
= value
;
852 case FR30_OPERAND_I20
:
854 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_i20_4
);
855 if (length
<= 0) break;
856 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 0, 16, 16, total_length
, pc
, & fields
->f_i20_16
);
857 if (length
<= 0) break;
859 FLD (f_i20
) = ((((FLD (f_i20_4
)) << (16))) | (FLD (f_i20_16
)));
863 case FR30_OPERAND_I32
:
864 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGN_OPT
), 16, 0, 32, 32, total_length
, pc
, & fields
->f_i32
);
866 case FR30_OPERAND_I8
:
867 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 8, 16, total_length
, pc
, & fields
->f_i8
);
869 case FR30_OPERAND_LABEL12
:
872 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 5, 11, 16, total_length
, pc
, & value
);
873 value
= ((((value
) * (2))) + (((pc
) + (2))));
874 fields
->f_rel12
= value
;
877 case FR30_OPERAND_LABEL9
:
880 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 8, 8, 16, total_length
, pc
, & value
);
881 value
= ((((value
) * (2))) + (((pc
) + (2))));
882 fields
->f_rel9
= value
;
885 case FR30_OPERAND_M4
:
888 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & value
);
889 value
= ((value
) | (-16));
890 fields
->f_m4
= value
;
893 case FR30_OPERAND_PS
:
895 case FR30_OPERAND_REGLIST_HI_LD
:
896 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_hi_ld
);
898 case FR30_OPERAND_REGLIST_HI_ST
:
899 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_hi_st
);
901 case FR30_OPERAND_REGLIST_LOW_LD
:
902 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_low_ld
);
904 case FR30_OPERAND_REGLIST_LOW_ST
:
905 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_low_st
);
907 case FR30_OPERAND_S10
:
910 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 8, 8, 16, total_length
, pc
, & value
);
911 value
= ((value
) * (4));
912 fields
->f_s10
= value
;
915 case FR30_OPERAND_U10
:
918 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
919 value
= ((value
) << (2));
920 fields
->f_u10
= value
;
923 case FR30_OPERAND_U4
:
924 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_u4
);
926 case FR30_OPERAND_U4C
:
927 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_u4c
);
929 case FR30_OPERAND_U8
:
930 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_u8
);
932 case FR30_OPERAND_UDISP6
:
935 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & value
);
936 value
= ((value
) << (2));
937 fields
->f_udisp6
= value
;
942 /* xgettext:c-format */
943 opcodes_error_handler
944 (_("internal error: unrecognized field %d while decoding insn"),
952 cgen_insert_fn
* const fr30_cgen_insert_handlers
[] =
957 cgen_extract_fn
* const fr30_cgen_extract_handlers
[] =
962 int fr30_cgen_get_int_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
963 bfd_vma
fr30_cgen_get_vma_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
965 /* Getting values from cgen_fields is handled by a collection of functions.
966 They are distinguished by the type of the VALUE argument they return.
967 TODO: floating point, inlining support, remove cases where result type
971 fr30_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
973 const CGEN_FIELDS
* fields
)
979 case FR30_OPERAND_CRI
:
980 value
= fields
->f_CRi
;
982 case FR30_OPERAND_CRJ
:
983 value
= fields
->f_CRj
;
985 case FR30_OPERAND_R13
:
988 case FR30_OPERAND_R14
:
991 case FR30_OPERAND_R15
:
994 case FR30_OPERAND_RI
:
995 value
= fields
->f_Ri
;
997 case FR30_OPERAND_RIC
:
998 value
= fields
->f_Ric
;
1000 case FR30_OPERAND_RJ
:
1001 value
= fields
->f_Rj
;
1003 case FR30_OPERAND_RJC
:
1004 value
= fields
->f_Rjc
;
1006 case FR30_OPERAND_RS1
:
1007 value
= fields
->f_Rs1
;
1009 case FR30_OPERAND_RS2
:
1010 value
= fields
->f_Rs2
;
1012 case FR30_OPERAND_CC
:
1013 value
= fields
->f_cc
;
1015 case FR30_OPERAND_CCC
:
1016 value
= fields
->f_ccc
;
1018 case FR30_OPERAND_DIR10
:
1019 value
= fields
->f_dir10
;
1021 case FR30_OPERAND_DIR8
:
1022 value
= fields
->f_dir8
;
1024 case FR30_OPERAND_DIR9
:
1025 value
= fields
->f_dir9
;
1027 case FR30_OPERAND_DISP10
:
1028 value
= fields
->f_disp10
;
1030 case FR30_OPERAND_DISP8
:
1031 value
= fields
->f_disp8
;
1033 case FR30_OPERAND_DISP9
:
1034 value
= fields
->f_disp9
;
1036 case FR30_OPERAND_I20
:
1037 value
= fields
->f_i20
;
1039 case FR30_OPERAND_I32
:
1040 value
= fields
->f_i32
;
1042 case FR30_OPERAND_I8
:
1043 value
= fields
->f_i8
;
1045 case FR30_OPERAND_LABEL12
:
1046 value
= fields
->f_rel12
;
1048 case FR30_OPERAND_LABEL9
:
1049 value
= fields
->f_rel9
;
1051 case FR30_OPERAND_M4
:
1052 value
= fields
->f_m4
;
1054 case FR30_OPERAND_PS
:
1057 case FR30_OPERAND_REGLIST_HI_LD
:
1058 value
= fields
->f_reglist_hi_ld
;
1060 case FR30_OPERAND_REGLIST_HI_ST
:
1061 value
= fields
->f_reglist_hi_st
;
1063 case FR30_OPERAND_REGLIST_LOW_LD
:
1064 value
= fields
->f_reglist_low_ld
;
1066 case FR30_OPERAND_REGLIST_LOW_ST
:
1067 value
= fields
->f_reglist_low_st
;
1069 case FR30_OPERAND_S10
:
1070 value
= fields
->f_s10
;
1072 case FR30_OPERAND_U10
:
1073 value
= fields
->f_u10
;
1075 case FR30_OPERAND_U4
:
1076 value
= fields
->f_u4
;
1078 case FR30_OPERAND_U4C
:
1079 value
= fields
->f_u4c
;
1081 case FR30_OPERAND_U8
:
1082 value
= fields
->f_u8
;
1084 case FR30_OPERAND_UDISP6
:
1085 value
= fields
->f_udisp6
;
1089 /* xgettext:c-format */
1090 opcodes_error_handler
1091 (_("internal error: unrecognized field %d while getting int operand"),
1100 fr30_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1102 const CGEN_FIELDS
* fields
)
1108 case FR30_OPERAND_CRI
:
1109 value
= fields
->f_CRi
;
1111 case FR30_OPERAND_CRJ
:
1112 value
= fields
->f_CRj
;
1114 case FR30_OPERAND_R13
:
1117 case FR30_OPERAND_R14
:
1120 case FR30_OPERAND_R15
:
1123 case FR30_OPERAND_RI
:
1124 value
= fields
->f_Ri
;
1126 case FR30_OPERAND_RIC
:
1127 value
= fields
->f_Ric
;
1129 case FR30_OPERAND_RJ
:
1130 value
= fields
->f_Rj
;
1132 case FR30_OPERAND_RJC
:
1133 value
= fields
->f_Rjc
;
1135 case FR30_OPERAND_RS1
:
1136 value
= fields
->f_Rs1
;
1138 case FR30_OPERAND_RS2
:
1139 value
= fields
->f_Rs2
;
1141 case FR30_OPERAND_CC
:
1142 value
= fields
->f_cc
;
1144 case FR30_OPERAND_CCC
:
1145 value
= fields
->f_ccc
;
1147 case FR30_OPERAND_DIR10
:
1148 value
= fields
->f_dir10
;
1150 case FR30_OPERAND_DIR8
:
1151 value
= fields
->f_dir8
;
1153 case FR30_OPERAND_DIR9
:
1154 value
= fields
->f_dir9
;
1156 case FR30_OPERAND_DISP10
:
1157 value
= fields
->f_disp10
;
1159 case FR30_OPERAND_DISP8
:
1160 value
= fields
->f_disp8
;
1162 case FR30_OPERAND_DISP9
:
1163 value
= fields
->f_disp9
;
1165 case FR30_OPERAND_I20
:
1166 value
= fields
->f_i20
;
1168 case FR30_OPERAND_I32
:
1169 value
= fields
->f_i32
;
1171 case FR30_OPERAND_I8
:
1172 value
= fields
->f_i8
;
1174 case FR30_OPERAND_LABEL12
:
1175 value
= fields
->f_rel12
;
1177 case FR30_OPERAND_LABEL9
:
1178 value
= fields
->f_rel9
;
1180 case FR30_OPERAND_M4
:
1181 value
= fields
->f_m4
;
1183 case FR30_OPERAND_PS
:
1186 case FR30_OPERAND_REGLIST_HI_LD
:
1187 value
= fields
->f_reglist_hi_ld
;
1189 case FR30_OPERAND_REGLIST_HI_ST
:
1190 value
= fields
->f_reglist_hi_st
;
1192 case FR30_OPERAND_REGLIST_LOW_LD
:
1193 value
= fields
->f_reglist_low_ld
;
1195 case FR30_OPERAND_REGLIST_LOW_ST
:
1196 value
= fields
->f_reglist_low_st
;
1198 case FR30_OPERAND_S10
:
1199 value
= fields
->f_s10
;
1201 case FR30_OPERAND_U10
:
1202 value
= fields
->f_u10
;
1204 case FR30_OPERAND_U4
:
1205 value
= fields
->f_u4
;
1207 case FR30_OPERAND_U4C
:
1208 value
= fields
->f_u4c
;
1210 case FR30_OPERAND_U8
:
1211 value
= fields
->f_u8
;
1213 case FR30_OPERAND_UDISP6
:
1214 value
= fields
->f_udisp6
;
1218 /* xgettext:c-format */
1219 opcodes_error_handler
1220 (_("internal error: unrecognized field %d while getting vma operand"),
1228 void fr30_cgen_set_int_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int);
1229 void fr30_cgen_set_vma_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
);
1231 /* Stuffing values in cgen_fields is handled by a collection of functions.
1232 They are distinguished by the type of the VALUE argument they accept.
1233 TODO: floating point, inlining support, remove cases where argument type
1237 fr30_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1239 CGEN_FIELDS
* fields
,
1244 case FR30_OPERAND_CRI
:
1245 fields
->f_CRi
= value
;
1247 case FR30_OPERAND_CRJ
:
1248 fields
->f_CRj
= value
;
1250 case FR30_OPERAND_R13
:
1252 case FR30_OPERAND_R14
:
1254 case FR30_OPERAND_R15
:
1256 case FR30_OPERAND_RI
:
1257 fields
->f_Ri
= value
;
1259 case FR30_OPERAND_RIC
:
1260 fields
->f_Ric
= value
;
1262 case FR30_OPERAND_RJ
:
1263 fields
->f_Rj
= value
;
1265 case FR30_OPERAND_RJC
:
1266 fields
->f_Rjc
= value
;
1268 case FR30_OPERAND_RS1
:
1269 fields
->f_Rs1
= value
;
1271 case FR30_OPERAND_RS2
:
1272 fields
->f_Rs2
= value
;
1274 case FR30_OPERAND_CC
:
1275 fields
->f_cc
= value
;
1277 case FR30_OPERAND_CCC
:
1278 fields
->f_ccc
= value
;
1280 case FR30_OPERAND_DIR10
:
1281 fields
->f_dir10
= value
;
1283 case FR30_OPERAND_DIR8
:
1284 fields
->f_dir8
= value
;
1286 case FR30_OPERAND_DIR9
:
1287 fields
->f_dir9
= value
;
1289 case FR30_OPERAND_DISP10
:
1290 fields
->f_disp10
= value
;
1292 case FR30_OPERAND_DISP8
:
1293 fields
->f_disp8
= value
;
1295 case FR30_OPERAND_DISP9
:
1296 fields
->f_disp9
= value
;
1298 case FR30_OPERAND_I20
:
1299 fields
->f_i20
= value
;
1301 case FR30_OPERAND_I32
:
1302 fields
->f_i32
= value
;
1304 case FR30_OPERAND_I8
:
1305 fields
->f_i8
= value
;
1307 case FR30_OPERAND_LABEL12
:
1308 fields
->f_rel12
= value
;
1310 case FR30_OPERAND_LABEL9
:
1311 fields
->f_rel9
= value
;
1313 case FR30_OPERAND_M4
:
1314 fields
->f_m4
= value
;
1316 case FR30_OPERAND_PS
:
1318 case FR30_OPERAND_REGLIST_HI_LD
:
1319 fields
->f_reglist_hi_ld
= value
;
1321 case FR30_OPERAND_REGLIST_HI_ST
:
1322 fields
->f_reglist_hi_st
= value
;
1324 case FR30_OPERAND_REGLIST_LOW_LD
:
1325 fields
->f_reglist_low_ld
= value
;
1327 case FR30_OPERAND_REGLIST_LOW_ST
:
1328 fields
->f_reglist_low_st
= value
;
1330 case FR30_OPERAND_S10
:
1331 fields
->f_s10
= value
;
1333 case FR30_OPERAND_U10
:
1334 fields
->f_u10
= value
;
1336 case FR30_OPERAND_U4
:
1337 fields
->f_u4
= value
;
1339 case FR30_OPERAND_U4C
:
1340 fields
->f_u4c
= value
;
1342 case FR30_OPERAND_U8
:
1343 fields
->f_u8
= value
;
1345 case FR30_OPERAND_UDISP6
:
1346 fields
->f_udisp6
= value
;
1350 /* xgettext:c-format */
1351 opcodes_error_handler
1352 (_("internal error: unrecognized field %d while setting int operand"),
1359 fr30_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1361 CGEN_FIELDS
* fields
,
1366 case FR30_OPERAND_CRI
:
1367 fields
->f_CRi
= value
;
1369 case FR30_OPERAND_CRJ
:
1370 fields
->f_CRj
= value
;
1372 case FR30_OPERAND_R13
:
1374 case FR30_OPERAND_R14
:
1376 case FR30_OPERAND_R15
:
1378 case FR30_OPERAND_RI
:
1379 fields
->f_Ri
= value
;
1381 case FR30_OPERAND_RIC
:
1382 fields
->f_Ric
= value
;
1384 case FR30_OPERAND_RJ
:
1385 fields
->f_Rj
= value
;
1387 case FR30_OPERAND_RJC
:
1388 fields
->f_Rjc
= value
;
1390 case FR30_OPERAND_RS1
:
1391 fields
->f_Rs1
= value
;
1393 case FR30_OPERAND_RS2
:
1394 fields
->f_Rs2
= value
;
1396 case FR30_OPERAND_CC
:
1397 fields
->f_cc
= value
;
1399 case FR30_OPERAND_CCC
:
1400 fields
->f_ccc
= value
;
1402 case FR30_OPERAND_DIR10
:
1403 fields
->f_dir10
= value
;
1405 case FR30_OPERAND_DIR8
:
1406 fields
->f_dir8
= value
;
1408 case FR30_OPERAND_DIR9
:
1409 fields
->f_dir9
= value
;
1411 case FR30_OPERAND_DISP10
:
1412 fields
->f_disp10
= value
;
1414 case FR30_OPERAND_DISP8
:
1415 fields
->f_disp8
= value
;
1417 case FR30_OPERAND_DISP9
:
1418 fields
->f_disp9
= value
;
1420 case FR30_OPERAND_I20
:
1421 fields
->f_i20
= value
;
1423 case FR30_OPERAND_I32
:
1424 fields
->f_i32
= value
;
1426 case FR30_OPERAND_I8
:
1427 fields
->f_i8
= value
;
1429 case FR30_OPERAND_LABEL12
:
1430 fields
->f_rel12
= value
;
1432 case FR30_OPERAND_LABEL9
:
1433 fields
->f_rel9
= value
;
1435 case FR30_OPERAND_M4
:
1436 fields
->f_m4
= value
;
1438 case FR30_OPERAND_PS
:
1440 case FR30_OPERAND_REGLIST_HI_LD
:
1441 fields
->f_reglist_hi_ld
= value
;
1443 case FR30_OPERAND_REGLIST_HI_ST
:
1444 fields
->f_reglist_hi_st
= value
;
1446 case FR30_OPERAND_REGLIST_LOW_LD
:
1447 fields
->f_reglist_low_ld
= value
;
1449 case FR30_OPERAND_REGLIST_LOW_ST
:
1450 fields
->f_reglist_low_st
= value
;
1452 case FR30_OPERAND_S10
:
1453 fields
->f_s10
= value
;
1455 case FR30_OPERAND_U10
:
1456 fields
->f_u10
= value
;
1458 case FR30_OPERAND_U4
:
1459 fields
->f_u4
= value
;
1461 case FR30_OPERAND_U4C
:
1462 fields
->f_u4c
= value
;
1464 case FR30_OPERAND_U8
:
1465 fields
->f_u8
= value
;
1467 case FR30_OPERAND_UDISP6
:
1468 fields
->f_udisp6
= value
;
1472 /* xgettext:c-format */
1473 opcodes_error_handler
1474 (_("internal error: unrecognized field %d while setting vma operand"),
1480 /* Function to call before using the instruction builder tables. */
1483 fr30_cgen_init_ibld_table (CGEN_CPU_DESC cd
)
1485 cd
->insert_handlers
= & fr30_cgen_insert_handlers
[0];
1486 cd
->extract_handlers
= & fr30_cgen_extract_handlers
[0];
1488 cd
->insert_operand
= fr30_cgen_insert_operand
;
1489 cd
->extract_operand
= fr30_cgen_extract_operand
;
1491 cd
->get_int_operand
= fr30_cgen_get_int_operand
;
1492 cd
->set_int_operand
= fr30_cgen_set_int_operand
;
1493 cd
->get_vma_operand
= fr30_cgen_get_vma_operand
;
1494 cd
->set_vma_operand
= fr30_cgen_set_vma_operand
;