This commit is contained in:
Christian Kamm
2009-03-24 21:18:29 +01:00
2 changed files with 14 additions and 3 deletions

View File

@@ -15,10 +15,12 @@ if(NOT PKG_CONFIG_FOUND)
else(NOT PKG_CONFIG_FOUND)
pkg_search_module(LIBCONFIGPP libconfig++)
if(NOT LIBCONFIGPP_FOUND)
message(FATAL_ERROR "libconfig++ not found")
set(LIBCONFIG_CXXFLAGS "" CACHE STRING "libconfig++ compiler flags")
set(LIBCONFIG_LDFLAGS "" CACHE STRING "libconfig++ linker flags")
else(NOT LIBCONFIGPP_FOUND)
set(LIBCONFIG_CXXFLAGS ${LIBCONFIGPP_CFLAGS} CACHE STRING "libconfig++ compiler flags")
set(LIBCONFIG_LDFLAGS ${LIBCONFIGPP_LDFLAGS} CACHE STRING "libconfig++ linker flags")
endif(NOT LIBCONFIGPP_FOUND)
set(LIBCONFIG_CXXFLAGS ${LIBCONFIGPP_CFLAGS} CACHE STRING "libconfig++ compiler flags")
set(LIBCONFIG_LDFLAGS ${LIBCONFIGPP_LDFLAGS} CACHE STRING "libconfig++ linker flags")
endif(NOT PKG_CONFIG_FOUND)

View File

@@ -20,6 +20,7 @@
#include "gen/complex.h"
#include "gen/llvmhelpers.h"
#include "gen/linkage.h"
#include "gen/llvm-version.h"
bool DtoIsPassedByRef(Type* type)
{
@@ -521,8 +522,16 @@ llvm::ConstantFP* DtoConstFP(Type* t, long double value)
return LLConstantFP::get(llty, value);
else if(llty == LLType::X86_FP80Ty) {
uint64_t bits[] = {0, 0};
#if LLVM_REV < 67562
// Prior to r67562, the i80 APInt format expected by the APFloat
// constructor was different than the memory layout on the actual
// processor.
bits[1] = *(uint16_t*)&value;
bits[0] = *(uint64_t*)((uint16_t*)&value + 1);
#else
bits[0] = *(uint64_t*)&value;
bits[1] = *(uint16_t*)((uint64_t*)&value + 1);
#endif
return LLConstantFP::get(APFloat(APInt(80, 2, bits)));
} else {
assert(0 && "Unknown floating point type encountered");