[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.45,1.46 int_table.
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.45,1.46 int_table.c,1.47,1.48 lib_misc.c,1.11,1.12 |
Date: |
Mon, 17 Mar 2003 05:11:50 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv24605/engine
Modified Files:
int_proto.h int_table.c lib_misc.c
Log Message:
Implement extra internalcalls for BitConverter.
Index: int_proto.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_proto.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** int_proto.h 18 Feb 2003 06:18:58 -0000 1.45
--- int_proto.h 17 Mar 2003 10:11:48 -0000 1.46
***************
*** 116,119 ****
--- 116,121 ----
extern ILInt32 _IL_BitConverter_FloatToInt32Bits(ILExecThread * _thread,
ILFloat _p1);
extern ILFloat _IL_BitConverter_Int32BitsToFloat(ILExecThread * _thread,
ILInt32 _p1);
+ extern System_Array * _IL_BitConverter_GetLittleEndianBytes_f(ILExecThread *
_thread, ILFloat _p1);
+ extern System_Array * _IL_BitConverter_GetLittleEndianBytes_d(ILExecThread *
_thread, ILDouble _p1);
extern ILDouble _IL_Math_Log(ILExecThread * _thread, ILDouble _p1);
Index: int_table.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/int_table.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** int_table.c 18 Feb 2003 06:18:59 -0000 1.47
--- int_table.c 17 Mar 2003 10:11:48 -0000 1.48
***************
*** 645,648 ****
--- 645,666 ----
#endif
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_ppf(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((void * *)rvalue) = (*(void * (*)(void *, ILFloat))fn)(*((void *
*)(avalue[0])), *((ILFloat *)(avalue[1])));
+ }
+
+ #endif
+
+ #if !defined(HAVE_LIBFFI)
+
+ static void marshal_ppd(void (*fn)(), void *rvalue, void **avalue)
+ {
+ *((void * *)rvalue) = (*(void * (*)(void *, ILDouble))fn)(*((void *
*)(avalue[0])), *((ILDouble *)(avalue[1])));
+ }
+
+ #endif
+
#ifndef _IL_BitConverter_suppressed
***************
*** 653,656 ****
--- 671,676 ----
IL_METHOD("FloatToInt32Bits", "(f)i",
_IL_BitConverter_FloatToInt32Bits, marshal_ipf)
IL_METHOD("Int32BitsToFloat", "(i)f",
_IL_BitConverter_Int32BitsToFloat, marshal_fpi)
+ IL_METHOD("GetLittleEndianBytes", "(f)[B",
_IL_BitConverter_GetLittleEndianBytes_f, marshal_ppf)
+ IL_METHOD("GetLittleEndianBytes", "(d)[B",
_IL_BitConverter_GetLittleEndianBytes_d, marshal_ppd)
IL_METHOD_END
Index: lib_misc.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_misc.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** lib_misc.c 20 Jun 2002 02:11:14 -0000 1.11
--- lib_misc.c 17 Mar 2003 10:11:48 -0000 1.12
***************
*** 138,141 ****
--- 138,171 ----
}
+ /*
+ * internal static byte[] GetLittleEndianBytes(float value);
+ */
+ System_Array *_IL_BitConverter_GetLittleEndianBytes_f
+ (ILExecThread *_thread, ILFloat value)
+ {
+ System_Array *array =
+ (System_Array *)ILExecThreadNew(_thread, "[B", "(Ti)V",
(ILVaInt)4);
+ if(array)
+ {
+ IL_WRITE_FLOAT((unsigned char *)ArrayToBuffer(array), value);
+ }
+ return array;
+ }
+
+ /*
+ * internal static byte[] GetLittleEndianBytes(double value);
+ */
+ System_Array *_IL_BitConverter_GetLittleEndianBytes_d
+ (ILExecThread *_thread, ILDouble value)
+ {
+ System_Array *array =
+ (System_Array *)ILExecThreadNew(_thread, "[B", "(Ti)V",
(ILVaInt)8);
+ if(array)
+ {
+ IL_WRITE_DOUBLE((unsigned char *)ArrayToBuffer(array), value);
+ }
+ return array;
+ }
+
#ifdef IL_CONFIG_VARARGS
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/engine int_proto.h,1.45,1.46 int_table.c,1.47,1.48 lib_misc.c,1.11,1.12,
Rhys Weatherley <address@hidden> <=