int len;
{
char sbuf[C4X_ASCII_LIMIT + 1];
- int s, first, onlys;
+ int s, l, special, first, onlys;
if (len)
{
first = 1;
}
- for (s = 0; len > 0; --len, ++ptr)
+ for (s = l = 0; len > 0; --len, ++ptr)
{
onlys = 0;
/* Escape " and \ with a \". */
- if (*ptr == '\"' || *ptr == '\\')
- sbuf[s++] = '\\';
+ special = *ptr == '\"' || *ptr == '\\';
/* If printable - add to buff. */
- if (*ptr >= 0x20 && *ptr < 0x7f)
+ if ((! TARGET_TI || ! special) && *ptr >= 0x20 && *ptr < 0x7f)
{
+ if (special)
+ sbuf[s++] = '\\';
sbuf[s++] = *ptr;
if (s < C4X_ASCII_LIMIT - 1)
continue;
if (first)
first = 0;
else
- fputc (',', stream);
+ {
+ fputc (',', stream);
+ l++;
+ }
sbuf[s] = 0;
fprintf (stream, "\"%s\"", sbuf);
+ l += s + 2;
+ if (TARGET_TI && l >= 80 && len > 1)
+ {
+ fprintf (stream, "\n\t.byte\t");
+ first = 1;
+ l = 0;
+ }
+
s = 0;
}
if (onlys)
if (first)
first = 0;
else
- fputc (',', stream);
+ {
+ fputc (',', stream);
+ l++;
+ }
fprintf (stream, "%d", *ptr);
+ l += 3;
+ if (TARGET_TI && l >= 80 && len > 1)
+ {
+ fprintf (stream, "\n\t.byte\t");
+ first = 1;
+ l = 0;
+ }
}
if (s)
{
{
fprintf (file, "\tpush\t%s\n", reg_names[regno]);
if (IS_EXT_REGNO (regno)) /* Save 32MSB of R0--R11. */
- fprintf (file, "\tpushf\t%s\n", float_reg_names[regno]);
+ fprintf (file, "\tpushf\t%s\n",
+ TARGET_TI ? reg_names[regno]
+ : float_reg_names[regno]);
}
}
/* We need to clear the repeat mode flag if the ISR is
/* R6 and R7 are saved as floating point. */
if (TARGET_PRESERVE_FLOAT)
fprintf (file, "\tpush\t%s\n", reg_names[regno]);
- fprintf (file, "\tpushf\t%s\n", float_reg_names[regno]);
+ fprintf (file, "\tpushf\t%s\n",
+ TARGET_TI ? reg_names[regno]
+ : float_reg_names[regno]);
}
else if ((! dont_push_ar3) || (regno != AR3_REGNO))
{
if (! c4x_isr_reg_used_p (regno))
continue;
if (IS_EXT_REGNO (regno))
- fprintf (file, "\tpopf\t%s\n", float_reg_names[regno]);
+ fprintf (file, "\tpopf\t%s\n",
+ TARGET_TI ? reg_names[regno]
+ : float_reg_names[regno]);
fprintf (file, "\tpop\t%s\n", reg_names[regno]);
}
if (size)
/* R6 and R7 are saved as floating point. */
if ((regno == R6_REGNO) || (regno == R7_REGNO))
{
- fprintf (file, "\tpopf\t%s\n", float_reg_names[regno]);
+ fprintf (file, "\tpopf\t%s\n",
+ TARGET_TI ? reg_names[regno]
+ : float_reg_names[regno]);
if (TARGET_PRESERVE_FLOAT)
{
restore_count--;
switch (letter)
{
case 'A': /* Direct address. */
- if (code == CONST_INT || code == SYMBOL_REF)
+ if (code == CONST_INT || code == SYMBOL_REF || code == CONST)
asm_fprintf (file, "@");
break;
op1 = XEXP (XEXP (op, 0), 1);
if (GET_CODE(op1) == CONST_INT || GET_CODE(op1) == SYMBOL_REF)
{
- asm_fprintf (file, "\t%s\t", TARGET_C3X ? "ldp" : "ldpk");
+ asm_fprintf (file, "\t%s\t@", TARGET_C3X ? "ldp" : "ldpk");
output_address (XEXP (adj_offsettable_operand (op, 1), 0));
asm_fprintf (file, "\n");
}
&& (GET_CODE (XEXP (op, 0)) == CONST
|| GET_CODE (XEXP (op, 0)) == SYMBOL_REF))
{
- asm_fprintf (file, "%s\t", TARGET_C3X ? "ldp" : "ldpk");
+ asm_fprintf (file, "%s\t@", TARGET_C3X ? "ldp" : "ldpk");
output_address (XEXP (op, 0));
asm_fprintf (file, "\n\t");
}
switch (code)
{
case REG:
- if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT)
+ if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
+ && ! TARGET_TI)
fprintf (file, "%s", float_reg_names[REGNO (op)]);
else
fprintf (file, "%s", reg_names[REGNO (op)]);
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "hwint.h"
+
/* RUN-TIME TARGET SPECIFICATION. */
#define C4x 1
const_section (); \
}
+/* The TI assembler wants to have hex numbers this way. */
+
+#undef HOST_WIDE_INT_PRINT_HEX
+#ifndef HOST_WIDE_INT_PRINT_HEX
+# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
+# define HOST_WIDE_INT_PRINT_HEX "0%xh"
+# else
+# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
+# define HOST_WIDE_INT_PRINT_HEX "0%lxh"
+# else
+# define HOST_WIDE_INT_PRINT_HEX "0%llxh"
+# endif
+# endif
+#endif /* ! HOST_WIDE_INT_PRINT_HEX */
+
/* A C statement or statements to switch to the appropriate
section for output of RTX in mode MODE. RTX is some kind
of constant in RTL. The argument MODE is redundant except
(define_insn "set_high"
[(set (match_operand:QI 0 "std_reg_operand" "=c")
(high:QI (match_operand:QI 1 "symbolic_address_operand" "")))]
- "! TARGET_C3X "
+ "! TARGET_C3X && ! TARGET_TI"
"ldhi\\t^%H1,%0"
[(set_attr "type" "unary")])
[(set (match_operand:QI 0 "std_reg_operand" "=c")
(lo_sum:QI (match_dup 0)
(match_operand:QI 1 "symbolic_address_operand" "")))]
- ""
+ "! TARGET_TI"
"or\\t#%H1,%0"
[(set_attr "type" "unary")])
(define_split
[(set (match_operand:QI 0 "std_reg_operand" "")
(match_operand:QI 1 "symbolic_address_operand" ""))]
- "! TARGET_C3X"
+ "! TARGET_C3X && ! TARGET_TI"
[(set (match_dup 0) (high:QI (match_dup 1)))
(set (match_dup 0) (lo_sum:QI (match_dup 0) (match_dup 1)))]
"")
[(set (match_operand:QI 0 "reg_operand" "")
(match_operand:QI 1 "symbolic_address_operand" ""))]
"! TARGET_SMALL
- && (TARGET_C3X || (reload_completed
- && ! std_reg_operand (operands[0], QImode)))"
+ && (TARGET_C3X || TARGET_TI
+ || (reload_completed
+ && ! std_reg_operand (operands[0], QImode)))"
[(set (match_dup 2) (high:QI (match_dup 3)))
(set (match_dup 0) (match_dup 4))
(use (match_dup 1))]
[(set (match_operand:QI 0 "reg_operand" "")
(match_operand:QI 1 "symbolic_address_operand" ""))]
"TARGET_SMALL
- && (TARGET_C3X || (reload_completed
- && ! std_reg_operand (operands[0], QImode)))"
+ && (TARGET_C3X || TARGET_TI
+ || (reload_completed
+ && ! std_reg_operand (operands[0], QImode)))"
[(set (match_dup 0) (match_dup 2))
(use (match_dup 1))]
"