[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
John Criswell
criswell at cs.uiuc.edu
Mon Mar 29 15:09:06 PST 2004
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.31 -> 1.32
---
Log message:
Merged in RELEASE_12.
---
Diffs of the changes: (+18 -12)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.31 llvm-gcc/gcc/llvm-expand.c:1.32
--- llvm-gcc/gcc/llvm-expand.c:1.31 Tue Mar 16 20:29:37 2004
+++ llvm-gcc/gcc/llvm-expand.c Mon Mar 29 15:08:39 2004
@@ -4957,23 +4957,29 @@
}
/* FIXME: This won't work right if endianness is non-agreeing? */
-
+
+ /*
+ * Here's how this works:
+ * REAL_VALUE_TO_TARGET_DOUBLE() will generate the floating point number
+ * as an array of integers in the hosts's representation. Each integer
+ * in the array will hold 32 bits of the result REGARDLESS OF THE HOST'S
+ * INTEGER SIZE.
+ *
+ * This, then, makes the conversion pretty simple. The tricky part is
+ * getting the byte ordering correct and make sure you don't print any
+ * more than 32 bits per integer on platforms with ints > 32 bits.
+ */
*BufPtr++ = '0';
*BufPtr++ = 'x';
if (!(BYTES_BIG_ENDIAN)) { /* If little endian */
- Values = (char*)RealArr+Size;
- while (Size--) {
- sprintf(BufPtr, "%02X", (unsigned char)*--Values);
- BufPtr += 2;
- }
+ sprintf(Buffer+2, "%08X", RealArr[1]);
+ sprintf(Buffer+10, "%08X", RealArr[0]);
+ *(Buffer+18) = 0; /* Null terminate */
} else {
- Values = (char*)RealArr;
- while (Size--) {
- sprintf(BufPtr, "%02X", (unsigned char)*Values++);
- BufPtr += 2;
- }
+ sprintf(Buffer+2, "%08X", RealArr[0]);
+ sprintf(Buffer+10, "%08X", RealArr[1]);
+ *(Buffer+18) = 0; /* Null terminate */
}
- *BufPtr = 0; /* Null terminate */
Val = llvm_constant_new(Ty, Buffer);
break;
More information about the llvm-commits
mailing list