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-2023 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
,
88 unsigned long x
, mask
;
91 x
= cgen_get_insn_value (cd
, bufp
, word_length
, cd
->endian
);
93 /* Written this way to avoid undefined behaviour. */
94 mask
= (1UL << (length
- 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];
136 /* If LENGTH is zero, this operand doesn't contribute to the value. */
140 /* Written this way to avoid undefined behaviour. */
141 mask
= (1UL << (length
- 1) << 1) - 1;
143 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
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
= - (1UL << (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
;
174 unsigned long val
= (unsigned long) value
;
176 /* For hosts with a word size > 32 check to see if value has been sign
177 extended beyond 32 bits. If so then ignore these higher sign bits
178 as the user is attempting to store a 32-bit signed value into an
179 unsigned 32-bit field which is allowed. */
180 if (sizeof (unsigned long) > 4 && ((value
>> 32) == -1))
185 /* xgettext:c-format */
187 _("operand out of range (0x%lx not between 0 and 0x%lx)"),
194 if (! cgen_signed_overflow_ok_p (cd
))
196 long minval
= - (1UL << (length
- 1));
197 long maxval
= (1UL << (length
- 1)) - 1;
199 if (value
< minval
|| value
> maxval
)
202 /* xgettext:c-format */
203 (errbuf
, _("operand out of range (%ld not between %ld and %ld)"),
204 value
, minval
, maxval
);
213 int shift_within_word
, shift_to_word
, shift
;
215 /* How to shift the value to BIT0 of the word. */
216 shift_to_word
= total_length
- (word_offset
+ word_length
);
218 /* How to shift the value to the field within the word. */
219 if (CGEN_INSN_LSB0_P
)
220 shift_within_word
= start
+ 1 - length
;
222 shift_within_word
= word_length
- start
- length
;
224 /* The total SHIFT, then mask in the value. */
225 shift
= shift_to_word
+ shift_within_word
;
226 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
229 #else /* ! CGEN_INT_INSN_P */
232 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
234 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
237 #endif /* ! CGEN_INT_INSN_P */
242 /* Default insn builder (insert handler).
243 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
244 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
245 recorded in host byte order, otherwise BUFFER is an array of bytes
246 and the value is recorded in target byte order).
247 The result is an error message or NULL if success. */
250 insert_insn_normal (CGEN_CPU_DESC cd
,
251 const CGEN_INSN
* insn
,
252 CGEN_FIELDS
* fields
,
253 CGEN_INSN_BYTES_PTR buffer
,
256 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
258 const CGEN_SYNTAX_CHAR_TYPE
* syn
;
260 CGEN_INIT_INSERT (cd
);
261 value
= CGEN_INSN_BASE_VALUE (insn
);
263 /* If we're recording insns as numbers (rather than a string of bytes),
264 target byte order handling is deferred until later. */
268 put_insn_int_value (cd
, buffer
, cd
->base_insn_bitsize
,
269 CGEN_FIELDS_BITSIZE (fields
), value
);
273 cgen_put_insn_value (cd
, buffer
, min ((unsigned) cd
->base_insn_bitsize
,
274 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
275 value
, cd
->insn_endian
);
277 #endif /* ! CGEN_INT_INSN_P */
279 /* ??? It would be better to scan the format's fields.
280 Still need to be able to insert a value based on the operand though;
281 e.g. storing a branch displacement that got resolved later.
282 Needs more thought first. */
284 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
288 if (CGEN_SYNTAX_CHAR_P (* syn
))
291 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
301 /* Cover function to store an insn value into an integral insn. Must go here
302 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
305 put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
306 CGEN_INSN_BYTES_PTR buf
,
311 /* For architectures with insns smaller than the base-insn-bitsize,
312 length may be too big. */
313 if (length
> insn_length
)
317 int shift
= insn_length
- length
;
318 /* Written this way to avoid undefined behaviour. */
319 CGEN_INSN_INT mask
= length
== 0 ? 0 : (1UL << (length
- 1) << 1) - 1;
321 *buf
= (*buf
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
326 /* Operand extraction. */
328 #if ! CGEN_INT_INSN_P
330 /* Subroutine of extract_normal.
331 Ensure sufficient bytes are cached in EX_INFO.
332 OFFSET is the offset in bytes from the start of the insn of the value.
333 BYTES is the length of the needed value.
334 Returns 1 for success, 0 for failure. */
336 static CGEN_INLINE
int
337 fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
338 CGEN_EXTRACT_INFO
*ex_info
,
343 /* It's doubtful that the middle part has already been fetched so
344 we don't optimize that case. kiss. */
346 disassemble_info
*info
= (disassemble_info
*) ex_info
->dis_info
;
348 /* First do a quick check. */
349 mask
= (1 << bytes
) - 1;
350 if (((ex_info
->valid
>> offset
) & mask
) == mask
)
353 /* Search for the first byte we need to read. */
354 for (mask
= 1 << offset
; bytes
> 0; --bytes
, ++offset
, mask
<<= 1)
355 if (! (mask
& ex_info
->valid
))
363 status
= (*info
->read_memory_func
)
364 (pc
, ex_info
->insn_bytes
+ offset
, bytes
, info
);
368 (*info
->memory_error_func
) (status
, pc
, info
);
372 ex_info
->valid
|= ((1 << bytes
) - 1) << offset
;
378 /* Subroutine of extract_normal. */
380 static CGEN_INLINE
long
381 extract_1 (CGEN_CPU_DESC cd
,
382 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
387 bfd_vma pc ATTRIBUTE_UNUSED
)
392 x
= cgen_get_insn_value (cd
, bufp
, word_length
, cd
->endian
);
394 if (CGEN_INSN_LSB0_P
)
395 shift
= (start
+ 1) - length
;
397 shift
= (word_length
- (start
+ length
));
401 #endif /* ! CGEN_INT_INSN_P */
403 /* Default extraction routine.
405 INSN_VALUE is the first base_insn_bitsize bits of the insn in host order,
406 or sometimes less for cases like the m32r where the base insn size is 32
407 but some insns are 16 bits.
408 ATTRS is a mask of the boolean attributes. We only need `SIGNED',
409 but for generality we take a bitmask of all of them.
410 WORD_OFFSET is the offset in bits from the start of the insn of the value.
411 WORD_LENGTH is the length of the word in bits in which the value resides.
412 START is the starting bit number in the word, architecture origin.
413 LENGTH is the length of VALUE in bits.
414 TOTAL_LENGTH is the total length of the insn in bits.
416 Returns 1 for success, 0 for failure. */
418 /* ??? The return code isn't properly used. wip. */
420 /* ??? This doesn't handle bfd_vma's. Create another function when
424 extract_normal (CGEN_CPU_DESC cd
,
425 #if ! CGEN_INT_INSN_P
426 CGEN_EXTRACT_INFO
*ex_info
,
428 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
,
430 CGEN_INSN_INT insn_value
,
432 unsigned int word_offset
,
435 unsigned int word_length
,
436 unsigned int total_length
,
437 #if ! CGEN_INT_INSN_P
440 bfd_vma pc ATTRIBUTE_UNUSED
,
446 /* If LENGTH is zero, this operand doesn't contribute to the value
447 so give it a standard value of zero. */
454 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
457 /* For architectures with insns smaller than the insn-base-bitsize,
458 word_length may be too big. */
459 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
461 if (word_offset
+ word_length
> total_length
)
462 word_length
= total_length
- word_offset
;
465 /* Does the value reside in INSN_VALUE, and at the right alignment? */
467 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
469 if (CGEN_INSN_LSB0_P
)
470 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
472 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
475 #if ! CGEN_INT_INSN_P
479 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
481 if (word_length
> 8 * sizeof (CGEN_INSN_INT
))
484 if (fill_cache (cd
, ex_info
, word_offset
/ 8, word_length
/ 8, pc
) == 0)
490 value
= extract_1 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
);
493 #endif /* ! CGEN_INT_INSN_P */
495 /* Written this way to avoid undefined behaviour. */
496 mask
= (1UL << (length
- 1) << 1) - 1;
500 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
501 && (value
& (1UL << (length
- 1))))
509 /* Default insn extractor.
511 INSN_VALUE is the first base_insn_bitsize bits, translated to host order.
512 The extracted fields are stored in FIELDS.
513 EX_INFO is used to handle reading variable length insns.
514 Return the length of the insn in bits, or 0 if no match,
515 or -1 if an error occurs fetching data (memory_error_func will have
519 extract_insn_normal (CGEN_CPU_DESC cd
,
520 const CGEN_INSN
*insn
,
521 CGEN_EXTRACT_INFO
*ex_info
,
522 CGEN_INSN_INT insn_value
,
526 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
527 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
529 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
531 CGEN_INIT_EXTRACT (cd
);
533 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
537 if (CGEN_SYNTAX_CHAR_P (*syn
))
540 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
541 ex_info
, insn_value
, fields
, pc
);
546 /* We recognized and successfully extracted this insn. */
547 return CGEN_INSN_BITSIZE (insn
);
550 /* Machine generated code added here. */
552 const char * fr30_cgen_insert_operand
553 (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
);
555 /* Main entry point for operand insertion.
557 This function is basically just a big switch statement. Earlier versions
558 used tables to look up the function to use, but
559 - if the table contains both assembler and disassembler functions then
560 the disassembler contains much of the assembler and vice-versa,
561 - there's a lot of inlining possibilities as things grow,
562 - using a switch statement avoids the function call overhead.
564 This function could be moved into `parse_insn_normal', but keeping it
565 separate makes clear the interface between `parse_insn_normal' and each of
566 the handlers. It's also needed by GAS to insert operands that couldn't be
567 resolved during parsing. */
570 fr30_cgen_insert_operand (CGEN_CPU_DESC cd
,
572 CGEN_FIELDS
* fields
,
573 CGEN_INSN_BYTES_PTR buffer
,
574 bfd_vma pc ATTRIBUTE_UNUSED
)
576 const char * errmsg
= NULL
;
577 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
581 case FR30_OPERAND_CRI
:
582 errmsg
= insert_normal (cd
, fields
->f_CRi
, 0, 16, 12, 4, 16, total_length
, buffer
);
584 case FR30_OPERAND_CRJ
:
585 errmsg
= insert_normal (cd
, fields
->f_CRj
, 0, 16, 8, 4, 16, total_length
, buffer
);
587 case FR30_OPERAND_R13
:
589 case FR30_OPERAND_R14
:
591 case FR30_OPERAND_R15
:
593 case FR30_OPERAND_RI
:
594 errmsg
= insert_normal (cd
, fields
->f_Ri
, 0, 0, 12, 4, 16, total_length
, buffer
);
596 case FR30_OPERAND_RIC
:
597 errmsg
= insert_normal (cd
, fields
->f_Ric
, 0, 16, 12, 4, 16, total_length
, buffer
);
599 case FR30_OPERAND_RJ
:
600 errmsg
= insert_normal (cd
, fields
->f_Rj
, 0, 0, 8, 4, 16, total_length
, buffer
);
602 case FR30_OPERAND_RJC
:
603 errmsg
= insert_normal (cd
, fields
->f_Rjc
, 0, 16, 8, 4, 16, total_length
, buffer
);
605 case FR30_OPERAND_RS1
:
606 errmsg
= insert_normal (cd
, fields
->f_Rs1
, 0, 0, 8, 4, 16, total_length
, buffer
);
608 case FR30_OPERAND_RS2
:
609 errmsg
= insert_normal (cd
, fields
->f_Rs2
, 0, 0, 12, 4, 16, total_length
, buffer
);
611 case FR30_OPERAND_CC
:
612 errmsg
= insert_normal (cd
, fields
->f_cc
, 0, 0, 4, 4, 16, total_length
, buffer
);
614 case FR30_OPERAND_CCC
:
615 errmsg
= insert_normal (cd
, fields
->f_ccc
, 0, 16, 0, 8, 16, total_length
, buffer
);
617 case FR30_OPERAND_DIR10
:
619 long value
= fields
->f_dir10
;
620 value
= ((USI
) (value
) >> (2));
621 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
624 case FR30_OPERAND_DIR8
:
625 errmsg
= insert_normal (cd
, fields
->f_dir8
, 0, 0, 8, 8, 16, total_length
, buffer
);
627 case FR30_OPERAND_DIR9
:
629 long value
= fields
->f_dir9
;
630 value
= ((USI
) (value
) >> (1));
631 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
634 case FR30_OPERAND_DISP10
:
636 long value
= fields
->f_disp10
;
637 value
= ((SI
) (value
) >> (2));
638 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
641 case FR30_OPERAND_DISP8
:
642 errmsg
= insert_normal (cd
, fields
->f_disp8
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
644 case FR30_OPERAND_DISP9
:
646 long value
= fields
->f_disp9
;
647 value
= ((SI
) (value
) >> (1));
648 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, buffer
);
651 case FR30_OPERAND_I20
:
654 FLD (f_i20_4
) = ((UINT
) (FLD (f_i20
)) >> (16));
655 FLD (f_i20_16
) = ((FLD (f_i20
)) & (65535));
657 errmsg
= insert_normal (cd
, fields
->f_i20_4
, 0, 0, 8, 4, 16, total_length
, buffer
);
660 errmsg
= insert_normal (cd
, fields
->f_i20_16
, 0, 16, 0, 16, 16, total_length
, buffer
);
665 case FR30_OPERAND_I32
:
666 errmsg
= insert_normal (cd
, fields
->f_i32
, 0|(1<<CGEN_IFLD_SIGN_OPT
), 16, 0, 32, 32, total_length
, buffer
);
668 case FR30_OPERAND_I8
:
669 errmsg
= insert_normal (cd
, fields
->f_i8
, 0, 0, 4, 8, 16, total_length
, buffer
);
671 case FR30_OPERAND_LABEL12
:
673 long value
= fields
->f_rel12
;
674 value
= ((SI
) (((value
) - (((pc
) + (2))))) >> (1));
675 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 5, 11, 16, total_length
, buffer
);
678 case FR30_OPERAND_LABEL9
:
680 long value
= fields
->f_rel9
;
681 value
= ((SI
) (((value
) - (((pc
) + (2))))) >> (1));
682 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
)|(1<<CGEN_IFLD_PCREL_ADDR
), 0, 8, 8, 16, total_length
, buffer
);
685 case FR30_OPERAND_M4
:
687 long value
= fields
->f_m4
;
688 value
= ((value
) & (15));
689 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 4, 16, total_length
, buffer
);
692 case FR30_OPERAND_PS
:
694 case FR30_OPERAND_REGLIST_HI_LD
:
695 errmsg
= insert_normal (cd
, fields
->f_reglist_hi_ld
, 0, 0, 8, 8, 16, total_length
, buffer
);
697 case FR30_OPERAND_REGLIST_HI_ST
:
698 errmsg
= insert_normal (cd
, fields
->f_reglist_hi_st
, 0, 0, 8, 8, 16, total_length
, buffer
);
700 case FR30_OPERAND_REGLIST_LOW_LD
:
701 errmsg
= insert_normal (cd
, fields
->f_reglist_low_ld
, 0, 0, 8, 8, 16, total_length
, buffer
);
703 case FR30_OPERAND_REGLIST_LOW_ST
:
704 errmsg
= insert_normal (cd
, fields
->f_reglist_low_st
, 0, 0, 8, 8, 16, total_length
, buffer
);
706 case FR30_OPERAND_S10
:
708 long value
= fields
->f_s10
;
709 value
= ((SI
) (value
) >> (2));
710 errmsg
= insert_normal (cd
, value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 8, 8, 16, total_length
, buffer
);
713 case FR30_OPERAND_U10
:
715 long value
= fields
->f_u10
;
716 value
= ((USI
) (value
) >> (2));
717 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 8, 16, total_length
, buffer
);
720 case FR30_OPERAND_U4
:
721 errmsg
= insert_normal (cd
, fields
->f_u4
, 0, 0, 8, 4, 16, total_length
, buffer
);
723 case FR30_OPERAND_U4C
:
724 errmsg
= insert_normal (cd
, fields
->f_u4c
, 0, 0, 12, 4, 16, total_length
, buffer
);
726 case FR30_OPERAND_U8
:
727 errmsg
= insert_normal (cd
, fields
->f_u8
, 0, 0, 8, 8, 16, total_length
, buffer
);
729 case FR30_OPERAND_UDISP6
:
731 long value
= fields
->f_udisp6
;
732 value
= ((USI
) (value
) >> (2));
733 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 4, 16, total_length
, buffer
);
738 /* xgettext:c-format */
739 opcodes_error_handler
740 (_("internal error: unrecognized field %d while building insn"),
748 int fr30_cgen_extract_operand
749 (CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
);
751 /* Main entry point for operand extraction.
752 The result is <= 0 for error, >0 for success.
753 ??? Actual values aren't well defined right now.
755 This function is basically just a big switch statement. Earlier versions
756 used tables to look up the function to use, but
757 - if the table contains both assembler and disassembler functions then
758 the disassembler contains much of the assembler and vice-versa,
759 - there's a lot of inlining possibilities as things grow,
760 - using a switch statement avoids the function call overhead.
762 This function could be moved into `print_insn_normal', but keeping it
763 separate makes clear the interface between `print_insn_normal' and each of
767 fr30_cgen_extract_operand (CGEN_CPU_DESC cd
,
769 CGEN_EXTRACT_INFO
*ex_info
,
770 CGEN_INSN_INT insn_value
,
771 CGEN_FIELDS
* fields
,
774 /* Assume success (for those operands that are nops). */
776 unsigned int total_length
= CGEN_FIELDS_BITSIZE (fields
);
780 case FR30_OPERAND_CRI
:
781 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 12, 4, 16, total_length
, pc
, & fields
->f_CRi
);
783 case FR30_OPERAND_CRJ
:
784 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 8, 4, 16, total_length
, pc
, & fields
->f_CRj
);
786 case FR30_OPERAND_R13
:
788 case FR30_OPERAND_R14
:
790 case FR30_OPERAND_R15
:
792 case FR30_OPERAND_RI
:
793 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_Ri
);
795 case FR30_OPERAND_RIC
:
796 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 12, 4, 16, total_length
, pc
, & fields
->f_Ric
);
798 case FR30_OPERAND_RJ
:
799 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_Rj
);
801 case FR30_OPERAND_RJC
:
802 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 8, 4, 16, total_length
, pc
, & fields
->f_Rjc
);
804 case FR30_OPERAND_RS1
:
805 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_Rs1
);
807 case FR30_OPERAND_RS2
:
808 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_Rs2
);
810 case FR30_OPERAND_CC
:
811 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 4, 16, total_length
, pc
, & fields
->f_cc
);
813 case FR30_OPERAND_CCC
:
814 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 0, 8, 16, total_length
, pc
, & fields
->f_ccc
);
816 case FR30_OPERAND_DIR10
:
819 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
820 value
= ((value
) << (2));
821 fields
->f_dir10
= value
;
824 case FR30_OPERAND_DIR8
:
825 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_dir8
);
827 case FR30_OPERAND_DIR9
:
830 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
831 value
= ((value
) << (1));
832 fields
->f_dir9
= value
;
835 case FR30_OPERAND_DISP10
:
838 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & value
);
839 value
= ((value
) * (4));
840 fields
->f_disp10
= value
;
843 case FR30_OPERAND_DISP8
:
844 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & fields
->f_disp8
);
846 case FR30_OPERAND_DISP9
:
849 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 4, 8, 16, total_length
, pc
, & value
);
850 value
= ((value
) * (2));
851 fields
->f_disp9
= value
;
854 case FR30_OPERAND_I20
:
856 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_i20_4
);
857 if (length
<= 0) break;
858 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 16, 0, 16, 16, total_length
, pc
, & fields
->f_i20_16
);
859 if (length
<= 0) break;
861 FLD (f_i20
) = ((((FLD (f_i20_4
)) << (16))) | (FLD (f_i20_16
)));
865 case FR30_OPERAND_I32
:
866 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGN_OPT
), 16, 0, 32, 32, total_length
, pc
, & fields
->f_i32
);
868 case FR30_OPERAND_I8
:
869 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 4, 8, 16, total_length
, pc
, & fields
->f_i8
);
871 case FR30_OPERAND_LABEL12
:
874 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
);
875 value
= ((((value
) * (2))) + (((pc
) + (2))));
876 fields
->f_rel12
= value
;
879 case FR30_OPERAND_LABEL9
:
882 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
);
883 value
= ((((value
) * (2))) + (((pc
) + (2))));
884 fields
->f_rel9
= value
;
887 case FR30_OPERAND_M4
:
890 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & value
);
891 value
= ((value
) | (-16));
892 fields
->f_m4
= value
;
895 case FR30_OPERAND_PS
:
897 case FR30_OPERAND_REGLIST_HI_LD
:
898 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_hi_ld
);
900 case FR30_OPERAND_REGLIST_HI_ST
:
901 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_hi_st
);
903 case FR30_OPERAND_REGLIST_LOW_LD
:
904 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_low_ld
);
906 case FR30_OPERAND_REGLIST_LOW_ST
:
907 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_reglist_low_st
);
909 case FR30_OPERAND_S10
:
912 length
= extract_normal (cd
, ex_info
, insn_value
, 0|(1<<CGEN_IFLD_SIGNED
), 0, 8, 8, 16, total_length
, pc
, & value
);
913 value
= ((value
) * (4));
914 fields
->f_s10
= value
;
917 case FR30_OPERAND_U10
:
920 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & value
);
921 value
= ((value
) << (2));
922 fields
->f_u10
= value
;
925 case FR30_OPERAND_U4
:
926 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & fields
->f_u4
);
928 case FR30_OPERAND_U4C
:
929 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 12, 4, 16, total_length
, pc
, & fields
->f_u4c
);
931 case FR30_OPERAND_U8
:
932 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 8, 16, total_length
, pc
, & fields
->f_u8
);
934 case FR30_OPERAND_UDISP6
:
937 length
= extract_normal (cd
, ex_info
, insn_value
, 0, 0, 8, 4, 16, total_length
, pc
, & value
);
938 value
= ((value
) << (2));
939 fields
->f_udisp6
= value
;
944 /* xgettext:c-format */
945 opcodes_error_handler
946 (_("internal error: unrecognized field %d while decoding insn"),
954 cgen_insert_fn
* const fr30_cgen_insert_handlers
[] =
959 cgen_extract_fn
* const fr30_cgen_extract_handlers
[] =
964 int fr30_cgen_get_int_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
965 bfd_vma
fr30_cgen_get_vma_operand (CGEN_CPU_DESC
, int, const CGEN_FIELDS
*);
967 /* Getting values from cgen_fields is handled by a collection of functions.
968 They are distinguished by the type of the VALUE argument they return.
969 TODO: floating point, inlining support, remove cases where result type
973 fr30_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
975 const CGEN_FIELDS
* fields
)
981 case FR30_OPERAND_CRI
:
982 value
= fields
->f_CRi
;
984 case FR30_OPERAND_CRJ
:
985 value
= fields
->f_CRj
;
987 case FR30_OPERAND_R13
:
990 case FR30_OPERAND_R14
:
993 case FR30_OPERAND_R15
:
996 case FR30_OPERAND_RI
:
997 value
= fields
->f_Ri
;
999 case FR30_OPERAND_RIC
:
1000 value
= fields
->f_Ric
;
1002 case FR30_OPERAND_RJ
:
1003 value
= fields
->f_Rj
;
1005 case FR30_OPERAND_RJC
:
1006 value
= fields
->f_Rjc
;
1008 case FR30_OPERAND_RS1
:
1009 value
= fields
->f_Rs1
;
1011 case FR30_OPERAND_RS2
:
1012 value
= fields
->f_Rs2
;
1014 case FR30_OPERAND_CC
:
1015 value
= fields
->f_cc
;
1017 case FR30_OPERAND_CCC
:
1018 value
= fields
->f_ccc
;
1020 case FR30_OPERAND_DIR10
:
1021 value
= fields
->f_dir10
;
1023 case FR30_OPERAND_DIR8
:
1024 value
= fields
->f_dir8
;
1026 case FR30_OPERAND_DIR9
:
1027 value
= fields
->f_dir9
;
1029 case FR30_OPERAND_DISP10
:
1030 value
= fields
->f_disp10
;
1032 case FR30_OPERAND_DISP8
:
1033 value
= fields
->f_disp8
;
1035 case FR30_OPERAND_DISP9
:
1036 value
= fields
->f_disp9
;
1038 case FR30_OPERAND_I20
:
1039 value
= fields
->f_i20
;
1041 case FR30_OPERAND_I32
:
1042 value
= fields
->f_i32
;
1044 case FR30_OPERAND_I8
:
1045 value
= fields
->f_i8
;
1047 case FR30_OPERAND_LABEL12
:
1048 value
= fields
->f_rel12
;
1050 case FR30_OPERAND_LABEL9
:
1051 value
= fields
->f_rel9
;
1053 case FR30_OPERAND_M4
:
1054 value
= fields
->f_m4
;
1056 case FR30_OPERAND_PS
:
1059 case FR30_OPERAND_REGLIST_HI_LD
:
1060 value
= fields
->f_reglist_hi_ld
;
1062 case FR30_OPERAND_REGLIST_HI_ST
:
1063 value
= fields
->f_reglist_hi_st
;
1065 case FR30_OPERAND_REGLIST_LOW_LD
:
1066 value
= fields
->f_reglist_low_ld
;
1068 case FR30_OPERAND_REGLIST_LOW_ST
:
1069 value
= fields
->f_reglist_low_st
;
1071 case FR30_OPERAND_S10
:
1072 value
= fields
->f_s10
;
1074 case FR30_OPERAND_U10
:
1075 value
= fields
->f_u10
;
1077 case FR30_OPERAND_U4
:
1078 value
= fields
->f_u4
;
1080 case FR30_OPERAND_U4C
:
1081 value
= fields
->f_u4c
;
1083 case FR30_OPERAND_U8
:
1084 value
= fields
->f_u8
;
1086 case FR30_OPERAND_UDISP6
:
1087 value
= fields
->f_udisp6
;
1091 /* xgettext:c-format */
1092 opcodes_error_handler
1093 (_("internal error: unrecognized field %d while getting int operand"),
1102 fr30_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1104 const CGEN_FIELDS
* fields
)
1110 case FR30_OPERAND_CRI
:
1111 value
= fields
->f_CRi
;
1113 case FR30_OPERAND_CRJ
:
1114 value
= fields
->f_CRj
;
1116 case FR30_OPERAND_R13
:
1119 case FR30_OPERAND_R14
:
1122 case FR30_OPERAND_R15
:
1125 case FR30_OPERAND_RI
:
1126 value
= fields
->f_Ri
;
1128 case FR30_OPERAND_RIC
:
1129 value
= fields
->f_Ric
;
1131 case FR30_OPERAND_RJ
:
1132 value
= fields
->f_Rj
;
1134 case FR30_OPERAND_RJC
:
1135 value
= fields
->f_Rjc
;
1137 case FR30_OPERAND_RS1
:
1138 value
= fields
->f_Rs1
;
1140 case FR30_OPERAND_RS2
:
1141 value
= fields
->f_Rs2
;
1143 case FR30_OPERAND_CC
:
1144 value
= fields
->f_cc
;
1146 case FR30_OPERAND_CCC
:
1147 value
= fields
->f_ccc
;
1149 case FR30_OPERAND_DIR10
:
1150 value
= fields
->f_dir10
;
1152 case FR30_OPERAND_DIR8
:
1153 value
= fields
->f_dir8
;
1155 case FR30_OPERAND_DIR9
:
1156 value
= fields
->f_dir9
;
1158 case FR30_OPERAND_DISP10
:
1159 value
= fields
->f_disp10
;
1161 case FR30_OPERAND_DISP8
:
1162 value
= fields
->f_disp8
;
1164 case FR30_OPERAND_DISP9
:
1165 value
= fields
->f_disp9
;
1167 case FR30_OPERAND_I20
:
1168 value
= fields
->f_i20
;
1170 case FR30_OPERAND_I32
:
1171 value
= fields
->f_i32
;
1173 case FR30_OPERAND_I8
:
1174 value
= fields
->f_i8
;
1176 case FR30_OPERAND_LABEL12
:
1177 value
= fields
->f_rel12
;
1179 case FR30_OPERAND_LABEL9
:
1180 value
= fields
->f_rel9
;
1182 case FR30_OPERAND_M4
:
1183 value
= fields
->f_m4
;
1185 case FR30_OPERAND_PS
:
1188 case FR30_OPERAND_REGLIST_HI_LD
:
1189 value
= fields
->f_reglist_hi_ld
;
1191 case FR30_OPERAND_REGLIST_HI_ST
:
1192 value
= fields
->f_reglist_hi_st
;
1194 case FR30_OPERAND_REGLIST_LOW_LD
:
1195 value
= fields
->f_reglist_low_ld
;
1197 case FR30_OPERAND_REGLIST_LOW_ST
:
1198 value
= fields
->f_reglist_low_st
;
1200 case FR30_OPERAND_S10
:
1201 value
= fields
->f_s10
;
1203 case FR30_OPERAND_U10
:
1204 value
= fields
->f_u10
;
1206 case FR30_OPERAND_U4
:
1207 value
= fields
->f_u4
;
1209 case FR30_OPERAND_U4C
:
1210 value
= fields
->f_u4c
;
1212 case FR30_OPERAND_U8
:
1213 value
= fields
->f_u8
;
1215 case FR30_OPERAND_UDISP6
:
1216 value
= fields
->f_udisp6
;
1220 /* xgettext:c-format */
1221 opcodes_error_handler
1222 (_("internal error: unrecognized field %d while getting vma operand"),
1230 void fr30_cgen_set_int_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int);
1231 void fr30_cgen_set_vma_operand (CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
);
1233 /* Stuffing values in cgen_fields is handled by a collection of functions.
1234 They are distinguished by the type of the VALUE argument they accept.
1235 TODO: floating point, inlining support, remove cases where argument type
1239 fr30_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1241 CGEN_FIELDS
* fields
,
1246 case FR30_OPERAND_CRI
:
1247 fields
->f_CRi
= value
;
1249 case FR30_OPERAND_CRJ
:
1250 fields
->f_CRj
= value
;
1252 case FR30_OPERAND_R13
:
1254 case FR30_OPERAND_R14
:
1256 case FR30_OPERAND_R15
:
1258 case FR30_OPERAND_RI
:
1259 fields
->f_Ri
= value
;
1261 case FR30_OPERAND_RIC
:
1262 fields
->f_Ric
= value
;
1264 case FR30_OPERAND_RJ
:
1265 fields
->f_Rj
= value
;
1267 case FR30_OPERAND_RJC
:
1268 fields
->f_Rjc
= value
;
1270 case FR30_OPERAND_RS1
:
1271 fields
->f_Rs1
= value
;
1273 case FR30_OPERAND_RS2
:
1274 fields
->f_Rs2
= value
;
1276 case FR30_OPERAND_CC
:
1277 fields
->f_cc
= value
;
1279 case FR30_OPERAND_CCC
:
1280 fields
->f_ccc
= value
;
1282 case FR30_OPERAND_DIR10
:
1283 fields
->f_dir10
= value
;
1285 case FR30_OPERAND_DIR8
:
1286 fields
->f_dir8
= value
;
1288 case FR30_OPERAND_DIR9
:
1289 fields
->f_dir9
= value
;
1291 case FR30_OPERAND_DISP10
:
1292 fields
->f_disp10
= value
;
1294 case FR30_OPERAND_DISP8
:
1295 fields
->f_disp8
= value
;
1297 case FR30_OPERAND_DISP9
:
1298 fields
->f_disp9
= value
;
1300 case FR30_OPERAND_I20
:
1301 fields
->f_i20
= value
;
1303 case FR30_OPERAND_I32
:
1304 fields
->f_i32
= value
;
1306 case FR30_OPERAND_I8
:
1307 fields
->f_i8
= value
;
1309 case FR30_OPERAND_LABEL12
:
1310 fields
->f_rel12
= value
;
1312 case FR30_OPERAND_LABEL9
:
1313 fields
->f_rel9
= value
;
1315 case FR30_OPERAND_M4
:
1316 fields
->f_m4
= value
;
1318 case FR30_OPERAND_PS
:
1320 case FR30_OPERAND_REGLIST_HI_LD
:
1321 fields
->f_reglist_hi_ld
= value
;
1323 case FR30_OPERAND_REGLIST_HI_ST
:
1324 fields
->f_reglist_hi_st
= value
;
1326 case FR30_OPERAND_REGLIST_LOW_LD
:
1327 fields
->f_reglist_low_ld
= value
;
1329 case FR30_OPERAND_REGLIST_LOW_ST
:
1330 fields
->f_reglist_low_st
= value
;
1332 case FR30_OPERAND_S10
:
1333 fields
->f_s10
= value
;
1335 case FR30_OPERAND_U10
:
1336 fields
->f_u10
= value
;
1338 case FR30_OPERAND_U4
:
1339 fields
->f_u4
= value
;
1341 case FR30_OPERAND_U4C
:
1342 fields
->f_u4c
= value
;
1344 case FR30_OPERAND_U8
:
1345 fields
->f_u8
= value
;
1347 case FR30_OPERAND_UDISP6
:
1348 fields
->f_udisp6
= value
;
1352 /* xgettext:c-format */
1353 opcodes_error_handler
1354 (_("internal error: unrecognized field %d while setting int operand"),
1361 fr30_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
,
1363 CGEN_FIELDS
* fields
,
1368 case FR30_OPERAND_CRI
:
1369 fields
->f_CRi
= value
;
1371 case FR30_OPERAND_CRJ
:
1372 fields
->f_CRj
= value
;
1374 case FR30_OPERAND_R13
:
1376 case FR30_OPERAND_R14
:
1378 case FR30_OPERAND_R15
:
1380 case FR30_OPERAND_RI
:
1381 fields
->f_Ri
= value
;
1383 case FR30_OPERAND_RIC
:
1384 fields
->f_Ric
= value
;
1386 case FR30_OPERAND_RJ
:
1387 fields
->f_Rj
= value
;
1389 case FR30_OPERAND_RJC
:
1390 fields
->f_Rjc
= value
;
1392 case FR30_OPERAND_RS1
:
1393 fields
->f_Rs1
= value
;
1395 case FR30_OPERAND_RS2
:
1396 fields
->f_Rs2
= value
;
1398 case FR30_OPERAND_CC
:
1399 fields
->f_cc
= value
;
1401 case FR30_OPERAND_CCC
:
1402 fields
->f_ccc
= value
;
1404 case FR30_OPERAND_DIR10
:
1405 fields
->f_dir10
= value
;
1407 case FR30_OPERAND_DIR8
:
1408 fields
->f_dir8
= value
;
1410 case FR30_OPERAND_DIR9
:
1411 fields
->f_dir9
= value
;
1413 case FR30_OPERAND_DISP10
:
1414 fields
->f_disp10
= value
;
1416 case FR30_OPERAND_DISP8
:
1417 fields
->f_disp8
= value
;
1419 case FR30_OPERAND_DISP9
:
1420 fields
->f_disp9
= value
;
1422 case FR30_OPERAND_I20
:
1423 fields
->f_i20
= value
;
1425 case FR30_OPERAND_I32
:
1426 fields
->f_i32
= value
;
1428 case FR30_OPERAND_I8
:
1429 fields
->f_i8
= value
;
1431 case FR30_OPERAND_LABEL12
:
1432 fields
->f_rel12
= value
;
1434 case FR30_OPERAND_LABEL9
:
1435 fields
->f_rel9
= value
;
1437 case FR30_OPERAND_M4
:
1438 fields
->f_m4
= value
;
1440 case FR30_OPERAND_PS
:
1442 case FR30_OPERAND_REGLIST_HI_LD
:
1443 fields
->f_reglist_hi_ld
= value
;
1445 case FR30_OPERAND_REGLIST_HI_ST
:
1446 fields
->f_reglist_hi_st
= value
;
1448 case FR30_OPERAND_REGLIST_LOW_LD
:
1449 fields
->f_reglist_low_ld
= value
;
1451 case FR30_OPERAND_REGLIST_LOW_ST
:
1452 fields
->f_reglist_low_st
= value
;
1454 case FR30_OPERAND_S10
:
1455 fields
->f_s10
= value
;
1457 case FR30_OPERAND_U10
:
1458 fields
->f_u10
= value
;
1460 case FR30_OPERAND_U4
:
1461 fields
->f_u4
= value
;
1463 case FR30_OPERAND_U4C
:
1464 fields
->f_u4c
= value
;
1466 case FR30_OPERAND_U8
:
1467 fields
->f_u8
= value
;
1469 case FR30_OPERAND_UDISP6
:
1470 fields
->f_udisp6
= value
;
1474 /* xgettext:c-format */
1475 opcodes_error_handler
1476 (_("internal error: unrecognized field %d while setting vma operand"),
1482 /* Function to call before using the instruction builder tables. */
1485 fr30_cgen_init_ibld_table (CGEN_CPU_DESC cd
)
1487 cd
->insert_handlers
= & fr30_cgen_insert_handlers
[0];
1488 cd
->extract_handlers
= & fr30_cgen_extract_handlers
[0];
1490 cd
->insert_operand
= fr30_cgen_insert_operand
;
1491 cd
->extract_operand
= fr30_cgen_extract_operand
;
1493 cd
->get_int_operand
= fr30_cgen_get_int_operand
;
1494 cd
->set_int_operand
= fr30_cgen_set_int_operand
;
1495 cd
->get_vma_operand
= fr30_cgen_get_vma_operand
;
1496 cd
->set_vma_operand
= fr30_cgen_set_vma_operand
;