llvm

Which library should I use on OSX for arbitrary precision arithmetic?

江枫思渺然 提交于 2019-11-28 13:04:40
问题 I tried already GMP, MPFR. But I can't accomplish a simple division like below. BTW I have LLVM compiler in Xcode. I try to compile, run it to IOS Simulator. mpf_t a; mpf_init2 (a, 256); mpf_set_d(a, 0.7); mpf_t b; mpf_init2 (b, 256); mpf_set_d(b, 1.0); mpf_t l; mpf_init2 (l, 256); gmp_printf ("%.*Ff \n", 5, a); --- 0.70000 gmp_printf ("%.*Ff \n", 5, b); --- 1.00000 mpf_div(l, a, b); gmp_printf ("%.*Ff", 5, l); --- 0.52502 回答1: Have you tried MPIR? OpenSSL also provides a big number library..

llvm 3.42 build from source fails on ubuntu 17.04

痴心易碎 提交于 2019-11-28 12:43:05
问题 I have a script that builds llvm/clang 3.42 from source (with configure+make). It runs smooth on ubuntu 14.04.5 LTS . When I upgraded to ubuntu 17.04 , the build fails. Here is the building script: svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_342/final llvm svn co https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_342/final llvm/tools/clang svn co https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_342/final llvm/projects/compiler-rt svn co https://llvm.org/svn/llvm

is char signed or unsigned by default on iOS?

落花浮王杯 提交于 2019-11-28 12:19:37
Is char signed or unsigned by default on iOS? (I thought this would've been a well answered question, but oddly google turned up nothing at all useful!) JosephH In most cases, char is unsigned on ARM (for performance reasons ) and signed on other platforms. iOS differs from the normal convention for ARM, and char is signed by default. (In particular this differs from Android, where code compiled in the ndk defaults to unsigned char .) This can be changed in xcode, there is a 'char' Type is unsigned option (which defaults to off). If this is changed to "yes", xcode will pass -funsigned-char to

Coordinates all wrong on iPhone 3G? It could be your compiler

房东的猫 提交于 2019-11-28 12:01:52
Note: This is question to which I have already found an answer. It seems that posting a question after finding an interesting answer is encouraged , so I am posting this. Someone else is likely to have the same problem and find this useful. I have an iOS app that produces charts. Shortly after publishing an update, a user sent me this panicky email: "the latest update has modified the curves ... not seen more growth curves and inserted data are represented as a line descending ... before you could see perfectly well Help me" I get him to send a screenshot and give more detail. He has an iPhone

Does LLVM convert Objective-C methods to inline functions?

岁酱吖の 提交于 2019-11-28 10:57:04
Does LLVM automatically convert Objective-C methods to inline functions when possible? (I.e., is it just as performant to create an Objective-C method for a block of code that you could otherwise paste inline?) If LLVM doesn't perform this optimization, why not? If it does, (a) are there certain build settings I must set for this to happen? (b) How can I tell if an Objective-C method will be inlined? No, because its impossible to know in the context of the Obj-C runtime if those kind of optimizations can be performed. The thing to remember is that Obj-C methods are invoked by a message send,

“-Weverything” yielding “Comparing floating point with == or != is unsafe”

﹥>﹥吖頭↗ 提交于 2019-11-28 10:45:05
I have a string that I convert to a double like this: double d = [string doubleValue]; The documentation for doubleValue tells us that upon overflow, this method returns either HUGE_VAL or -HUGE_VAL . This is how I checked for this earlier: if (d == HUGE_VAL || d == -HUGE_VAL) //overflow Now, since adding the new "-Weverything" warning flag, the compiler now complains that Comparing floating point with == or != is unsafe How can I resolve this issue? How should I be doing these comparisons? I also have the same question about comparing two "normal" floating point numbers (i.e. not "HUGE_VAL"

Unknown register name “q0” in asm (arm64)

风流意气都作罢 提交于 2019-11-28 09:24:41
问题 I'm currently trying to compile my lib for the new arm64 arch. I have a bunch of NEON assembly and for all of them I receive an error Unknown register name "q0" in asm. Even if I write smth simple as this: asm ( "" : : : "q0", "q1", "q2", "q3" ); I thought arm64 supports NEON. Am i missing something ? 回答1: “v0”: scanon$ cat bar.c int foo(void) { __asm__("":::"q0"); return 0; } scanon$ xcrun -sdk iphoneos clang bar.c -arch arm64 -c bar.c:2:16: error: unknown register name 'q0' in asm __asm__("

LLVM get constant integer back from Value*

醉酒当歌 提交于 2019-11-28 08:59:44
I create a llvm::Value* from a integer constant like this: llvm::Value* constValue = llvm::ConstantInt::get( llvmContext , llvm::APInt( node->someInt() )); now i want to retrieve the compile-time constant value back; int constIntValue = constValue->??? The examples shown in LLVM Programmer manual seem to imply that cast<> will accept a pointer when using the type (rather than the type plus pointer) template parameter, however i'm pretty sure thats failing as from 2.8: llvm::Value* foo = 0; llvm::ConstantInt* intValue = & llvm::cast< llvm::ConstantInt , llvm::Value >(foo ); //build error: /

How to use clang/llvm with Eclipse CDT

╄→гoц情女王★ 提交于 2019-11-28 07:08:49
Is it possible to use Clang/LLVM with Eclipse CDT and if so, how is it configured to actually make it work? I am the main author of the (only) LLVM plug-in for Eclipse CDT. It is still in development so might not be suitable for production environment yet. However feel free to test it to find out if it is suitable for your needs. https://github.com/TuononenP/llvm4eclipsecdt UPDATE The latest version is available via official Eclipse update site: http://download.eclipse.org/releases/mars It is under Programming Languages and is named "C/C++ LLVM-Family Compiler Build Support". osgx Here is the

Unable to install LLVM toolchain for Eclipse CDT

孤人 提交于 2019-11-28 07:06:15
Im trying to get Clang working again on Eclipse and therefore I've tried to install the LLVM toolchain over the Eclipse Marketplace. But when I click Confirm to procceed with the installation I get the following error Unable to read repository at http://petrituononen.com/llvm4eclipsecdt/update. http://petrituononen.com/llvm4eclipsecdt/update is not a valid repository location. This site seems to be down but I cant find any alternative sources. Is there any way to get Clang working on Eclipse Mars ? This is a setup from scratch that worked for me (ubuntu 14.04 + eclipse mars + clang 3.6.2). You