[Soot-list] Cmp, cmpl, cmpg?

Phil Pratt-Szeliga pcpratts at syr.edu
Tue Jul 10 17:21:06 EDT 2012


Hi David,

The Rootbeer GPU Compiler (to appear in HPCC-2012 proceedings and
released open source in August) translates these statements to the
following C code:

char
edu_syr_pcpratts_cmp(long long lhs, long long rhs){
  if(lhs > rhs)
    return 1;
  if(lhs < rhs)
    return -1;
  return 0;
}

char
edu_syr_pcpratts_cmpl(double lhs, double rhs){
  if(lhs > rhs)
    return 1;
  if(lhs < rhs)
    return -1;
  if(lhs == rhs)
    return 0;
  return 1;
}

char
edu_syr_pcpratts_cmpg(double lhs, double rhs){
  if(lhs > rhs)
    return 1;
  if(lhs < rhs)
    return -1;
  if(lhs == rhs)
    return 0;
  return -1;
}

Rootbeer is a highly tested project with 7k lines of test code testing
20k lines of product code with all tests passing.



Phil Pratt-Szeliga
Syracuse University
http://chirrup.org/


More information about the Soot-list mailing list