[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dotgnu-pnet-commits] pnet ChangeLog ilasm/ilasm_grammar.y dumpasm/du...
From: |
Klaus Treichel |
Subject: |
[dotgnu-pnet-commits] pnet ChangeLog ilasm/ilasm_grammar.y dumpasm/du... |
Date: |
Fri, 16 Mar 2007 17:38:54 +0000 |
CVSROOT: /cvsroot/dotgnu-pnet
Module name: pnet
Changes by: Klaus Treichel <ktreichel> 07/03/16 17:38:54
Modified files:
. : ChangeLog
ilasm : ilasm_grammar.y
dumpasm : dump_const.c
engine : lib_misc.c
Log message:
Fix build with the kernel profile. Tools are still not supported with
profiles without fp support.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3435&r2=1.3436
http://cvs.savannah.gnu.org/viewcvs/pnet/ilasm/ilasm_grammar.y?cvsroot=dotgnu-pnet&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/pnet/dumpasm/dump_const.c?cvsroot=dotgnu-pnet&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pnet/engine/lib_misc.c?cvsroot=dotgnu-pnet&r1=1.16&r2=1.17
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3435
retrieving revision 1.3436
diff -u -b -r1.3435 -r1.3436
--- ChangeLog 16 Mar 2007 17:23:56 -0000 1.3435
+++ ChangeLog 16 Mar 2007 17:38:54 -0000 1.3436
@@ -1,3 +1,15 @@
+2007-03-16 Klaus Treichel <address@hidden>
+
+ * dumpasm/dump_const.c: Write FP values as hex values if there is no
+ FP support compiled in with the current profile.
+
+ * engine/lib_misc.c: Fix build without FP support. Throw a
+ NotImplementedException if a float operation is involved in the
+ BitConverter.GetLittleEndianBytes functions.
+
+ * ilasm/ilasm_grammar.y: Bail out on FP operations if there is no
+ FP support compiled in with the current profile.
+
2007-03-12 Klaus Treichel <address@hidden>
* cscc/csharp/cs_grammar.y: Add support for static classes.
Index: ilasm/ilasm_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ilasm/ilasm_grammar.y,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- ilasm/ilasm_grammar.y 13 Oct 2004 10:19:33 -0000 1.42
+++ ilasm/ilasm_grammar.y 16 Mar 2007 17:38:54 -0000 1.43
@@ -212,6 +212,7 @@
}
}
+#ifdef IL_CONFIG_FP_SUPPORTED
/*
* Helper function that sets 32-bit version of a "float".
*/
@@ -227,6 +228,7 @@
{
IL_WRITE_DOUBLE(dbytes, value);
}
+#endif /* IL_CONFIG_FP_SUPPORTED */
/*
* Find a module reference, or create it if not found.
@@ -1162,18 +1164,27 @@
Float64
: FLOAT_CONSTANT {
/* Literal floating point constant */
+ #ifdef IL_CONFIG_FP_SUPPORTED
SetFloat($$.fbytes, (ILFloat)($1));
SetDouble($$.dbytes, $1);
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| K_FLOAT32 '(' Integer32 ')' {
+ #ifdef IL_CONFIG_FP_SUPPORTED
/* Convert a raw big endian value into a 32-bit
float */
$$.fbytes[3] = (ILUInt8)($3 >> 24);
$$.fbytes[2] = (ILUInt8)($3 >> 16);
$$.fbytes[1] = (ILUInt8)($3 >> 8);
$$.fbytes[0] = (ILUInt8)($3);
SetDouble($$.dbytes,
(ILDouble)(IL_READ_FLOAT($$.fbytes)));
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| K_FLOAT64 '(' Integer64 ')' {
+ #ifdef IL_CONFIG_FP_SUPPORTED
/* Convert a raw big endian value into a 64-bit
float */
$$.dbytes[7] = (ILUInt8)($3 >> 56);
$$.dbytes[6] = (ILUInt8)($3 >> 48);
@@ -1184,6 +1195,9 @@
$$.dbytes[1] = (ILUInt8)($3 >> 8);
$$.dbytes[0] = (ILUInt8)($3);
SetFloat($$.fbytes,
(ILFloat)(IL_READ_DOUBLE($$.dbytes)));
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| K_NAN {
/* Not a number */
@@ -1819,16 +1833,24 @@
FieldInitialization
: K_FLOAT32 '(' FLOAT_CONSTANT ')' {
+ #ifdef IL_CONFIG_FP_SUPPORTED
unsigned char bytes[4];
SetFloat(bytes, (ILFloat)($3));
$$.type = IL_META_ELEMTYPE_R4;
$$.valueBlob = ILInternString((char *)bytes, 4);
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| K_FLOAT64 '(' FLOAT_CONSTANT ')' {
+ #ifdef IL_CONFIG_FP_SUPPORTED
unsigned char bytes[8];
SetDouble(bytes, (ILDouble)($3));
$$.type = IL_META_ELEMTYPE_R8;
$$.valueBlob = ILInternString((char *)bytes, 8);
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| K_FLOAT32 '(' Integer64 ')' {
unsigned char bytes[4];
@@ -4176,11 +4198,16 @@
InstructionFloat
: Float64 { $$ = $1; }
| Integer64 {
+ #ifdef IL_CONFIG_FP_SUPPORTED
/* Convert a 64-bit integer into a float */
SetFloat($$.fbytes, (ILFloat)($1));
SetDouble($$.dbytes, (ILDouble)($1));
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
| Bytes {
+ #ifdef IL_CONFIG_FP_SUPPORTED
/* Convert a group of bytes into a float */
if($1.len == 4)
{
@@ -4213,6 +4240,9 @@
$$.dbytes[6] = 0;
$$.dbytes[7] = 0;
}
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ yyerror("no floating point support on this
system");
+ #endif /* IL_CONFIG_FP_SUPPORTED */
}
;
Index: dumpasm/dump_const.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/dumpasm/dump_const.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- dumpasm/dump_const.c 9 Jan 2002 01:48:54 -0000 1.4
+++ dumpasm/dump_const.c 16 Mar 2007 17:38:54 -0000 1.5
@@ -142,6 +142,7 @@
{
if(blobLen > 3)
{
+ #ifdef IL_CONFIG_FP_SUPPORTED
if(hexFloats)
{
fprintf(stream, "float32(0x%08lX)",
@@ -152,6 +153,10 @@
fprintf(stream, "float32(%.30e)",
(double)(IL_READ_FLOAT(blob)));
}
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ fprintf(stream, "float32(0x%08lX)",
+ (unsigned
long)(IL_READ_UINT32(blob)));
+ #endif /* !IL_CONFIG_FP_SUPPORTED */
}
else
{
@@ -164,6 +169,7 @@
{
if(blobLen > 7)
{
+ #ifdef IL_CONFIG_FP_SUPPORTED
if(hexFloats)
{
fprintf(stream, "float64(0x%08lX%08lX)",
@@ -175,6 +181,11 @@
fprintf(stream, "float64(%.30e)",
(double)(IL_READ_DOUBLE(blob)));
}
+ #else /* !IL_CONFIG_FP_SUPPORTED */
+ fprintf(stream, "float64(0x%08lX%08lX)",
+ (unsigned
long)(IL_READ_UINT32(blob + 4)),
+ (unsigned
long)(IL_READ_UINT32(blob)));
+ #endif /* !IL_CONFIG_FP_SUPPORTED */
}
else
{
Index: engine/lib_misc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_misc.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- engine/lib_misc.c 17 Dec 2006 10:31:32 -0000 1.16
+++ engine/lib_misc.c 16 Mar 2007 17:38:54 -0000 1.17
@@ -143,6 +143,7 @@
System_Array *_IL_BitConverter_GetLittleEndianBytes_f
(ILExecThread *_thread, ILFloat value)
{
+#ifdef IL_CONFIG_FP_SUPPORTED
System_Array *array =
(System_Array *)ILExecThreadNew(_thread, "[B", "(Ti)V",
(ILVaInt)4);
if(array)
@@ -150,6 +151,10 @@
IL_WRITE_FLOAT((unsigned char *)ArrayToBuffer(array), value);
}
return array;
+#else /* !IL_CONFIG_FP_SUPPORTED */
+ ILExecThreadThrowSystem(_thread, "System.NotImplementedException", 0);
+ return 0;
+#endif /* !IL_CONFIG_FP_SUPPORTED */
}
/*
@@ -158,6 +163,7 @@
System_Array *_IL_BitConverter_GetLittleEndianBytes_d
(ILExecThread *_thread, ILDouble value)
{
+#ifdef IL_CONFIG_FP_SUPPORTED
System_Array *array =
(System_Array *)ILExecThreadNew(_thread, "[B", "(Ti)V",
(ILVaInt)8);
if(array)
@@ -165,6 +171,10 @@
IL_WRITE_DOUBLE((unsigned char *)ArrayToBuffer(array), value);
}
return array;
+#else /* !IL_CONFIG_FP_SUPPORTED */
+ ILExecThreadThrowSystem(_thread, "System.NotImplementedException", 0);
+ return 0;
+#endif /* !IL_CONFIG_FP_SUPPORTED */
}
#ifdef IL_CONFIG_VARARGS
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [dotgnu-pnet-commits] pnet ChangeLog ilasm/ilasm_grammar.y dumpasm/du...,
Klaus Treichel <=