add isl_seq_fdiv_r
[platform/upstream/isl.git] / include / isl_dim.h
1 #ifndef ISL_DIM_H
2 #define ISL_DIM_H
3
4 #include <isl_ctx.h>
5
6 #if defined(__cplusplus)
7 extern "C" {
8 #endif
9
10 struct isl_name;
11 struct isl_dim {
12         int ref;
13
14         struct isl_ctx *ctx;
15
16         unsigned nparam;
17         unsigned n_in;          /* zero for sets */
18         unsigned n_out;         /* dim for sets */
19
20         unsigned n_name;
21         struct isl_name **names;
22 };
23
24 enum isl_dim_type {
25         isl_dim_param,
26         isl_dim_in,
27         isl_dim_out,
28         isl_dim_set = isl_dim_out,
29         isl_dim_div,
30         isl_dim_all,
31 };
32
33 struct isl_dim *isl_dim_alloc(struct isl_ctx *ctx,
34                         unsigned nparam, unsigned n_in, unsigned n_out);
35 struct isl_dim *isl_dim_set_alloc(struct isl_ctx *ctx,
36                         unsigned nparam, unsigned dim);
37 struct isl_dim *isl_dim_copy(struct isl_dim *dim);
38 struct isl_dim *isl_dim_cow(struct isl_dim *dim);
39 void isl_dim_free(struct isl_dim *dim);
40
41 struct isl_dim *isl_dim_set_name(struct isl_dim *dim,
42                                  enum isl_dim_type type, unsigned pos,
43                                  const char *name);
44 const char *isl_dim_get_name(struct isl_dim *dim,
45                                  enum isl_dim_type type, unsigned pos);
46
47 struct isl_dim *isl_dim_extend(struct isl_dim *dim,
48                         unsigned nparam, unsigned n_in, unsigned n_out);
49 struct isl_dim *isl_dim_add(struct isl_dim *dim, enum isl_dim_type type,
50                 unsigned n);
51 struct isl_dim *isl_dim_join(struct isl_dim *left, struct isl_dim *right);
52 struct isl_dim *isl_dim_product(struct isl_dim *left, struct isl_dim *right);
53 struct isl_dim *isl_dim_map(struct isl_dim *dim);
54 struct isl_dim *isl_dim_reverse(struct isl_dim *dim);
55 struct isl_dim *isl_dim_drop(struct isl_dim *dim, enum isl_dim_type type,
56                 unsigned first, unsigned num);
57 struct isl_dim *isl_dim_drop_inputs(struct isl_dim *dim,
58                 unsigned first, unsigned n);
59 struct isl_dim *isl_dim_drop_outputs(struct isl_dim *dim,
60                 unsigned first, unsigned n);
61 struct isl_dim *isl_dim_domain(struct isl_dim *dim);
62 struct isl_dim *isl_dim_range(struct isl_dim *dim);
63 struct isl_dim *isl_dim_underlying(struct isl_dim *dim, unsigned n_div);
64
65 int isl_dim_equal(struct isl_dim *dim1, struct isl_dim *dim2);
66 int isl_dim_match(struct isl_dim *dim1, enum isl_dim_type dim1_type,
67                 struct isl_dim *dim2, enum isl_dim_type dim2_type);
68 int isl_dim_compatible(struct isl_dim *dim1, struct isl_dim *dim2);
69 unsigned isl_dim_size(struct isl_dim *dim, enum isl_dim_type type);
70 unsigned isl_dim_total(struct isl_dim *dim);
71
72 #if defined(__cplusplus)
73 }
74 #endif
75
76 #endif