search for: atoi

Displaying 20 results from an estimated 437 matches for "atoi".

2014 Dec 18
4
Replace atoi and atol with strtol strtoul:Need Help
Hello, I came across the file *omega.cc* which is in directory* xapain-application/omega/* In this file , atoi is used in *Percentage Relevance cutoff *(293 line no) as Percentage lies between 0-100 their is no need to modify atoi . But do we need to check for error's ? Second Implementation is in *collapsing* (301) in which we collapse set of document under a key,range of this key has not been define...
2014 Dec 15
2
Replace atoi and atol with strtol strtoul:Need Help
Hello, I am working on replacing atoi () and atol() functions with strtol() and strtoul() . I came across many files which uses statement like these time_t secs= atoi(data_span.c_str()), here time_t Datatype is not known but wikipedia says that it is integer so is it necessary to replace atoi with strtol over here ?? And is their an...
2014 Dec 16
2
Replace atoi and atol with strtol strtoul:Need Help
Hello , I came across this function *HtmlParser::decode_entities(string &s)* in *xapian-application/omega/htmlparse.cc* which basically does is extract hex value if any or extract number.For extracting number atoi is used and value returned by it is stored in variable "val" , I think so replacing atoi with strtoul would be useful here as number can have larger value although the variable "val" is unsigned int so i need to change the that definition of "val" also. Is that ok to d...
2010 Jun 17
2
[LLVMdev] Optimizing Boolean Expression
Hello I compiled the following program using the web interface #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { int a; int b; int c; int d; int X = 10; a = 777; b = a | (atoi(argv[1])); c = b | (atoi(argv[2])); a = c | (atoi(argv[4])); b = a | (atoi(argv[5])); d = b | (atoi(argv[6])); a = d | (atoi(argv[7])); b = a | (atoi(argv[8])); c = b | (atoi(argv[9])); if (c) { X = 2000; } printf("%d\n", X); return 0; } It is easy to see that t...
2017 Aug 17
2
unable to emit vectorized code in LLVM IR
Ok. I have managed to vectorize the second loop in the following code. But the first loop is still not vectorized? Why? int main(int argc, char** argv) { int a[1000], b[1000], c[1000]; int g=0; int aa=atoi(argv[1]), bb=atoi(argv[2]); for (int i=0; i<1000; i++) { a[i]=aa+i, b[i]=bb+i;} for (int i=0; i<1000; i++) { c[i]=a[i] + b[i]; g+=c[i]; } printf("sum: %d\n", g); return 0; } When i executed the optimized IR through jit (lli sum-vec03.ll 5 2) i am getting following error: #0...
2017 Aug 17
4
unable to emit vectorized code in LLVM IR
...side the loop so it doesn't need to exist. So the compiler turned your loop body back into g+= aa + bb; And since the loop is 1000 iterations and aa and bb never change this got further simplified to (aa+bb)*1000. int main(int argc, char** argv) { int a[1000], b[1000], c[1000]; int g=0; int aa=atoi(argv[1]), bb=atoi(argv[2]); for (int i=0; i<1000; i++) { a[i]=aa, b[i]=bb; c[i]=a[i] + b[i]; g+=c[i]; } ~Craig On Thu, Aug 17, 2017 at 11:37 AM, hameeza ahmed <hahmed2305 at gmail.com> wrote: > why is it happening? is there any way to solve this? > > On Thu, Aug 17, 2017 at 10...
2017 Aug 17
3
unable to emit vectorized code in LLVM IR
I want to vectorize the user given inputs. when opt does vectorization user supplied inputs (from a text file) will be added using AVX vector instructions. as you pointed; When i changed my code to following: int main(int argc, char** argv) { int a[1000], b[1000], c[1000]; int aa=atoi(argv[1]), bb=atoi(argv[2]); for (int i=0; i<1000; i++) { a[i]=aa, b[i]=bb; c[i]=a[i] + b[i]; printf("sum: %d\n", c[i]); } I am getting error remark: <unknown>:0:0: loop not vectorized: call instruction cannot be vectorized. I am running following commands: clang -S -emit-llv...
2017 Aug 17
2
unable to emit vectorized code in LLVM IR
...hahmed2305 at gmail.com> > wrote: > >> Ok. I have managed to vectorize the second loop in the following code. >> But the first loop is still not vectorized? Why? >> >> int main(int argc, char** argv) { >> int a[1000], b[1000], c[1000]; int g=0; >> int aa=atoi(argv[1]), bb=atoi(argv[2]); >> >> for (int i=0; i<1000; i++) { >> a[i]=aa+i, b[i]=bb+i;} >> >> for (int i=0; i<1000; i++) { >> c[i]=a[i] + b[i]; >> g+=c[i]; >> } >> >> printf("sum: %d\n", g); >> >> return 0; &g...
2017 Aug 17
2
unable to emit vectorized code in LLVM IR
even if i make my code as follows: vectorized instructions not get emitted. What to do? int main(int argc, char** argv) { int a[1000], b[1000], c[1000]; int g=0; int aa=atoi(argv[1]), bb=atoi(argv[2]); for (int i=0; i<1000; i++) { a[i]=aa, b[i]=bb; c[i]=a[i] + b[i]; g+=c[i]; } printf("sum: %d\n", g); return 0; } On Thu, Aug 17, 2017 at 10:03 PM, Craig Topper <craig.topper at gmail.com> wrote: > Did you remove the printf completely? Meaning th...
2010 Jun 18
0
[LLVMdev] Optimizing Boolean Expression
...i at gmail.com> wrote: > Hello > > I compiled the following program using the web interface > > #include <stdio.h> > #include <stdlib.h> > > int main(int argc, char **argv) { >   int a; int b; int c; int d; >   int X = 10; >   a = 777; >   b = a | (atoi(argv[1])); >   c = b | (atoi(argv[2])); >   a = c | (atoi(argv[4])); >   b = a | (atoi(argv[5])); >   d = b | (atoi(argv[6])); >   a = d | (atoi(argv[7])); >   b = a | (atoi(argv[8])); >   c = b | (atoi(argv[9])); >   if (c) { >     X = 2000; >   } >   printf("...
2010 Apr 08
4
[LLVMdev] How to Load a Value?
Hello, I have a problem of generating a load instruction. The LLVM bytecode is: ------------------------ entry: ... %2 = call i32 (...)* @atoi(i8*%1) nounwind /*<- Insertpos*/ ... -- bb1: .. %5 = icmp sgt i32 %2, %i.0 ... ----------------- Now I have pb: pointer to the Value object of *%2* of bb1. Here, I want to generate a load instruction and I did it as: new LoadInst(pb, "load_2", InsertPos); where InsertPos po...
2014 Dec 19
2
Replace atoi and atol with strtol strtoul:Need Help
...nfigure checks and then install it to an architecture-dependent path. But anyway, there's no "strtou()" so you have to converting to unsigned long with strtoul() and then check for potential overflow from the cast to Xapian::valueno. > I think you?ve been looking at other uses of atoi/atol; if you?ve > successfully updated code then you should make a pull request or email > a patch (or attach one to the trac ticket) so someone can review it > and get it into trunk (and hence into a future release). Smaller PRs > are generally easier to review than ones that touch lot...
2016 Nov 20
2
GlobalValue::AvailableExternallyLinkage
> > On Nov 19, 2016, at 14:09, Mehdi Amini <mehdi.amini at apple.com> wrote: > > I assume from your description that you are also updating call sites in the same module so that if foo was calling atoi, after cloning you have foo_parallel that is calling atoi_parallel? > If this is the issue, it depends, I’d probably consider turning the available_externally into internal. But you can also run the eliminate_available_externally pass before performing your transformation. No I am not updating...
2016 Nov 19
2
GlobalValue::AvailableExternallyLinkage
Because what is happening is that if function “atoi” gets cloned I don’t have a definition of “atoi_parallel” therefore I get undefined references when linking. I just want to clone and instrument functions implemented in modules of my program. > On Nov 19, 2016, at 13:54, Mehdi Amini <mehdi.amini at apple.com> wrote: > > >>...
2017 Aug 17
4
unable to emit vectorized code in LLVM IR
...oes vectorization >> user supplied inputs (from a text file) will be added using AVX vector >> instructions. >> >> as you pointed; When i changed my code to following: >> >> int main(int argc, char** argv) { >> int a[1000], b[1000], c[1000]; >> int aa=atoi(argv[1]), bb=atoi(argv[2]); >> for (int i=0; i<1000; i++) { >> a[i]=aa, b[i]=bb; >> c[i]=a[i] + b[i]; >> printf("sum: %d\n", c[i]); >> >> } >> >> I am getting error remark: <unknown>:0:0: loop not vectorized: call >> instruct...
2017 Aug 16
2
unable to emit vectorized code in LLVM IR
Hello, I have written the following code. when i try to vectorize it through opt. i am not getting vectorized instructions. #include <stdio.h> #include<stdlib.h> int main(int argc, char** argv) { int sum=0; int a=atoi(argv[1]); int b=atoi(argv[2]); for (int i=0;i<1000;i++) { sum+=a+b; } printf("sum: %d\n", sum); return 0; } i use following commands: clang -S -emit-llvm sum-main.c -march=knl -O3 -mllvm -disable-llvm-optzns -o sum-main.ll opt -S -O3 -force-vector-width=64 sum-main.ll -o sum-main03....
2016 Nov 19
4
GlobalValue::AvailableExternallyLinkage
...same function but with a different name, i.e. sum() and sum_parallel(). After my pass I will run ThreadSanitizer instrumentation pass only on the new copy of the functions, i.e. only the “_parallel” functions will be instrumented by tsan. In some programs that I am compiling, the functions such as atoi and atof get cloned but I want to avoid this, and I noticed that only those functions have GlobalValue::AvailableExternallyLinkage, so I was wondering if checking the linkage is enough to avoid those library functions or there could be situations of functions with that linkage but that have the bo...
2013 Jun 24
2
[bug] Syslinux-5.11-pre2: IPAPPEND/SYSAPPEND inconsistent base
...if (ld.label) ld.ipappend = s; else SysAppends = s; com32/menu/readconfig.c } else if ((ep = looking_at(p, "ipappend")) || (ep = looking_at(p, "sysappend"))) { if (ld.label) ld.ipappend = atoi(skipspace(ep)); else ipappend = atoi(skipspace(ep)); -- -Gene
2013 Jun 24
2
[5.11-pre1] SYSAPPEND does not work (IPAPPEND alias works)
...<vmlinuz386 at yahoo.com.ar> wrote: > I guess the bug is here (com32/menu/readconfig.c) > > 910 } else if (looking_at(p, "ipappend") || looking_at(p, > "sysappend")) { > 911 if (ld.label) > 912 ld.ipappend = atoi(skipspace(p + 8)); > 913 else > 914 ipappend = atoi(skipspace(p + 8)); > > since the length of "sysappend" (9) differs from "ipappend" (8) but > parsed in the same way. I think I see a good solution here. -- -Gene
2004 Oct 05
1
Cannot compile Meetme2
...app_meetme2.c:140: error: `res' undeclared (first use in this function) app_meetme2.c:153: error: `CONNECTION_BAD' undeclared (first use in this function) app_meetme2.c:164: error: `PGRES_TUPLES_OK' undeclared (first use in this function) app_meetme2.c:180: warning: passing arg 1 of `atoi' makes pointer from integer without a cast app_meetme2.c:181: warning: passing arg 1 of `atoi' makes pointer from integer without a cast app_meetme2.c:182: warning: passing arg 1 of `atoi' makes pointer from integer without a cast app_meetme2.c:183: warning: passing arg 1 of `atoi...