pike.git/
src/
pike_types.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2020-10-15
2020-10-15 10:50:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>
1aaf0ade6e8e0dd2a89de0ab82d36fe43209cf1e (
22
lines) (+
20
/-
2
)
[
Show
|
Annotate
]
Branch:
master
Compiler
[Typechecker]
: Added some implementation notes.
4898:
case T_INT: {
-
INT32 bounds[6] = { MIN_INT32, };
+
INT32 bounds[6] = { MIN_INT32, };
/* Start sentinel. */
int ab[6] = { 0, 0, }; int i; int nbounds = 1; INT32 bound; INT32 other;
-
/* NB: The bits in ab are selected so that they match
+
/*
+
* Implementation notes:
+
*
+
* bounds[] contains the values where the set changes in order
+
* from smallest to largest. It always contains at least the
+
* start sentinel value (MIN_INT32) at position 0.
+
*
+
* ab[] contains one bit for each of a and b indicating whether
+
* the corresponding value in bounds[] is a member of a and/or b.
+
*
+
* nbounds contains the number of valid entries in bounds[] and ab[].
+
*
+
* To avoid issues with overflow and similar the end sentinel
+
* (ie MAX_INT32 + 1) is not in bounds[].
+
*
+
*
NB: The bits in ab are selected so that they match
* the shifts for the minterms in enum pt_binop.
-
+
*
+
* bounds[] and ab[] are created with insert sort.
*/ bound = CAR_TO_INT(a); for (i = nbounds; i-- && bounds[i] > bound;) {