Coverage Report

Created: 2017-04-27 19:33

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/lib/External/isl/isl_imath.c
Line
Count
Source (jump to first uncovered line)
1
#include <isl_int.h>
2
3
uint32_t isl_imath_hash(mp_int v, uint32_t hash)
4
256k
{
5
256k
  unsigned const char *data = (unsigned char *)v->digits;
6
256k
  unsigned const char *end = data + v->used * sizeof(v->digits[0]);
7
256k
8
256k
  if (v->sign == 1)
9
120k
    isl_hash_byte(hash, 0xFF);
10
2.91M
  for (; 
data < end2.91M
;
++data2.66M
)
11
2.66M
    isl_hash_byte(hash, *data);
12
256k
  return hash;
13
256k
}
14
15
/* Try a standard conversion that fits into a long.
16
 */
17
int isl_imath_fits_slong_p(mp_int op)
18
0
{
19
0
  long out;
20
0
  mp_result res = mp_int_to_int(op, &out);
21
0
  return res == MP_OK;
22
0
}
23
24
/* Try a standard conversion that fits into an unsigned long.
25
 */
26
int isl_imath_fits_ulong_p(mp_int op)
27
0
{
28
0
  unsigned long out;
29
0
  mp_result res = mp_int_to_uint(op, &out);
30
0
  return res == MP_OK;
31
0
}
32
33
void isl_imath_addmul_ui(mp_int rop, mp_int op1, unsigned long op2)
34
0
{
35
0
  mpz_t temp;
36
0
  mp_int_init(&temp);
37
0
38
0
  mp_int_set_uvalue(&temp, op2);
39
0
  mp_int_mul(op1, &temp, &temp);
40
0
  mp_int_add(rop, &temp, rop);
41
0
42
0
  mp_int_clear(&temp);
43
0
}
44
45
void isl_imath_submul_ui(mp_int rop, mp_int op1, unsigned long op2)
46
0
{
47
0
  mpz_t temp;
48
0
  mp_int_init(&temp);
49
0
50
0
  mp_int_set_uvalue(&temp, op2);
51
0
  mp_int_mul(op1, &temp, &temp);
52
0
  mp_int_sub(rop, &temp, rop);
53
0
54
0
  mp_int_clear(&temp);
55
0
}