This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] tic4x support in gas
- From: "Svein E. Seldal" <Svein dot Seldal at solidas dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 26 Sep 2002 13:37:39 +0200
- Subject: [patch] tic4x support in gas
Hello
The tic4x target is a integer/floating-point DSP. Now, this also implies
that it has opcodes that you can use immediate flonums in instructions:
ldf 3.141592, f0
gas (or more specific: expr.c) does not has support for this. This patch
adds the necessary support for this.
Svein
PS! A (gas) testsuite for tic4x is on its way, so all of you humble
maintainers can use make check on the tic4x target soon. :)
gas/ChangeLog:
2002-09-26 Svein E. Seldal <Svein.Seldal@solidas.com>
* expr.c: Added support for immediate CPU operands containing flonums.
Index: expr.c
===================================================================
RCS file: /cvs/src/src/gas/expr.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 expr.c
*** expr.c 20 Sep 2002 00:58:39 -0000 1.45
--- expr.c 26 Sep 2002 11:30:18 -0000
*************** operand (expressionP)
*** 841,846 ****
--- 841,852 ----
c = *input_line_pointer;
switch (c)
{
+ #ifdef TC_TIC4X
+ case '.': /* 0. */
+ floating_constant (expressionP);
+ break;
+ #endif
+
case 'o':
case 'O':
case 'q':
*************** operand (expressionP)
*** 1079,1084 ****
--- 1085,1100 ----
else
expressionP->X_add_number = ! expressionP->X_add_number;
}
+ #ifdef TC_TIC4X
+ else if (expressionP->X_op == O_big && expressionP->X_add_number <= 0)
+ {
+ /* Negative flonum (eg, -1.000e0). */
+ if (generic_floating_point_number.sign == '+')
+ generic_floating_point_number.sign = '-';
+ else if (generic_floating_point_number.sign == 'P')
+ generic_floating_point_number.sign = 'N';
+ }
+ #endif
else if (expressionP->X_op != O_illegal
&& expressionP->X_op != O_absent)
{