PATCH: Fix real10 and add real16 for ia64
H. J. Lu
hjl@lucon.org
Wed Apr 30 19:46:00 GMT 2003
On Wed, Apr 30, 2003 at 12:43:19PM -0400, Jim Wilson wrote:
> On Wed, 2003-04-30 at 15:14, H. J. Lu wrote:
> > That is why I put .lsb there.
>
> Oh, right. I saw the LSB comment in the real.d file, but missed the
> .lsb directive in the real.s file. My mistake. So the testsuite is
> endian safe, but there is still the question of big endian support for
> the .real10 directive.
>
Is this patch OK?
H.J.
-------------- next part --------------
gas/
2003-04-30 H.J. Lu <hjl@gnu.org>
* config/tc-ia64.c (stmt_float_cons): Fix alignment for real10
and add real16.
(md_pseudo_table): Add "xreal16", "xreal16.ua", "real16" and
"real16.ua".
(md_atof): Add 6 byte padding of zero for real16.
gas/testsuite/
2003-04-29 H.J. Lu <hjl@gnu.org>
* gas/ia64/ia64.exp: Add real.
* gas/ia64/real.s: New file.
* gas/ia64/real.d: Likewise.
--- gas/config/tc-ia64.c.real 2003-04-30 12:18:43.000000000 -0700
+++ gas/config/tc-ia64.c 2003-04-30 12:41:11.000000000 -0700
@@ -4417,19 +4417,25 @@ static void
stmt_float_cons (kind)
int kind;
{
- size_t size;
+ size_t alignment;
switch (kind)
{
- case 'd': size = 8; break;
- case 'x': size = 10; break;
+ case 'd':
+ alignment = 8;
+ break;
+
+ case 'x':
+ case 'X':
+ alignment = 16;
+ break;
case 'f':
default:
- size = 4;
+ alignment = 4;
break;
}
- ia64_do_align (size);
+ ia64_do_align (alignment);
float_cons (kind);
}
@@ -4906,6 +4912,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "xreal4", dot_xfloat_cons, 'f' },
{ "xreal8", dot_xfloat_cons, 'd' },
{ "xreal10", dot_xfloat_cons, 'x' },
+ { "xreal16", dot_xfloat_cons, 'X' },
{ "xstring", dot_xstringer, 0 },
{ "xstringz", dot_xstringer, 1 },
@@ -4916,6 +4923,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "xreal4.ua", dot_xfloat_cons_ua, 'f' },
{ "xreal8.ua", dot_xfloat_cons_ua, 'd' },
{ "xreal10.ua", dot_xfloat_cons_ua, 'x' },
+ { "xreal16.ua", dot_xfloat_cons_ua, 'X' },
/* annotations/DV checking support */
{ "entry", dot_entry, 0 },
@@ -4959,6 +4967,7 @@ pseudo_opcode[] =
{ "real4", stmt_float_cons, 'f' },
{ "real8", stmt_float_cons, 'd' },
{ "real10", stmt_float_cons, 'x' },
+ { "real16", stmt_float_cons, 'X' },
{ "string", stringer, 0 },
{ "stringz", stringer, 1 },
@@ -4970,6 +4979,7 @@ pseudo_opcode[] =
{ "real4.ua", float_cons, 'f' },
{ "real8.ua", float_cons, 'd' },
{ "real10.ua", float_cons, 'x' },
+ { "real16.ua", float_cons, 'X' },
};
/* Declare a register by creating a symbol for it and entering it in
@@ -10593,6 +10603,12 @@ md_atof (type, lit, size)
md_number_to_chars (lit, (long) (*word--), sizeof (LITTLENUM_TYPE));
lit += sizeof (LITTLENUM_TYPE);
}
+ if (type == 'X')
+ {
+ /* It is 10 byte floating point with 6 byte padding. */
+ memset (lit, 0, 6);
+ *size = 8 * sizeof (LITTLENUM_TYPE);
+ }
return 0;
}
--- gas/testsuite/gas/ia64/ia64.exp.real 2003-04-30 12:18:43.000000000 -0700
+++ gas/testsuite/gas/ia64/ia64.exp 2003-04-30 12:19:54.000000000 -0700
@@ -45,4 +45,5 @@ if [istarget "ia64-*"] then {
run_dump_test "unwind"
run_dump_test "secname"
run_dump_test "global"
+ run_dump_test "real"
}
--- gas/testsuite/gas/ia64/real.d.real 2003-04-30 12:18:43.000000000 -0700
+++ gas/testsuite/gas/ia64/real.d 2003-04-30 12:18:43.000000000 -0700
@@ -0,0 +1,10 @@
+#objdump: -s -j .data
+#name: ia64 real10 and real16 (LSB)
+
+.*: +file format .*
+
+Contents of section .data:
+ 0000 ffcdcccc cccccccc ccfc3f00 00000000 ................
+ 0010 cdcccccc cccccccc fc3fffcd cccccccc ................
+ 0020 ccccccfb 3f000000 00000000 00000000 ................
+ 0030 cdcccccc cccccccc fb3f0000 00000000 ................
--- gas/testsuite/gas/ia64/real.s.real 2003-04-30 12:18:43.000000000 -0700
+++ gas/testsuite/gas/ia64/real.s 2003-04-30 12:18:43.000000000 -0700
@@ -0,0 +1,8 @@
+ .data
+ .lsb
+ data1 -1
+ real10.ua 0.2
+ real10 0.2
+ data1 -1
+ real16.ua 0.1
+ real16 0.1
More information about the Binutils
mailing list