1 /* tc-tilepro.c -- Assemble for a TILEPro chip.
2 Copyright 2011 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 #include "struc-symbol.h"
25 #include "elf/tilepro.h"
26 #include "opcode/tilepro.h"
28 #include "dwarf2dbg.h"
29 #include "dw2gencfi.h"
31 #include "safe-ctype.h"
34 /* Special registers. */
44 /* Generic assembler global variables which must be defined by all
47 /* Characters which always start a comment. */
48 const char comment_chars
[] = "#";
50 /* Characters which start a comment at the beginning of a line. */
51 const char line_comment_chars
[] = "#";
53 /* Characters which may be used to separate multiple commands on a
55 const char line_separator_chars
[] = ";";
57 /* Characters which are used to indicate an exponent in a floating
59 const char EXP_CHARS
[] = "eE";
61 /* Characters which mean that a number is a floating point constant,
63 const char FLT_CHARS
[] = "rRsSfFdDxXpP";
65 const char *md_shortopts
= "VQ:";
67 struct option md_longopts
[] =
69 {NULL
, no_argument
, NULL
, 0}
72 size_t md_longopts_size
= sizeof (md_longopts
);
75 md_parse_option (int c
, char *arg ATTRIBUTE_UNUSED
)
79 /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
80 should be emitted or not. FIXME: Not implemented. */
84 /* -V: SVR4 argument to print version ID. */
97 md_show_usage (FILE *stream
)
101 -V print assembler version number\n"));
104 /* Extra expression types. */
110 #define O_got_lo16 O_md5
111 #define O_got_hi16 O_md6
112 #define O_got_ha16 O_md7
114 #define O_tls_gd O_md9
115 #define O_tls_gd_lo16 O_md10
116 #define O_tls_gd_hi16 O_md11
117 #define O_tls_gd_ha16 O_md12
118 #define O_tls_ie O_md13
119 #define O_tls_ie_lo16 O_md14
120 #define O_tls_ie_hi16 O_md15
121 #define O_tls_ie_ha16 O_md16
122 #define O_tls_le O_md17
123 #define O_tls_le_lo16 O_md18
124 #define O_tls_le_hi16 O_md19
125 #define O_tls_le_ha16 O_md20
126 #define O_tls_gd_call O_md21
127 #define O_tls_gd_add O_md22
128 #define O_tls_ie_load O_md23
130 static struct hash_control
*special_operator_hash
;
132 /* Hash tables for instruction mnemonic lookup. */
133 static struct hash_control
*op_hash
;
135 /* Hash table for spr lookup. */
136 static struct hash_control
*spr_hash
;
138 /* True temporarily while parsing an SPR expression. This changes the
139 * namespace to include SPR names. */
140 static int parsing_spr
;
142 /* Are we currently inside `{ ... }'? */
143 static int inside_bundle
;
145 struct tilepro_instruction
147 const struct tilepro_opcode
*opcode
;
148 tilepro_pipeline pipe
;
149 expressionS operand_values
[TILEPRO_MAX_OPERANDS
];
152 /* This keeps track of the current bundle being built up. */
153 static struct tilepro_instruction
154 current_bundle
[TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE
];
156 /* Index in current_bundle for the next instruction to parse. */
157 static int current_bundle_index
;
159 /* Allow 'r63' in addition to 'zero', etc. Normally we disallow this as
160 'zero' is not a real register, so using it accidentally would be a
161 nasty bug. For other registers, such as 'sp', code using multiple names
162 for the same physical register is excessively confusing.
164 The '.require_canonical_reg_names' pseudo-op turns this error on,
165 and the '.no_require_canonical_reg_names' pseudo-op turns this off.
166 By default the error is on. */
167 static int require_canonical_reg_names
;
169 /* Allow bundles that do undefined or suspicious things like write
170 two different values to the same register at the same time.
172 The '.no_allow_suspicious_bundles' pseudo-op turns this error on,
173 and the '.allow_suspicious_bundles' pseudo-op turns this off. */
174 static int allow_suspicious_bundles
;
177 /* A hash table of main processor registers, mapping each register name
180 Furthermore, if the register number is greater than the number
181 of registers for that processor, the user used an illegal alias
182 for that register (e.g. r63 instead of zero), so we should generate
183 a warning. The attempted register number can be found by clearing
184 NONCANONICAL_REG_NAME_FLAG. */
185 static struct hash_control
*main_reg_hash
;
188 /* We cannot unambiguously store a 0 in a hash table and look it up,
189 so we OR in this flag to every canonical register. */
190 #define CANONICAL_REG_NAME_FLAG 0x1000
192 /* By default we disallow register aliases like r63, but we record
193 them in the hash table in case the .no_require_canonical_reg_names
194 directive is used. Noncanonical names have this value added to them. */
195 #define NONCANONICAL_REG_NAME_FLAG 0x2000
197 /* Discards flags for register hash table entries and returns the
199 #define EXTRACT_REGNO(p) ((p) & 63)
201 /* This function is called once, at assembler startup time. It should
202 set up all the tables, etc., that the MD part of the assembler will
207 const struct tilepro_opcode
*op
;
210 /* Guarantee text section is aligned. */
211 bfd_set_section_alignment (stdoutput
, text_section
,
212 TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
);
214 require_canonical_reg_names
= 1;
215 allow_suspicious_bundles
= 0;
216 current_bundle_index
= 0;
219 /* Initialize special operator hash table. */
220 special_operator_hash
= hash_new ();
221 #define INSERT_SPECIAL_OP(name) \
222 hash_insert (special_operator_hash, #name, (void *)O_##name)
224 INSERT_SPECIAL_OP(lo16
);
225 INSERT_SPECIAL_OP(hi16
);
226 INSERT_SPECIAL_OP(ha16
);
227 INSERT_SPECIAL_OP(got
);
228 INSERT_SPECIAL_OP(got_lo16
);
229 INSERT_SPECIAL_OP(got_hi16
);
230 INSERT_SPECIAL_OP(got_ha16
);
231 INSERT_SPECIAL_OP(plt
);
232 INSERT_SPECIAL_OP(tls_gd
);
233 INSERT_SPECIAL_OP(tls_gd_lo16
);
234 INSERT_SPECIAL_OP(tls_gd_hi16
);
235 INSERT_SPECIAL_OP(tls_gd_ha16
);
236 INSERT_SPECIAL_OP(tls_ie
);
237 INSERT_SPECIAL_OP(tls_ie_lo16
);
238 INSERT_SPECIAL_OP(tls_ie_hi16
);
239 INSERT_SPECIAL_OP(tls_ie_ha16
);
240 INSERT_SPECIAL_OP(tls_le
);
241 INSERT_SPECIAL_OP(tls_le_lo16
);
242 INSERT_SPECIAL_OP(tls_le_hi16
);
243 INSERT_SPECIAL_OP(tls_le_ha16
);
244 INSERT_SPECIAL_OP(tls_gd_call
);
245 INSERT_SPECIAL_OP(tls_gd_add
);
246 INSERT_SPECIAL_OP(tls_ie_load
);
247 #undef INSERT_SPECIAL_OP
249 /* Initialize op_hash hash table. */
250 op_hash
= hash_new ();
251 for (op
= &tilepro_opcodes
[0]; op
->name
!= NULL
; op
++)
253 const char *hash_err
= hash_insert (op_hash
, op
->name
, (void *)op
);
254 if (hash_err
!= NULL
)
256 as_fatal (_("Internal Error: Can't hash %s: %s"),
261 /* Initialize the spr hash table. */
263 spr_hash
= hash_new ();
264 for (i
= 0; i
< tilepro_num_sprs
; i
++)
265 hash_insert (spr_hash
, tilepro_sprs
[i
].name
,
266 (void *) &tilepro_sprs
[i
]);
268 /* Set up the main_reg_hash table. We use this instead of
269 * creating a symbol in the register section to avoid ambiguities
270 * with labels that have the same names as registers. */
271 main_reg_hash
= hash_new ();
272 for (i
= 0; i
< TILEPRO_NUM_REGISTERS
; i
++)
276 hash_insert (main_reg_hash
, tilepro_register_names
[i
],
277 (void *) (long)(i
| CANONICAL_REG_NAME_FLAG
));
279 /* See if we should insert a noncanonical alias, like r63. */
280 sprintf (buf
, "r%d", i
);
281 if (strcmp (buf
, tilepro_register_names
[i
]) != 0)
282 hash_insert (main_reg_hash
, xstrdup (buf
),
283 (void *) (long)(i
| NONCANONICAL_REG_NAME_FLAG
));
286 /* Insert obsolete backwards-compatibility register names. */
287 hash_insert (main_reg_hash
, "io0",
288 (void *) (long) (TREG_IDN0
| CANONICAL_REG_NAME_FLAG
));
289 hash_insert (main_reg_hash
, "io1",
290 (void *) (long) (TREG_IDN1
| CANONICAL_REG_NAME_FLAG
));
291 hash_insert (main_reg_hash
, "us0",
292 (void *) (long) (TREG_UDN0
| CANONICAL_REG_NAME_FLAG
));
293 hash_insert (main_reg_hash
, "us1",
294 (void *) (long) (TREG_UDN1
| CANONICAL_REG_NAME_FLAG
));
295 hash_insert (main_reg_hash
, "us2",
296 (void *) (long) (TREG_UDN2
| CANONICAL_REG_NAME_FLAG
));
297 hash_insert (main_reg_hash
, "us3",
298 (void *) (long) (TREG_UDN3
| CANONICAL_REG_NAME_FLAG
));
303 #define BUNDLE_TEMPLATE_MASK(p0, p1, p2) \
304 ((p0) | ((p1) << 8) | ((p2) << 16))
305 #define BUNDLE_TEMPLATE(p0, p1, p2) \
306 { { (p0), (p1), (p2) }, \
307 BUNDLE_TEMPLATE_MASK(1 << (p0), 1 << (p1), (1 << (p2))) \
310 #define NO_PIPELINE TILEPRO_NUM_PIPELINE_ENCODINGS
312 struct bundle_template
314 tilepro_pipeline pipe
[TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE
];
315 unsigned int pipe_mask
;
318 static const struct bundle_template bundle_templates
[] =
320 /* In Y format we must always have something in Y2, since it has
321 * no fnop, so this conveys that Y2 must always be used. */
322 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y0
, TILEPRO_PIPELINE_Y2
, NO_PIPELINE
),
323 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y1
, TILEPRO_PIPELINE_Y2
, NO_PIPELINE
),
324 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y0
, NO_PIPELINE
),
325 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y1
, NO_PIPELINE
),
327 /* Y format has three instructions. */
328 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y0
, TILEPRO_PIPELINE_Y1
, TILEPRO_PIPELINE_Y2
),
329 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y0
, TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y1
),
330 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y1
, TILEPRO_PIPELINE_Y0
, TILEPRO_PIPELINE_Y2
),
331 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y1
, TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y0
),
332 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y0
, TILEPRO_PIPELINE_Y1
),
333 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_Y2
, TILEPRO_PIPELINE_Y1
, TILEPRO_PIPELINE_Y0
),
335 /* X format has only two instructions. */
336 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_X0
, TILEPRO_PIPELINE_X1
, NO_PIPELINE
),
337 BUNDLE_TEMPLATE(TILEPRO_PIPELINE_X1
, TILEPRO_PIPELINE_X0
, NO_PIPELINE
)
342 prepend_nop_to_bundle (tilepro_mnemonic mnemonic
)
344 memmove (¤t_bundle
[1], ¤t_bundle
[0],
345 current_bundle_index
* sizeof current_bundle
[0]);
346 current_bundle
[0].opcode
= &tilepro_opcodes
[mnemonic
];
347 ++current_bundle_index
;
351 static tilepro_bundle_bits
352 insert_operand (tilepro_bundle_bits bits
,
353 const struct tilepro_operand
*operand
,
358 /* Range-check the immediate. */
359 int num_bits
= operand
->num_bits
;
361 operand_value
>>= operand
->rightshift
;
363 if (bfd_check_overflow (operand
->is_signed
364 ? complain_overflow_signed
365 : complain_overflow_unsigned
,
368 bfd_arch_bits_per_address (stdoutput
),
373 if (operand
->is_signed
)
375 min
= -(1 << (num_bits
- 1));
376 max
= (1 << (num_bits
- 1)) - 1;
381 max
= (1 << num_bits
) - 1;
383 as_bad_value_out_of_range (_("operand"), operand_value
, min
, max
,
387 /* Write out the bits for the immediate. */
388 return bits
| operand
->insert (operand_value
);
393 apply_special_operator (operatorT op
, int num
)
398 return (signed short)num
;
401 return (signed short)(num
>> 16);
404 return (signed short)((num
+ 0x8000) >> 16);
412 static tilepro_bundle_bits
413 emit_tilepro_instruction (tilepro_bundle_bits bits
,
415 const unsigned char *operands
,
416 expressionS
*operand_values
,
421 for (i
= 0; i
< num_operands
; i
++)
423 const struct tilepro_operand
*operand
=
424 &tilepro_operands
[operands
[i
]];
425 expressionS
*operand_exp
= &operand_values
[i
];
426 int is_pc_relative
= operand
->is_pc_relative
;
428 if (operand_exp
->X_op
== O_register
429 || (operand_exp
->X_op
== O_constant
&& !is_pc_relative
))
431 /* We know what the bits are right now, so insert them. */
432 bits
= insert_operand (bits
, operand
, operand_exp
->X_add_number
,
437 bfd_reloc_code_real_type reloc
= operand
->default_reloc
;
439 int die
= 0, use_subexp
= 0, require_symbol
= 0;
442 /* Take an expression like hi16(x) and turn it into x with
443 a different reloc type. */
444 switch (operand_exp
->X_op
)
446 #define HANDLE_OP16(suffix) \
449 case BFD_RELOC_TILEPRO_IMM16_X0: \
450 reloc = BFD_RELOC_TILEPRO_IMM16_X0_##suffix; \
452 case BFD_RELOC_TILEPRO_IMM16_X1: \
453 reloc = BFD_RELOC_TILEPRO_IMM16_X1_##suffix; \
479 HANDLE_OP16 (GOT_LO
);
484 HANDLE_OP16 (GOT_HI
);
489 HANDLE_OP16 (GOT_HA
);
494 HANDLE_OP16 (TLS_GD
);
499 HANDLE_OP16 (TLS_GD_LO
);
504 HANDLE_OP16 (TLS_GD_HI
);
509 HANDLE_OP16 (TLS_GD_HA
);
514 HANDLE_OP16 (TLS_IE
);
519 HANDLE_OP16 (TLS_IE_LO
);
524 HANDLE_OP16 (TLS_IE_HI
);
529 HANDLE_OP16 (TLS_IE_HA
);
534 HANDLE_OP16 (TLS_LE
);
539 HANDLE_OP16 (TLS_LE_LO
);
544 HANDLE_OP16 (TLS_LE_HI
);
549 HANDLE_OP16 (TLS_LE_HA
);
558 case BFD_RELOC_TILEPRO_JOFFLONG_X1
:
559 reloc
= BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT
;
572 case BFD_RELOC_TILEPRO_JOFFLONG_X1
:
573 reloc
= BFD_RELOC_TILEPRO_TLS_GD_CALL
;
586 case BFD_RELOC_TILEPRO_IMM8_X0
:
587 reloc
= BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD
;
589 case BFD_RELOC_TILEPRO_IMM8_X1
:
590 reloc
= BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD
;
592 case BFD_RELOC_TILEPRO_IMM8_Y0
:
593 reloc
= BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD
;
595 case BFD_RELOC_TILEPRO_IMM8_Y1
:
596 reloc
= BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD
;
609 case BFD_RELOC_TILEPRO_IMM8_X1
:
610 reloc
= BFD_RELOC_TILEPRO_TLS_IE_LOAD
;
627 as_bad (_("Invalid operator for operand."));
631 /* Now that we've changed the reloc, change ha16(x) into x,
634 if (operand_exp
->X_add_symbol
->sy_value
.X_md
)
636 /* HACK: We used X_md to mark this symbol as a fake wrapper
637 around a real expression. To unwrap it, we just grab its
639 operand_exp
= &operand_exp
->X_add_symbol
->sy_value
;
643 /* Look at the expression, and reject it if it's not a
645 if (operand_exp
->X_op
!= O_symbol
646 || operand_exp
->X_add_number
!= 0)
647 as_bad (_("Operator may only be applied to symbols."));
652 /* The value of this expression is an actual symbol, so
653 turn that into an expression. */
654 memset (&subexp
, 0, sizeof subexp
);
655 subexp
.X_op
= O_symbol
;
656 subexp
.X_add_symbol
= operand_exp
->X_add_symbol
;
657 operand_exp
= &subexp
;
661 /* Create a fixup to handle this later. */
662 fixP
= fix_new_exp (frag_now
,
663 bundle_start
- frag_now
->fr_literal
,
664 (operand
->num_bits
+ 7) >> 3,
668 fixP
->tc_fix_data
= operand
;
670 /* Don't do overflow checking if we are applying a function like
672 fixP
->fx_no_overflow
|= use_subexp
;
679 /* Detects and complains if two instructions in current_bundle write
680 to the same register, either implicitly or explicitly, or if a
681 read-only register is written. */
683 check_illegal_reg_writes (void)
685 BFD_HOST_U_64_BIT all_regs_written
= 0;
688 for (j
= 0; j
< current_bundle_index
; j
++)
690 const struct tilepro_instruction
*instr
= ¤t_bundle
[j
];
692 BFD_HOST_U_64_BIT regs
=
693 ((BFD_HOST_U_64_BIT
)1) << instr
->opcode
->implicitly_written_register
;
694 BFD_HOST_U_64_BIT conflict
;
696 for (k
= 0; k
< instr
->opcode
->num_operands
; k
++)
698 const struct tilepro_operand
*operand
=
699 &tilepro_operands
[instr
->opcode
->operands
[instr
->pipe
][k
]];
701 if (operand
->is_dest_reg
)
703 int regno
= instr
->operand_values
[k
].X_add_number
;
704 BFD_HOST_U_64_BIT mask
= ((BFD_HOST_U_64_BIT
)1) << regno
;
706 if ((mask
& ( (((BFD_HOST_U_64_BIT
)1) << TREG_IDN1
)
707 | (((BFD_HOST_U_64_BIT
)1) << TREG_UDN1
)
708 | (((BFD_HOST_U_64_BIT
)1) << TREG_UDN2
)
709 | (((BFD_HOST_U_64_BIT
)1) << TREG_UDN3
))) != 0
710 && !allow_suspicious_bundles
)
712 as_bad (_("Writes to register '%s' are not allowed."),
713 tilepro_register_names
[regno
]);
720 /* Writing to the zero register doesn't count. */
721 regs
&= ~(((BFD_HOST_U_64_BIT
)1) << TREG_ZERO
);
723 conflict
= all_regs_written
& regs
;
724 if (conflict
!= 0 && !allow_suspicious_bundles
)
726 /* Find which register caused the conflict. */
727 const char *conflicting_reg_name
= "???";
730 for (i
= 0; i
< TILEPRO_NUM_REGISTERS
; i
++)
732 if (((conflict
>> i
) & 1) != 0)
734 conflicting_reg_name
= tilepro_register_names
[i
];
739 as_bad (_("Two instructions in the same bundle both write "
740 "to register %s, which is not allowed."),
741 conflicting_reg_name
);
744 all_regs_written
|= regs
;
750 tilepro_flush_bundle (void)
754 unsigned compatible_pipes
;
755 const struct bundle_template
*match
;
760 switch (current_bundle_index
)
763 /* No instructions. */
766 if (current_bundle
[0].opcode
->can_bundle
)
768 /* Simplify later logic by adding an explicit fnop. */
769 prepend_nop_to_bundle (TILEPRO_OPC_FNOP
);
773 /* This instruction cannot be bundled with anything else.
774 Prepend an explicit 'nop', rather than an 'fnop', because
775 fnops can be replaced by later binary-processing tools
776 while nops cannot. */
777 prepend_nop_to_bundle (TILEPRO_OPC_NOP
);
781 if (!allow_suspicious_bundles
)
783 /* Make sure all instructions can be bundled with other
785 const struct tilepro_opcode
*cannot_bundle
= NULL
;
786 bfd_boolean seen_non_nop
= FALSE
;
788 for (j
= 0; j
< current_bundle_index
; j
++)
790 const struct tilepro_opcode
*op
= current_bundle
[j
].opcode
;
792 if (!op
->can_bundle
&& cannot_bundle
== NULL
)
794 else if (op
->mnemonic
!= TILEPRO_OPC_NOP
795 && op
->mnemonic
!= TILEPRO_OPC_INFO
796 && op
->mnemonic
!= TILEPRO_OPC_INFOL
)
800 if (cannot_bundle
!= NULL
&& seen_non_nop
)
802 current_bundle_index
= 0;
803 as_bad (_("'%s' may not be bundled with other instructions."),
804 cannot_bundle
->name
);
812 BUNDLE_TEMPLATE_MASK(current_bundle
[0].opcode
->pipes
,
813 current_bundle
[1].opcode
->pipes
,
814 (current_bundle_index
== 3
815 ? current_bundle
[2].opcode
->pipes
816 : (1 << NO_PIPELINE
)));
818 /* Find a template that works, if any. */
820 for (i
= 0; i
< sizeof bundle_templates
/ sizeof bundle_templates
[0]; i
++)
822 const struct bundle_template
*b
= &bundle_templates
[i
];
823 if ((b
->pipe_mask
& compatible_pipes
) == b
->pipe_mask
)
832 current_bundle_index
= 0;
833 as_bad (_("Invalid combination of instructions for bundle."));
837 /* If the section seems to have no alignment set yet, go ahead and
838 make it large enough to hold code. */
839 if (bfd_get_section_alignment (stdoutput
, now_seg
) == 0)
840 bfd_set_section_alignment (stdoutput
, now_seg
,
841 TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES
);
843 for (j
= 0; j
< current_bundle_index
; j
++)
844 current_bundle
[j
].pipe
= match
->pipe
[j
];
846 if (current_bundle_index
== 2 && !tilepro_is_x_pipeline(match
->pipe
[0]))
848 /* We are in Y mode with only two instructions, so add an FNOP. */
849 prepend_nop_to_bundle (TILEPRO_OPC_FNOP
);
851 /* Figure out what pipe the fnop must be in via arithmetic.
852 * p0 + p1 + p2 must sum to the sum of TILEPRO_PIPELINE_Y[012]. */
853 current_bundle
[0].pipe
=
854 (tilepro_pipeline
)((TILEPRO_PIPELINE_Y0
855 + TILEPRO_PIPELINE_Y1
856 + TILEPRO_PIPELINE_Y2
) -
857 (current_bundle
[1].pipe
+ current_bundle
[2].pipe
));
860 check_illegal_reg_writes ();
862 f
= frag_more (TILEPRO_BUNDLE_SIZE_IN_BYTES
);
864 /* Check to see if this bundle is at an offset that is a multiple of 8-bytes
865 from the start of the frag. */
866 addr_mod
= frag_now_fix () & (TILEPRO_BUNDLE_ALIGNMENT_IN_BYTES
- 1);
867 if (frag_now
->has_code
&& frag_now
->insn_addr
!= addr_mod
)
868 as_bad (_("instruction address is not a multiple of 8"));
869 frag_now
->insn_addr
= addr_mod
;
870 frag_now
->has_code
= 1;
872 tilepro_bundle_bits bits
= 0;
873 for (j
= 0; j
< current_bundle_index
; j
++)
875 struct tilepro_instruction
*instr
= ¤t_bundle
[j
];
876 tilepro_pipeline pipeline
= instr
->pipe
;
877 const struct tilepro_opcode
*opcode
= instr
->opcode
;
879 bits
|= emit_tilepro_instruction (opcode
->fixed_bit_values
[pipeline
],
880 opcode
->num_operands
,
881 &opcode
->operands
[pipeline
][0],
882 instr
->operand_values
,
886 number_to_chars_littleendian (f
, (unsigned int)bits
, 4);
887 number_to_chars_littleendian (f
+ 4, (unsigned int)(bits
>> 32), 4);
888 current_bundle_index
= 0;
890 /* Emit DWARF2 debugging information. */
891 dwarf2_emit_insn (TILEPRO_BUNDLE_SIZE_IN_BYTES
);
895 /* Extend the expression parser to handle hi16(label), etc.
896 as well as SPR names when in the context of parsing an SPR. */
898 tilepro_parse_name (char *name
, expressionS
*e
, char *nextcharP
)
900 operatorT op
= O_illegal
;
904 void *val
= hash_find (spr_hash
, name
);
908 memset (e
, 0, sizeof *e
);
909 e
->X_op
= O_constant
;
910 e
->X_add_number
= ((const struct tilepro_spr
*)val
)->number
;
914 if (*nextcharP
!= '(')
916 /* hi16, etc. not followed by a paren is just a label with that
922 /* Look up the operator in our table. */
923 void *val
= hash_find (special_operator_hash
, name
);
926 op
= (operatorT
)(long)val
;
929 /* Restore old '(' and skip it. */
930 *input_line_pointer
= '(';
931 ++input_line_pointer
;
935 if (*input_line_pointer
!= ')')
937 as_bad (_("Missing ')'"));
938 *nextcharP
= *input_line_pointer
;
942 ++input_line_pointer
;
944 if (e
->X_op
== O_register
|| e
->X_op
== O_absent
)
946 as_bad (_("Invalid expression."));
947 e
->X_op
= O_constant
;
952 /* Wrap subexpression with a unary operator. */
953 symbolS
*sym
= make_expr_symbol (e
);
955 if (sym
!= e
->X_add_symbol
)
957 /* HACK: mark this symbol as a temporary wrapper around a proper
958 expression, so we can unwrap it later once we have communicated
959 the relocation type. */
960 sym
->sy_value
.X_md
= 1;
963 memset (e
, 0, sizeof *e
);
965 e
->X_add_symbol
= sym
;
969 *nextcharP
= *input_line_pointer
;
974 /* Parses an expression which must be a register name. */
977 parse_reg_expression (expressionS
* expression
)
979 /* Zero everything to make sure we don't miss any flags. */
980 memset (expression
, 0, sizeof *expression
);
982 char* regname
= input_line_pointer
;
983 char terminating_char
= get_symbol_end ();
985 void* pval
= hash_find (main_reg_hash
, regname
);
988 as_bad (_("Expected register, got '%s'."), regname
);
990 int regno_and_flags
= (int)(size_t)pval
;
991 int regno
= EXTRACT_REGNO(regno_and_flags
);
993 if ((regno_and_flags
& NONCANONICAL_REG_NAME_FLAG
)
994 && require_canonical_reg_names
)
995 as_warn (_("Found use of non-canonical register name %s; "
997 regname
, tilepro_register_names
[regno
]);
999 /* Restore the old character following the register name. */
1000 *input_line_pointer
= terminating_char
;
1002 /* Fill in the expression fields to indicate it's a register. */
1003 expression
->X_op
= O_register
;
1004 expression
->X_add_number
= regno
;
1008 /* Parses and type-checks comma-separated operands in input_line_pointer. */
1010 parse_operands (const char *opcode_name
,
1011 const unsigned char *operands
,
1013 expressionS
*operand_values
)
1017 memset (operand_values
, 0, num_operands
* sizeof operand_values
[0]);
1020 for (i
= 0; i
< num_operands
; i
++)
1022 tilepro_operand_type type
= tilepro_operands
[operands
[i
]].type
;
1026 if (type
== TILEPRO_OP_TYPE_REGISTER
)
1028 parse_reg_expression (&operand_values
[i
]);
1030 else if (*input_line_pointer
== '}')
1032 operand_values
[i
].X_op
= O_absent
;
1034 else if (type
== TILEPRO_OP_TYPE_SPR
)
1036 /* Modify the expression parser to add SPRs to the namespace. */
1038 expression (&operand_values
[i
]);
1043 expression (&operand_values
[i
]);
1048 if (i
+ 1 < num_operands
)
1050 int separator
= (unsigned char)*input_line_pointer
++;
1052 if (is_end_of_line
[separator
] || (separator
== '}'))
1054 as_bad (_("Too few operands to '%s'."), opcode_name
);
1057 else if (separator
!= ',')
1059 as_bad (_("Unexpected character '%c' after operand %d to %s."),
1060 (char)separator
, i
+ 1, opcode_name
);
1065 /* Arbitrarily use the first valid pipe to get the operand type,
1066 since they are all the same. */
1067 switch (tilepro_operands
[operands
[i
]].type
)
1069 case TILEPRO_OP_TYPE_REGISTER
:
1070 /* Handled in parse_reg_expression already. */
1072 case TILEPRO_OP_TYPE_SPR
:
1074 case TILEPRO_OP_TYPE_IMMEDIATE
:
1076 case TILEPRO_OP_TYPE_ADDRESS
:
1077 if ( operand_values
[i
].X_op
== O_register
1078 || operand_values
[i
].X_op
== O_illegal
1079 || operand_values
[i
].X_op
== O_absent
)
1080 as_bad (_("Expected immediate expression"));
1087 if (!is_end_of_line
[(unsigned char)*input_line_pointer
])
1089 switch (*input_line_pointer
)
1093 as_bad (_("Found '}' when not bundling."));
1094 ++input_line_pointer
;
1096 demand_empty_rest_of_line ();
1100 as_bad (_("Too many operands"));
1104 /* Use default error for unrecognized garbage. */
1105 demand_empty_rest_of_line ();
1112 /* This is the guts of the machine-dependent assembler. STR points to a
1113 machine dependent instruction. This function is supposed to emit
1114 the frags/bytes it assembles to. */
1116 md_assemble (char *str
)
1120 char *old_input_line_pointer
;
1121 const struct tilepro_opcode
*op
;
1124 /* Split off the opcode and look it up. */
1125 opname_len
= strcspn (str
, " {}");
1126 old_char
= str
[opname_len
];
1127 str
[opname_len
] = '\0';
1129 op
= hash_find(op_hash
, str
);
1130 str
[opname_len
] = old_char
;
1133 as_bad (_("Unknown opcode `%.*s'."), (int)opname_len
, str
);
1137 /* Prepare to parse the operands. */
1138 old_input_line_pointer
= input_line_pointer
;
1139 input_line_pointer
= str
+ opname_len
;
1142 if (current_bundle_index
== TILEPRO_MAX_INSTRUCTIONS_PER_BUNDLE
)
1144 as_bad (_("Too many instructions for bundle."));
1145 tilepro_flush_bundle ();
1148 /* Make sure we have room for the upcoming bundle before we
1149 create any fixups. Otherwise if we have to switch to a new
1150 frag the fixup dot_value fields will be wrong. */
1151 frag_grow (TILEPRO_BUNDLE_SIZE_IN_BYTES
);
1153 /* Find a valid pipe for this opcode. */
1154 for (first_pipe
= 0; (op
->pipes
& (1 << first_pipe
)) == 0; first_pipe
++)
1157 /* Call the function that assembles this instruction. */
1158 current_bundle
[current_bundle_index
].opcode
= op
;
1159 parse_operands (op
->name
,
1160 &op
->operands
[first_pipe
][0],
1162 current_bundle
[current_bundle_index
].operand_values
);
1163 ++current_bundle_index
;
1165 /* Restore the saved value of input_line_pointer. */
1166 input_line_pointer
= old_input_line_pointer
;
1168 /* If we weren't inside curly braces, go ahead and emit
1169 this lone instruction as a bundle right now. */
1171 tilepro_flush_bundle ();
1175 s_require_canonical_reg_names (int require
)
1177 demand_empty_rest_of_line ();
1178 require_canonical_reg_names
= require
;
1182 s_allow_suspicious_bundles (int allow
)
1184 demand_empty_rest_of_line ();
1185 allow_suspicious_bundles
= allow
;
1188 const pseudo_typeS md_pseudo_table
[] =
1190 {"align", s_align_bytes
, 0}, /* Defaulting is invalid (0). */
1192 {"require_canonical_reg_names", s_require_canonical_reg_names
, 1 },
1193 {"no_require_canonical_reg_names", s_require_canonical_reg_names
, 0 },
1194 {"allow_suspicious_bundles", s_allow_suspicious_bundles
, 1 },
1195 {"no_allow_suspicious_bundles", s_allow_suspicious_bundles
, 0 },
1199 /* Equal to MAX_PRECISION in atof-ieee.c */
1200 #define MAX_LITTLENUMS 6
1202 /* Turn the string pointed to by litP into a floating point constant
1203 of type TYPE, and emit the appropriate bytes. The number of
1204 LITTLENUMS emitted is stored in *SIZEP. An error message is
1205 returned, or NULL on OK. */
1208 md_atof (int type
, char *litP
, int *sizeP
)
1211 LITTLENUM_TYPE words
[MAX_LITTLENUMS
];
1212 LITTLENUM_TYPE
*wordP
;
1229 return _("Bad call to md_atof ()");
1231 t
= atof_ieee (input_line_pointer
, type
, words
);
1233 input_line_pointer
= t
;
1235 *sizeP
= prec
* sizeof (LITTLENUM_TYPE
);
1236 /* This loops outputs the LITTLENUMs in REVERSE order; in accord with
1237 the bigendian 386. */
1238 for (wordP
= words
+ prec
- 1; prec
--;)
1240 md_number_to_chars (litP
, (valueT
) (*wordP
--), sizeof (LITTLENUM_TYPE
));
1241 litP
+= sizeof (LITTLENUM_TYPE
);
1247 /* We have no need to default values of symbols. */
1250 md_undefined_symbol (char *name ATTRIBUTE_UNUSED
)
1257 tilepro_cons_fix_new (fragS
*frag
,
1263 bfd_reloc_code_real_type reloc
= BFD_RELOC_NONE
;
1264 int no_overflow
= 0;
1267 /* See if it's one of our special functions. */
1271 reloc
= BFD_RELOC_LO16
;
1275 reloc
= BFD_RELOC_HI16
;
1279 reloc
= BFD_RELOC_HI16_S
;
1288 if (reloc
!= BFD_RELOC_NONE
)
1292 as_bad (_("This operator only produces two byte values."));
1296 memset (&subexp
, 0, sizeof subexp
);
1297 subexp
.X_op
= O_symbol
;
1298 subexp
.X_add_symbol
= exp
->X_add_symbol
;
1306 reloc
= BFD_RELOC_8
;
1309 reloc
= BFD_RELOC_16
;
1312 reloc
= BFD_RELOC_32
;
1315 reloc
= BFD_RELOC_64
;
1318 as_bad (_("unsupported BFD relocation size %d"), nbytes
);
1319 reloc
= BFD_RELOC_32
;
1324 fixP
= fix_new_exp (frag
, where
, nbytes
, exp
, 0, reloc
);
1325 fixP
->tc_fix_data
= NULL
;
1326 fixP
->fx_no_overflow
|= no_overflow
;
1331 md_apply_fix (fixS
*fixP
, valueT
* valP
, segT seg ATTRIBUTE_UNUSED
)
1333 const struct tilepro_operand
*operand
;
1334 valueT value
= *valP
;
1337 /* Leave these for the linker. */
1338 if (fixP
->fx_r_type
== BFD_RELOC_VTABLE_INHERIT
1339 || fixP
->fx_r_type
== BFD_RELOC_VTABLE_ENTRY
)
1342 if (fixP
->fx_subsy
!= (symbolS
*) NULL
)
1344 /* We can't actually support subtracting a symbol. */
1345 as_bad_where (fixP
->fx_file
, fixP
->fx_line
, _("expression too complex"));
1348 /* Correct relocation types for pc-relativeness. */
1349 switch (fixP
->fx_r_type
)
1351 #define FIX_PCREL(rtype) \
1353 if (fixP->fx_pcrel) \
1354 fixP->fx_r_type = rtype##_PCREL; \
1357 case rtype##_PCREL: \
1358 if (!fixP->fx_pcrel) \
1359 fixP->fx_r_type = rtype; \
1362 FIX_PCREL (BFD_RELOC_8
);
1363 FIX_PCREL (BFD_RELOC_16
);
1364 FIX_PCREL (BFD_RELOC_32
);
1365 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X0
);
1366 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X1
);
1367 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X0_LO
);
1368 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X1_LO
);
1369 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X0_HI
);
1370 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X1_HI
);
1371 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X0_HA
);
1372 FIX_PCREL (BFD_RELOC_TILEPRO_IMM16_X1_HA
);
1381 if (fixP
->fx_addsy
!= NULL
)
1384 switch (fixP
->fx_r_type
)
1386 case BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD
:
1387 case BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD
:
1388 case BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD
:
1389 case BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD
:
1390 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD
:
1391 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD
:
1392 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO
:
1393 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO
:
1394 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI
:
1395 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI
:
1396 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA
:
1397 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA
:
1398 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE
:
1399 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE
:
1400 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO
:
1401 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO
:
1402 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI
:
1403 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI
:
1404 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA
:
1405 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA
:
1406 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE
:
1407 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE
:
1408 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO
:
1409 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO
:
1410 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI
:
1411 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI
:
1412 case BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA
:
1413 case BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA
:
1414 case BFD_RELOC_TILEPRO_TLS_GD_CALL
:
1415 case BFD_RELOC_TILEPRO_TLS_IE_LOAD
:
1416 case BFD_RELOC_TILEPRO_TLS_DTPMOD32
:
1417 case BFD_RELOC_TILEPRO_TLS_DTPOFF32
:
1418 case BFD_RELOC_TILEPRO_TLS_TPOFF32
:
1419 S_SET_THREAD_LOCAL (fixP
->fx_addsy
);
1430 /* Apply lo16, hi16, ha16, etc. munging. */
1431 switch (fixP
->fx_r_type
)
1433 case BFD_RELOC_LO16
:
1434 case BFD_RELOC_TILEPRO_IMM16_X0_LO
:
1435 case BFD_RELOC_TILEPRO_IMM16_X1_LO
:
1436 case BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL
:
1437 case BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL
:
1438 *valP
= value
= apply_special_operator (O_lo16
, value
);
1441 case BFD_RELOC_HI16
:
1442 case BFD_RELOC_TILEPRO_IMM16_X0_HI
:
1443 case BFD_RELOC_TILEPRO_IMM16_X1_HI
:
1444 case BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL
:
1445 case BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL
:
1446 *valP
= value
= apply_special_operator (O_hi16
, value
);
1449 case BFD_RELOC_HI16_S
:
1450 case BFD_RELOC_TILEPRO_IMM16_X0_HA
:
1451 case BFD_RELOC_TILEPRO_IMM16_X1_HA
:
1452 case BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL
:
1453 case BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL
:
1454 *valP
= value
= apply_special_operator (O_ha16
, value
);
1462 p
= fixP
->fx_frag
->fr_literal
+ fixP
->fx_where
;
1464 operand
= fixP
->tc_fix_data
;
1465 if (operand
!= NULL
)
1467 /* It's an instruction operand. */
1468 tilepro_bundle_bits bits
=
1469 insert_operand (0, operand
, value
, fixP
->fx_file
, fixP
->fx_line
);
1471 /* Note that we might either be writing out bits for a bundle or a
1472 static network instruction, which are different sizes, so it's
1473 important to stop touching memory once we run out of bits. ORing in
1474 values is OK since we know the existing bits for this operand are
1476 for (; bits
!= 0; bits
>>= 8)
1481 /* Some other kind of relocation. */
1482 switch (fixP
->fx_r_type
)
1485 case BFD_RELOC_8_PCREL
:
1486 md_number_to_chars (p
, value
, 1);
1490 case BFD_RELOC_16_PCREL
:
1491 md_number_to_chars (p
, value
, 2);
1495 case BFD_RELOC_32_PCREL
:
1496 md_number_to_chars (p
, value
, 4);
1500 /* Leave it for the linker. */
1509 /* Generate the BFD reloc to be stuck in the object file from the
1510 fixup used internally in the assembler. */
1513 tc_gen_reloc (asection
*sec ATTRIBUTE_UNUSED
, fixS
*fixp
)
1517 reloc
= (arelent
*) xmalloc (sizeof (arelent
));
1518 reloc
->sym_ptr_ptr
= (asymbol
**) xmalloc (sizeof (asymbol
*));
1519 *reloc
->sym_ptr_ptr
= symbol_get_bfdsym (fixp
->fx_addsy
);
1520 reloc
->address
= fixp
->fx_frag
->fr_address
+ fixp
->fx_where
;
1522 /* Make sure none of our internal relocations make it this far.
1523 They'd better have been fully resolved by this point. */
1524 gas_assert ((int) fixp
->fx_r_type
> 0);
1526 reloc
->howto
= bfd_reloc_type_lookup (stdoutput
, fixp
->fx_r_type
);
1527 if (reloc
->howto
== NULL
)
1529 as_bad_where (fixp
->fx_file
, fixp
->fx_line
,
1530 _("cannot represent `%s' relocation in object file"),
1531 bfd_get_reloc_code_name (fixp
->fx_r_type
));
1535 if (!fixp
->fx_pcrel
!= !reloc
->howto
->pc_relative
)
1537 as_fatal (_("internal error? cannot generate `%s' relocation (%d, %d)"),
1538 bfd_get_reloc_code_name (fixp
->fx_r_type
),
1539 fixp
->fx_pcrel
, reloc
->howto
->pc_relative
);
1541 gas_assert (!fixp
->fx_pcrel
== !reloc
->howto
->pc_relative
);
1543 reloc
->addend
= fixp
->fx_offset
;
1549 /* The location from which a PC relative jump should be calculated,
1550 given a PC relative reloc. */
1553 md_pcrel_from (fixS
*fixP
)
1555 return fixP
->fx_frag
->fr_address
+ fixP
->fx_where
;
1559 /* Return 1 if it's OK to adjust a reloc by replacing the symbol with
1560 a section symbol plus some offset. */
1562 tilepro_fix_adjustable (fixS
*fix
)
1564 /* Prevent all adjustments to global symbols */
1565 if (S_IS_EXTERNAL (fix
->fx_addsy
) || S_IS_WEAK (fix
->fx_addsy
))
1573 tilepro_unrecognized_line (int ch
)
1580 as_bad (_("Found '{' when already bundling."));
1585 current_bundle_index
= 0;
1592 as_bad (_("Found '}' when not bundling."));
1596 tilepro_flush_bundle ();
1599 /* Allow '{' to follow on the same line. We also allow ";;", but that
1600 happens automatically because ';' is an end of line marker. */
1602 if (input_line_pointer
[0] == '{')
1604 input_line_pointer
++;
1605 return tilepro_unrecognized_line ('{');
1608 demand_empty_rest_of_line ();
1615 /* Not a valid line. */
1620 /* This is called from HANDLE_ALIGN in write.c. Fill in the contents
1621 of an rs_align_code fragment. */
1624 tilepro_handle_align (fragS
*fragp
)
1629 if (fragp
->fr_type
!= rs_align_code
)
1632 bytes
= fragp
->fr_next
->fr_address
- fragp
->fr_address
- fragp
->fr_fix
;
1633 p
= fragp
->fr_literal
+ fragp
->fr_fix
;
1636 /* Determine the bits for NOP. */
1637 const struct tilepro_opcode
*nop_opcode
=
1638 &tilepro_opcodes
[TILEPRO_OPC_NOP
];
1639 tilepro_bundle_bits nop
=
1640 ( nop_opcode
->fixed_bit_values
[TILEPRO_PIPELINE_X0
]
1641 | nop_opcode
->fixed_bit_values
[TILEPRO_PIPELINE_X1
]);
1643 if ((bytes
& (TILEPRO_BUNDLE_SIZE_IN_BYTES
- 1)) != 0)
1645 fix
= bytes
& (TILEPRO_BUNDLE_SIZE_IN_BYTES
- 1);
1651 number_to_chars_littleendian (p
, (unsigned int)nop
, 4);
1652 number_to_chars_littleendian (p
+ 4, (unsigned int)(nop
>> 32), 4);
1653 fragp
->fr_fix
+= fix
;
1654 fragp
->fr_var
= TILEPRO_BUNDLE_SIZE_IN_BYTES
;
1657 /* Standard calling conventions leave the CFA at SP on entry. */
1659 tilepro_cfi_frame_initial_instructions (void)
1661 cfi_add_CFA_def_cfa_register (54);
1665 tc_tilepro_regname_to_dw2regnum (char *regname
)
1669 for (i
= 0; i
< TILEPRO_NUM_REGISTERS
; i
++)
1671 if (!strcmp (regname
, tilepro_register_names
[i
]))