]>
gcc.gnu.org Git - gcc.git/blob - libchill/ltps.c
1 /* Implement POWERSET runtime actions for CHILL.
2 Copyright (C) 1992,1993 Free Software Foundation, Inc.
3 Author: Wilfried Moser, et al
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28 * function __ltpowerset
33 * bitlength length of powerset
36 * int 1 .. left is proper subset of right
37 * (excludes case where left == right)
41 * check if one powerset is included in another
45 __ltpowerset (left
, right
, bitlength
)
48 unsigned long bitlength
;
50 if (bitlength
<= SET_CHAR_SIZE
)
52 if ((*((SET_CHAR
*)left
) & *((SET_CHAR
*)right
))
53 != *((SET_CHAR
*)left
))
55 if (*((SET_CHAR
*)left
) != *((SET_CHAR
*)right
))
59 else if (bitlength
<= SET_SHORT_SIZE
)
61 if ((*((SET_SHORT
*)left
) & *((SET_SHORT
*)right
))
62 != *((SET_SHORT
*)left
))
64 if (*((SET_SHORT
*)left
) != *((SET_SHORT
*)right
))
70 SET_WORD
*endp
= left
+ BITS_TO_WORDS(bitlength
);
71 int all_equal
= 1; /* assume all bits are equal */
75 if ((*right
& *left
) != *left
)
82 if (left
== endp
&& all_equal
) /* exclude TRUE return for == case */
This page took 0.04713 seconds and 6 git commands to generate.