1 /* Instruction building/extraction support for fr30. -*- 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.
33 #include "fr30-desc.h"
38 #define min(a,b) ((a) < (b) ? (a) : (b))
40 #define max(a,b) ((a) > (b) ? (a) : (b))
42 /* Used by the ifield rtx function. */
43 #define FLD(f) (fields->f)
45 static const char * insert_normal
46 PARAMS ((CGEN_CPU_DESC
, long, unsigned int, unsigned int, unsigned int,
47 unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR
));
48 static const char * insert_insn_normal
49 PARAMS ((CGEN_CPU_DESC
, const CGEN_INSN
*,
50 CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
));
51 static int extract_normal
52 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
,
53 unsigned int, unsigned int, unsigned int, unsigned int,
54 unsigned int, unsigned int, bfd_vma
, long *));
55 static int extract_insn_normal
56 PARAMS ((CGEN_CPU_DESC
, const CGEN_INSN
*, CGEN_EXTRACT_INFO
*,
57 CGEN_INSN_INT
, CGEN_FIELDS
*, bfd_vma
));
59 static void put_insn_int_value
60 PARAMS ((CGEN_CPU_DESC
, CGEN_INSN_BYTES_PTR
, int, int, CGEN_INSN_INT
));
62 static CGEN_INLINE
int fill_cache
63 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, bfd_vma
));
64 static CGEN_INLINE
long extract_1
65 PARAMS ((CGEN_CPU_DESC
, CGEN_EXTRACT_INFO
*, int, int, int, unsigned char *,
67 static CGEN_INLINE
void insert_1
68 PARAMS ((CGEN_CPU_DESC
, unsigned long, int, int, int, unsigned char *));
69 const char * fr30_cgen_insert_operand
70 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, CGEN_INSN_BYTES_PTR
, bfd_vma
));
71 int fr30_cgen_extract_operand
72 PARAMS ((CGEN_CPU_DESC
, int, CGEN_EXTRACT_INFO
*, CGEN_INSN_INT
, CGEN_FIELDS
*,
74 int fr30_cgen_get_int_operand
75 PARAMS ((CGEN_CPU_DESC
, int, const CGEN_FIELDS
*));
76 bfd_vma fr30_cgen_get_vma_operand
77 PARAMS ((CGEN_CPU_DESC
, int, const CGEN_FIELDS
*));
78 void fr30_cgen_set_int_operand
79 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, int));
80 void fr30_cgen_set_vma_operand
81 PARAMS ((CGEN_CPU_DESC
, int, CGEN_FIELDS
*, bfd_vma
));
84 /* Operand insertion. */
88 /* Subroutine of insert_normal. */
90 static CGEN_INLINE
void
91 insert_1 (cd
, value
, start
, length
, word_length
, bufp
)
94 int start
,length
,word_length
;
99 int big_p
= CGEN_CPU_INSN_ENDIAN (cd
) == CGEN_ENDIAN_BIG
;
101 x
= bfd_get_bits (bufp
, word_length
, big_p
);
103 /* Written this way to avoid undefined behaviour. */
104 mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
105 if (CGEN_INSN_LSB0_P
)
106 shift
= (start
+ 1) - length
;
108 shift
= (word_length
- (start
+ length
));
109 x
= (x
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
111 bfd_put_bits ((bfd_vma
) x
, bufp
, word_length
, big_p
);
114 #endif /* ! CGEN_INT_INSN_P */
116 /* Default insertion routine.
118 ATTRS is a mask of the boolean attributes.
119 WORD_OFFSET is the offset in bits from the start of the insn of the value.
120 WORD_LENGTH is the length of the word in bits in which the value resides.
121 START is the starting bit number in the word, architecture origin.
122 LENGTH is the length of VALUE in bits.
123 TOTAL_LENGTH is the total length of the insn in bits.
125 The result is an error message or NULL if success. */
127 /* ??? This duplicates functionality with bfd's howto table and
128 bfd_install_relocation. */
129 /* ??? This doesn't handle bfd_vma's. Create another function when
133 insert_normal (cd
, value
, attrs
, word_offset
, start
, length
, word_length
,
134 total_length
, buffer
)
138 unsigned int word_offset
, start
, length
, word_length
, total_length
;
139 CGEN_INSN_BYTES_PTR buffer
;
141 static char errbuf
[100];
142 /* Written this way to avoid undefined behaviour. */
143 unsigned long mask
= (((1L << (length
- 1)) - 1) << 1) | 1;
145 /* If LENGTH is zero, this operand doesn't contribute to the value. */
155 if (word_length
> 32)
158 /* For architectures with insns smaller than the base-insn-bitsize,
159 word_length may be too big. */
160 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
163 && word_length
> total_length
)
164 word_length
= total_length
;
167 /* Ensure VALUE will fit. */
168 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGN_OPT
))
170 long minval
= - (1L << (length
- 1));
171 unsigned long maxval
= mask
;
173 if ((value
> 0 && (unsigned long) value
> maxval
)
176 /* xgettext:c-format */
178 _("operand out of range (%ld not between %ld and %lu)"),
179 value
, minval
, maxval
);
183 else if (! CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
))
185 unsigned long maxval
= mask
;
187 if ((unsigned long) value
> maxval
)
189 /* xgettext:c-format */
191 _("operand out of range (%lu not between 0 and %lu)"),
198 if (! cgen_signed_overflow_ok_p (cd
))
200 long minval
= - (1L << (length
- 1));
201 long maxval
= (1L << (length
- 1)) - 1;
203 if (value
< minval
|| value
> maxval
)
206 /* xgettext:c-format */
207 (errbuf
, _("operand out of range (%ld not between %ld and %ld)"),
208 value
, minval
, maxval
);
219 if (CGEN_INSN_LSB0_P
)
220 shift
= (word_offset
+ start
+ 1) - length
;
222 shift
= total_length
- (word_offset
+ start
+ length
);
223 *buffer
= (*buffer
& ~(mask
<< shift
)) | ((value
& mask
) << shift
);
226 #else /* ! CGEN_INT_INSN_P */
229 unsigned char *bufp
= (unsigned char *) buffer
+ word_offset
/ 8;
231 insert_1 (cd
, value
, start
, length
, word_length
, bufp
);
234 #endif /* ! CGEN_INT_INSN_P */
239 /* Default insn builder (insert handler).
240 The instruction is recorded in CGEN_INT_INSN_P byte order (meaning
241 that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is
242 recorded in host byte order, otherwise BUFFER is an array of bytes
243 and the value is recorded in target byte order).
244 The result is an error message or NULL if success. */
247 insert_insn_normal (cd
, insn
, fields
, buffer
, pc
)
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 (cd
->base_insn_bitsize
,
272 (unsigned) CGEN_FIELDS_BITSIZE (fields
)),
275 #endif /* ! CGEN_INT_INSN_P */
277 /* ??? It would be better to scan the format's fields.
278 Still need to be able to insert a value based on the operand though;
279 e.g. storing a branch displacement that got resolved later.
280 Needs more thought first. */
282 for (syn
= CGEN_SYNTAX_STRING (syntax
); * syn
; ++ syn
)
286 if (CGEN_SYNTAX_CHAR_P (* syn
))
289 errmsg
= (* cd
->insert_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
299 /* Cover function to store an insn value into an integral insn. Must go here
300 because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
303 put_insn_int_value (cd
, buf
, length
, insn_length
, value
)
304 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
305 CGEN_INSN_BYTES_PTR buf
;
310 /* For architectures with insns smaller than the base-insn-bitsize,
311 length may be too big. */
312 if (length
> insn_length
)
316 int shift
= insn_length
- length
;
317 /* Written this way to avoid undefined behaviour. */
318 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 (cd
, ex_info
, offset
, bytes
, pc
)
336 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
337 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 (cd
, ex_info
, start
, length
, word_length
, bufp
, pc
)
381 CGEN_EXTRACT_INFO
*ex_info ATTRIBUTE_UNUSED
;
382 int start
,length
,word_length
;
384 bfd_vma pc ATTRIBUTE_UNUSED
;
388 int big_p
= CGEN_CPU_INSN_ENDIAN (cd
) == CGEN_ENDIAN_BIG
;
390 x
= bfd_get_bits (bufp
, word_length
, big_p
);
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 (cd
, ex_info
, insn_value
, attrs
, word_offset
, start
, length
,
423 word_length
, total_length
, pc
, valuep
)
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
, start
, length
, word_length
, total_length
;
433 #if ! CGEN_INT_INSN_P
436 bfd_vma pc ATTRIBUTE_UNUSED
;
442 /* If LENGTH is zero, this operand doesn't contribute to the value
443 so give it a standard value of zero. */
456 if (word_length
> 32)
459 /* For architectures with insns smaller than the insn-base-bitsize,
460 word_length may be too big. */
461 if (cd
->min_insn_bitsize
< cd
->base_insn_bitsize
)
464 && word_length
> total_length
)
465 word_length
= total_length
;
468 /* Does the value reside in INSN_VALUE, and at the right alignment? */
470 if (CGEN_INT_INSN_P
|| (word_offset
== 0 && word_length
== total_length
))
472 if (CGEN_INSN_LSB0_P
)
473 value
= insn_value
>> ((word_offset
+ start
+ 1) - length
);
475 value
= insn_value
>> (total_length
- ( word_offset
+ start
+ length
));
478 #if ! CGEN_INT_INSN_P
482 unsigned char *bufp
= ex_info
->insn_bytes
+ word_offset
/ 8;
484 if (word_length
> 32)
487 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
= (((1L << (length
- 1)) - 1) << 1) | 1;
500 if (CGEN_BOOL_ATTR (attrs
, CGEN_IFLD_SIGNED
)
501 && (value
& (1L << (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 (cd
, insn
, ex_info
, insn_value
, fields
, pc
)
521 const CGEN_INSN
*insn
;
522 CGEN_EXTRACT_INFO
*ex_info
;
523 CGEN_INSN_INT insn_value
;
527 const CGEN_SYNTAX
*syntax
= CGEN_INSN_SYNTAX (insn
);
528 const CGEN_SYNTAX_CHAR_TYPE
*syn
;
530 CGEN_FIELDS_BITSIZE (fields
) = CGEN_INSN_BITSIZE (insn
);
532 CGEN_INIT_EXTRACT (cd
);
534 for (syn
= CGEN_SYNTAX_STRING (syntax
); *syn
; ++syn
)
538 if (CGEN_SYNTAX_CHAR_P (*syn
))
541 length
= (* cd
->extract_operand
) (cd
, CGEN_SYNTAX_FIELD (*syn
),
542 ex_info
, insn_value
, fields
, pc
);
547 /* We recognized and successfully extracted this insn. */
548 return CGEN_INSN_BITSIZE (insn
);
551 /* machine generated code added here */
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.
569 fr30_cgen_insert_operand (cd
, opindex
, fields
, buffer
, pc
)
572 CGEN_FIELDS
* fields
;
573 CGEN_INSN_BYTES_PTR buffer
;
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
= ((unsigned int) (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
= ((unsigned int) (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
= ((int) (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
= ((int) (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
) = ((unsigned int) (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
= ((int) (((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
= ((int) (((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
= ((int) (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
= ((unsigned int) (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
= ((unsigned int) (value
) >> (2));
733 errmsg
= insert_normal (cd
, value
, 0, 0, 8, 4, 16, total_length
, buffer
);
738 /* xgettext:c-format */
739 fprintf (stderr
, _("Unrecognized field %d while building insn.\n"),
747 /* Main entry point for operand extraction.
748 The result is <= 0 for error, >0 for success.
749 ??? Actual values aren't well defined right now.
751 This function is basically just a big switch statement. Earlier versions
752 used tables to look up the function to use, but
753 - if the table contains both assembler and disassembler functions then
754 the disassembler contains much of the assembler and vice-versa,
755 - there's a lot of inlining possibilities as things grow,
756 - using a switch statement avoids the function call overhead.
758 This function could be moved into `print_insn_normal', but keeping it
759 separate makes clear the interface between `print_insn_normal' and each of
764 fr30_cgen_extract_operand (cd
, opindex
, ex_info
, insn_value
, fields
, pc
)
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
) << (2));
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
) << (1));
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
) << (1))) + (((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
) << (1))) + (((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
) | (((-1) << (4))));
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
) << (2));
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 fprintf (stderr
, _("Unrecognized field %d while decoding insn.\n"),
951 cgen_insert_fn
* const fr30_cgen_insert_handlers
[] =
956 cgen_extract_fn
* const fr30_cgen_extract_handlers
[] =
961 /* Getting values from cgen_fields is handled by a collection of functions.
962 They are distinguished by the type of the VALUE argument they return.
963 TODO: floating point, inlining support, remove cases where result type
967 fr30_cgen_get_int_operand (cd
, opindex
, fields
)
968 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
970 const CGEN_FIELDS
* fields
;
976 case FR30_OPERAND_CRI
:
977 value
= fields
->f_CRi
;
979 case FR30_OPERAND_CRJ
:
980 value
= fields
->f_CRj
;
982 case FR30_OPERAND_R13
:
985 case FR30_OPERAND_R14
:
988 case FR30_OPERAND_R15
:
991 case FR30_OPERAND_RI
:
992 value
= fields
->f_Ri
;
994 case FR30_OPERAND_RIC
:
995 value
= fields
->f_Ric
;
997 case FR30_OPERAND_RJ
:
998 value
= fields
->f_Rj
;
1000 case FR30_OPERAND_RJC
:
1001 value
= fields
->f_Rjc
;
1003 case FR30_OPERAND_RS1
:
1004 value
= fields
->f_Rs1
;
1006 case FR30_OPERAND_RS2
:
1007 value
= fields
->f_Rs2
;
1009 case FR30_OPERAND_CC
:
1010 value
= fields
->f_cc
;
1012 case FR30_OPERAND_CCC
:
1013 value
= fields
->f_ccc
;
1015 case FR30_OPERAND_DIR10
:
1016 value
= fields
->f_dir10
;
1018 case FR30_OPERAND_DIR8
:
1019 value
= fields
->f_dir8
;
1021 case FR30_OPERAND_DIR9
:
1022 value
= fields
->f_dir9
;
1024 case FR30_OPERAND_DISP10
:
1025 value
= fields
->f_disp10
;
1027 case FR30_OPERAND_DISP8
:
1028 value
= fields
->f_disp8
;
1030 case FR30_OPERAND_DISP9
:
1031 value
= fields
->f_disp9
;
1033 case FR30_OPERAND_I20
:
1034 value
= fields
->f_i20
;
1036 case FR30_OPERAND_I32
:
1037 value
= fields
->f_i32
;
1039 case FR30_OPERAND_I8
:
1040 value
= fields
->f_i8
;
1042 case FR30_OPERAND_LABEL12
:
1043 value
= fields
->f_rel12
;
1045 case FR30_OPERAND_LABEL9
:
1046 value
= fields
->f_rel9
;
1048 case FR30_OPERAND_M4
:
1049 value
= fields
->f_m4
;
1051 case FR30_OPERAND_PS
:
1054 case FR30_OPERAND_REGLIST_HI_LD
:
1055 value
= fields
->f_reglist_hi_ld
;
1057 case FR30_OPERAND_REGLIST_HI_ST
:
1058 value
= fields
->f_reglist_hi_st
;
1060 case FR30_OPERAND_REGLIST_LOW_LD
:
1061 value
= fields
->f_reglist_low_ld
;
1063 case FR30_OPERAND_REGLIST_LOW_ST
:
1064 value
= fields
->f_reglist_low_st
;
1066 case FR30_OPERAND_S10
:
1067 value
= fields
->f_s10
;
1069 case FR30_OPERAND_U10
:
1070 value
= fields
->f_u10
;
1072 case FR30_OPERAND_U4
:
1073 value
= fields
->f_u4
;
1075 case FR30_OPERAND_U4C
:
1076 value
= fields
->f_u4c
;
1078 case FR30_OPERAND_U8
:
1079 value
= fields
->f_u8
;
1081 case FR30_OPERAND_UDISP6
:
1082 value
= fields
->f_udisp6
;
1086 /* xgettext:c-format */
1087 fprintf (stderr
, _("Unrecognized field %d while getting int operand.\n"),
1096 fr30_cgen_get_vma_operand (cd
, opindex
, fields
)
1097 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1099 const CGEN_FIELDS
* fields
;
1105 case FR30_OPERAND_CRI
:
1106 value
= fields
->f_CRi
;
1108 case FR30_OPERAND_CRJ
:
1109 value
= fields
->f_CRj
;
1111 case FR30_OPERAND_R13
:
1114 case FR30_OPERAND_R14
:
1117 case FR30_OPERAND_R15
:
1120 case FR30_OPERAND_RI
:
1121 value
= fields
->f_Ri
;
1123 case FR30_OPERAND_RIC
:
1124 value
= fields
->f_Ric
;
1126 case FR30_OPERAND_RJ
:
1127 value
= fields
->f_Rj
;
1129 case FR30_OPERAND_RJC
:
1130 value
= fields
->f_Rjc
;
1132 case FR30_OPERAND_RS1
:
1133 value
= fields
->f_Rs1
;
1135 case FR30_OPERAND_RS2
:
1136 value
= fields
->f_Rs2
;
1138 case FR30_OPERAND_CC
:
1139 value
= fields
->f_cc
;
1141 case FR30_OPERAND_CCC
:
1142 value
= fields
->f_ccc
;
1144 case FR30_OPERAND_DIR10
:
1145 value
= fields
->f_dir10
;
1147 case FR30_OPERAND_DIR8
:
1148 value
= fields
->f_dir8
;
1150 case FR30_OPERAND_DIR9
:
1151 value
= fields
->f_dir9
;
1153 case FR30_OPERAND_DISP10
:
1154 value
= fields
->f_disp10
;
1156 case FR30_OPERAND_DISP8
:
1157 value
= fields
->f_disp8
;
1159 case FR30_OPERAND_DISP9
:
1160 value
= fields
->f_disp9
;
1162 case FR30_OPERAND_I20
:
1163 value
= fields
->f_i20
;
1165 case FR30_OPERAND_I32
:
1166 value
= fields
->f_i32
;
1168 case FR30_OPERAND_I8
:
1169 value
= fields
->f_i8
;
1171 case FR30_OPERAND_LABEL12
:
1172 value
= fields
->f_rel12
;
1174 case FR30_OPERAND_LABEL9
:
1175 value
= fields
->f_rel9
;
1177 case FR30_OPERAND_M4
:
1178 value
= fields
->f_m4
;
1180 case FR30_OPERAND_PS
:
1183 case FR30_OPERAND_REGLIST_HI_LD
:
1184 value
= fields
->f_reglist_hi_ld
;
1186 case FR30_OPERAND_REGLIST_HI_ST
:
1187 value
= fields
->f_reglist_hi_st
;
1189 case FR30_OPERAND_REGLIST_LOW_LD
:
1190 value
= fields
->f_reglist_low_ld
;
1192 case FR30_OPERAND_REGLIST_LOW_ST
:
1193 value
= fields
->f_reglist_low_st
;
1195 case FR30_OPERAND_S10
:
1196 value
= fields
->f_s10
;
1198 case FR30_OPERAND_U10
:
1199 value
= fields
->f_u10
;
1201 case FR30_OPERAND_U4
:
1202 value
= fields
->f_u4
;
1204 case FR30_OPERAND_U4C
:
1205 value
= fields
->f_u4c
;
1207 case FR30_OPERAND_U8
:
1208 value
= fields
->f_u8
;
1210 case FR30_OPERAND_UDISP6
:
1211 value
= fields
->f_udisp6
;
1215 /* xgettext:c-format */
1216 fprintf (stderr
, _("Unrecognized field %d while getting vma operand.\n"),
1224 /* Stuffing values in cgen_fields is handled by a collection of functions.
1225 They are distinguished by the type of the VALUE argument they accept.
1226 TODO: floating point, inlining support, remove cases where argument type
1230 fr30_cgen_set_int_operand (cd
, opindex
, fields
, value
)
1231 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1233 CGEN_FIELDS
* fields
;
1238 case FR30_OPERAND_CRI
:
1239 fields
->f_CRi
= value
;
1241 case FR30_OPERAND_CRJ
:
1242 fields
->f_CRj
= value
;
1244 case FR30_OPERAND_R13
:
1246 case FR30_OPERAND_R14
:
1248 case FR30_OPERAND_R15
:
1250 case FR30_OPERAND_RI
:
1251 fields
->f_Ri
= value
;
1253 case FR30_OPERAND_RIC
:
1254 fields
->f_Ric
= value
;
1256 case FR30_OPERAND_RJ
:
1257 fields
->f_Rj
= value
;
1259 case FR30_OPERAND_RJC
:
1260 fields
->f_Rjc
= value
;
1262 case FR30_OPERAND_RS1
:
1263 fields
->f_Rs1
= value
;
1265 case FR30_OPERAND_RS2
:
1266 fields
->f_Rs2
= value
;
1268 case FR30_OPERAND_CC
:
1269 fields
->f_cc
= value
;
1271 case FR30_OPERAND_CCC
:
1272 fields
->f_ccc
= value
;
1274 case FR30_OPERAND_DIR10
:
1275 fields
->f_dir10
= value
;
1277 case FR30_OPERAND_DIR8
:
1278 fields
->f_dir8
= value
;
1280 case FR30_OPERAND_DIR9
:
1281 fields
->f_dir9
= value
;
1283 case FR30_OPERAND_DISP10
:
1284 fields
->f_disp10
= value
;
1286 case FR30_OPERAND_DISP8
:
1287 fields
->f_disp8
= value
;
1289 case FR30_OPERAND_DISP9
:
1290 fields
->f_disp9
= value
;
1292 case FR30_OPERAND_I20
:
1293 fields
->f_i20
= value
;
1295 case FR30_OPERAND_I32
:
1296 fields
->f_i32
= value
;
1298 case FR30_OPERAND_I8
:
1299 fields
->f_i8
= value
;
1301 case FR30_OPERAND_LABEL12
:
1302 fields
->f_rel12
= value
;
1304 case FR30_OPERAND_LABEL9
:
1305 fields
->f_rel9
= value
;
1307 case FR30_OPERAND_M4
:
1308 fields
->f_m4
= value
;
1310 case FR30_OPERAND_PS
:
1312 case FR30_OPERAND_REGLIST_HI_LD
:
1313 fields
->f_reglist_hi_ld
= value
;
1315 case FR30_OPERAND_REGLIST_HI_ST
:
1316 fields
->f_reglist_hi_st
= value
;
1318 case FR30_OPERAND_REGLIST_LOW_LD
:
1319 fields
->f_reglist_low_ld
= value
;
1321 case FR30_OPERAND_REGLIST_LOW_ST
:
1322 fields
->f_reglist_low_st
= value
;
1324 case FR30_OPERAND_S10
:
1325 fields
->f_s10
= value
;
1327 case FR30_OPERAND_U10
:
1328 fields
->f_u10
= value
;
1330 case FR30_OPERAND_U4
:
1331 fields
->f_u4
= value
;
1333 case FR30_OPERAND_U4C
:
1334 fields
->f_u4c
= value
;
1336 case FR30_OPERAND_U8
:
1337 fields
->f_u8
= value
;
1339 case FR30_OPERAND_UDISP6
:
1340 fields
->f_udisp6
= value
;
1344 /* xgettext:c-format */
1345 fprintf (stderr
, _("Unrecognized field %d while setting int operand.\n"),
1352 fr30_cgen_set_vma_operand (cd
, opindex
, fields
, value
)
1353 CGEN_CPU_DESC cd ATTRIBUTE_UNUSED
;
1355 CGEN_FIELDS
* fields
;
1360 case FR30_OPERAND_CRI
:
1361 fields
->f_CRi
= value
;
1363 case FR30_OPERAND_CRJ
:
1364 fields
->f_CRj
= value
;
1366 case FR30_OPERAND_R13
:
1368 case FR30_OPERAND_R14
:
1370 case FR30_OPERAND_R15
:
1372 case FR30_OPERAND_RI
:
1373 fields
->f_Ri
= value
;
1375 case FR30_OPERAND_RIC
:
1376 fields
->f_Ric
= value
;
1378 case FR30_OPERAND_RJ
:
1379 fields
->f_Rj
= value
;
1381 case FR30_OPERAND_RJC
:
1382 fields
->f_Rjc
= value
;
1384 case FR30_OPERAND_RS1
:
1385 fields
->f_Rs1
= value
;
1387 case FR30_OPERAND_RS2
:
1388 fields
->f_Rs2
= value
;
1390 case FR30_OPERAND_CC
:
1391 fields
->f_cc
= value
;
1393 case FR30_OPERAND_CCC
:
1394 fields
->f_ccc
= value
;
1396 case FR30_OPERAND_DIR10
:
1397 fields
->f_dir10
= value
;
1399 case FR30_OPERAND_DIR8
:
1400 fields
->f_dir8
= value
;
1402 case FR30_OPERAND_DIR9
:
1403 fields
->f_dir9
= value
;
1405 case FR30_OPERAND_DISP10
:
1406 fields
->f_disp10
= value
;
1408 case FR30_OPERAND_DISP8
:
1409 fields
->f_disp8
= value
;
1411 case FR30_OPERAND_DISP9
:
1412 fields
->f_disp9
= value
;
1414 case FR30_OPERAND_I20
:
1415 fields
->f_i20
= value
;
1417 case FR30_OPERAND_I32
:
1418 fields
->f_i32
= value
;
1420 case FR30_OPERAND_I8
:
1421 fields
->f_i8
= value
;
1423 case FR30_OPERAND_LABEL12
:
1424 fields
->f_rel12
= value
;
1426 case FR30_OPERAND_LABEL9
:
1427 fields
->f_rel9
= value
;
1429 case FR30_OPERAND_M4
:
1430 fields
->f_m4
= value
;
1432 case FR30_OPERAND_PS
:
1434 case FR30_OPERAND_REGLIST_HI_LD
:
1435 fields
->f_reglist_hi_ld
= value
;
1437 case FR30_OPERAND_REGLIST_HI_ST
:
1438 fields
->f_reglist_hi_st
= value
;
1440 case FR30_OPERAND_REGLIST_LOW_LD
:
1441 fields
->f_reglist_low_ld
= value
;
1443 case FR30_OPERAND_REGLIST_LOW_ST
:
1444 fields
->f_reglist_low_st
= value
;
1446 case FR30_OPERAND_S10
:
1447 fields
->f_s10
= value
;
1449 case FR30_OPERAND_U10
:
1450 fields
->f_u10
= value
;
1452 case FR30_OPERAND_U4
:
1453 fields
->f_u4
= value
;
1455 case FR30_OPERAND_U4C
:
1456 fields
->f_u4c
= value
;
1458 case FR30_OPERAND_U8
:
1459 fields
->f_u8
= value
;
1461 case FR30_OPERAND_UDISP6
:
1462 fields
->f_udisp6
= value
;
1466 /* xgettext:c-format */
1467 fprintf (stderr
, _("Unrecognized field %d while setting vma operand.\n"),
1473 /* Function to call before using the instruction builder tables. */
1476 fr30_cgen_init_ibld_table (cd
)
1479 cd
->insert_handlers
= & fr30_cgen_insert_handlers
[0];
1480 cd
->extract_handlers
= & fr30_cgen_extract_handlers
[0];
1482 cd
->insert_operand
= fr30_cgen_insert_operand
;
1483 cd
->extract_operand
= fr30_cgen_extract_operand
;
1485 cd
->get_int_operand
= fr30_cgen_get_int_operand
;
1486 cd
->set_int_operand
= fr30_cgen_set_int_operand
;
1487 cd
->get_vma_operand
= fr30_cgen_get_vma_operand
;
1488 cd
->set_vma_operand
= fr30_cgen_set_vma_operand
;