/src/harfbuzz/src/hb-bit-page.hh
Line | Count | Source |
1 | | /* |
2 | | * Copyright © 2012,2017 Google, Inc. |
3 | | * Copyright © 2021 Behdad Esfahbod |
4 | | * |
5 | | * This is part of HarfBuzz, a text shaping library. |
6 | | * |
7 | | * Permission is hereby granted, without written agreement and without |
8 | | * license or royalty fees, to use, copy, modify, and distribute this |
9 | | * software and its documentation for any purpose, provided that the |
10 | | * above copyright notice and the following two paragraphs appear in |
11 | | * all copies of this software. |
12 | | * |
13 | | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
14 | | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
15 | | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
16 | | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
17 | | * DAMAGE. |
18 | | * |
19 | | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
20 | | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
21 | | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
22 | | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
23 | | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
24 | | * |
25 | | * Google Author(s): Behdad Esfahbod |
26 | | */ |
27 | | |
28 | | #ifndef HB_BIT_PAGE_HH |
29 | | #define HB_BIT_PAGE_HH |
30 | | |
31 | | #include "hb.hh" |
32 | | |
33 | | |
34 | | /* Compiler-assisted vectorization. */ |
35 | | |
36 | | /* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))), |
37 | | * basically a fixed-size bitset. We can't use the compiler type because hb_vector_t cannot |
38 | | * guarantee alignment requirements. */ |
39 | | template <typename elt_t, unsigned int byte_size> |
40 | | struct hb_vector_size_t |
41 | | { |
42 | 645k | elt_t& operator [] (unsigned int i) { return v[i]; } |
43 | 1.82k | const elt_t& operator [] (unsigned int i) const { return v[i]; } |
44 | | |
45 | | void init0 () |
46 | 676 | { |
47 | 6.08k | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
48 | 5.40k | v[i] = 0; |
49 | 676 | } |
50 | | void init1 () |
51 | 0 | { |
52 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
53 | 0 | v[i] = (elt_t) -1; |
54 | 0 | } |
55 | | |
56 | | template <typename Op> |
57 | | hb_vector_size_t process (const Op& op) const |
58 | 0 | { |
59 | 0 | hb_vector_size_t r; |
60 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
61 | 0 | r.v[i] = op (v[i]); |
62 | 0 | return r; |
63 | 0 | } Unexecuted instantiation: hb-buffer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&) const Unexecuted instantiation: hb-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-face-builder.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&) const Unexecuted instantiation: hb-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: VARC.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_17>($_17 const&) const Unexecuted instantiation: hb-ot-metrics.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-shape.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-var.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-static.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ft.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-aat-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-cff1-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-cff2-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-arabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-shaper-default.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-hangul.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-hebrew.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-indic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-khmer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-myanmar.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-syllabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-thai.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-use.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-vowel-constraints.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shape-fallback.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&) const Unexecuted instantiation: hb-ot-shape-normalize.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const Unexecuted instantiation: hb-ot-shaper-indic-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&) const |
64 | | template <typename Op> |
65 | | hb_vector_size_t process (const Op& op, const hb_vector_size_t &o) const |
66 | 0 | { |
67 | 0 | hb_vector_size_t r; |
68 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
69 | 0 | r.v[i] = op (v[i], o.v[i]); |
70 | 0 | return r; |
71 | 0 | } Unexecuted instantiation: hb-buffer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-buffer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-buffer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face-builder.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face-builder.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-face-builder.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: VARC.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_14>($_14 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: VARC.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: VARC.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-metrics.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-metrics.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-metrics.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-var.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-var.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-var.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-static.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-static.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-static.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ft.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ft.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ft.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-aat-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff1-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff1-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff1-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff2-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff2-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-cff2-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-arabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-arabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-arabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-default.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-default.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-default.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hangul.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hangul.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hangul.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hebrew.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hebrew.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-hebrew.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-khmer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-khmer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-khmer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-myanmar.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-myanmar.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-myanmar.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-syllabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-syllabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-syllabic.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-thai.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-thai.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-thai.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-use.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-use.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-use.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-vowel-constraints.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-vowel-constraints.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-vowel-constraints.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-fallback.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-fallback.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_12>($_12 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-fallback.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_15>($_15 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-normalize.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-normalize.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shape-normalize.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_9>($_9 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_10>($_10 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-shaper-indic-table.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_13>($_13 const&, hb_vector_size_t<unsigned long long, 64u> const&) const |
72 | | hb_vector_size_t operator | (const hb_vector_size_t &o) const |
73 | 0 | { return process (hb_bitwise_or, o); } |
74 | | hb_vector_size_t operator & (const hb_vector_size_t &o) const |
75 | 0 | { return process (hb_bitwise_and, o); } |
76 | | hb_vector_size_t operator ^ (const hb_vector_size_t &o) const |
77 | 0 | { return process (hb_bitwise_xor, o); } |
78 | | hb_vector_size_t operator ~ () const |
79 | 0 | { return process (hb_bitwise_neg); } |
80 | | |
81 | | operator bool () const |
82 | 0 | { |
83 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
84 | 0 | if (v[i]) |
85 | 0 | return true; |
86 | 0 | return false; |
87 | 0 | } |
88 | | operator unsigned int () const |
89 | 0 | { |
90 | 0 | unsigned int r = 0; |
91 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
92 | 0 | r += hb_popcount (v[i]); |
93 | 0 | return r; |
94 | 0 | } |
95 | | bool operator == (const hb_vector_size_t &o) const |
96 | 0 | { |
97 | 0 | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
98 | 0 | if (v[i] != o.v[i]) |
99 | 0 | return false; |
100 | 0 | return true; |
101 | 0 | } |
102 | | |
103 | | hb_array_t<const elt_t> iter () const |
104 | | { return hb_array (v); } |
105 | | |
106 | | private: |
107 | | static_assert (0 == byte_size % sizeof (elt_t), ""); |
108 | | elt_t v[byte_size / sizeof (elt_t)]; |
109 | | }; |
110 | | |
111 | | |
112 | | struct hb_bit_page_t |
113 | | { |
114 | 338 | hb_bit_page_t () { init0 (); } |
115 | | |
116 | 676 | void init0 () { v.init0 (); population = 0; } |
117 | 0 | void init1 () { v.init1 (); population = PAGE_BITS; } |
118 | | |
119 | 645k | void dirty () { population = UINT_MAX; } |
120 | | |
121 | | static inline constexpr unsigned len () |
122 | 720 | { return ARRAY_LENGTH_CONST (v); } |
123 | | |
124 | 0 | operator bool () const { return !is_empty (); } |
125 | | bool is_empty () const |
126 | 0 | { |
127 | 0 | if (has_population ()) return !population; |
128 | 0 | bool empty = !v; |
129 | 0 | if (empty) population = 0; |
130 | 0 | return empty; |
131 | 0 | } |
132 | | uint32_t hash () const |
133 | 0 | { |
134 | 0 | return hb_bytes_t ((const char *) &v, sizeof (v)).hash (); |
135 | 0 | } |
136 | | |
137 | 645k | void add (hb_codepoint_t g) { elt (g) |= mask (g); dirty (); } |
138 | 0 | void add_bits (hb_codepoint_t g, uint64_t bits) { elt (g) |= bits; dirty (); } |
139 | 0 | void del (hb_codepoint_t g) { elt (g) &= ~mask (g); dirty (); } |
140 | 0 | void del_bits (hb_codepoint_t g, uint64_t bits) { elt (g) &= ~bits; dirty (); } |
141 | 240 | void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); } |
142 | 545 | bool get (hb_codepoint_t g) const { return elt (g) & mask (g); } |
143 | 0 | bool may_have (hb_codepoint_t g) const { return get (g); } |
144 | | |
145 | 0 | bool operator [] (hb_codepoint_t g) const { return get (g); } |
146 | 0 | bool operator () (hb_codepoint_t g) const { return get (g); } |
147 | 0 | bool has (hb_codepoint_t g) const { return get (g); } |
148 | | |
149 | | void add_range (hb_codepoint_t a, hb_codepoint_t b) |
150 | 0 | { |
151 | 0 | elt_t *la = &elt (a); |
152 | 0 | elt_t *lb = &elt (b); |
153 | 0 | if (la == lb) |
154 | 0 | *la |= (mask (b) << 1) - mask(a); |
155 | 0 | else if (likely (la < lb)) |
156 | 0 | { |
157 | 0 | *la |= ~(mask (a) - 1llu); |
158 | 0 | la++; |
159 | |
|
160 | 0 | hb_memset (la, 0xff, (char *) lb - (char *) la); |
161 | |
|
162 | 0 | *lb |= ((mask (b) << 1) - 1llu); |
163 | 0 | } |
164 | 0 | else |
165 | 0 | return; |
166 | 0 | dirty (); |
167 | 0 | } |
168 | | void del_range (hb_codepoint_t a, hb_codepoint_t b) |
169 | 0 | { |
170 | 0 | elt_t *la = &elt (a); |
171 | 0 | elt_t *lb = &elt (b); |
172 | 0 | if (la == lb) |
173 | 0 | *la &= ~((mask (b) << 1llu) - mask(a)); |
174 | 0 | else if (likely (la < lb)) |
175 | 0 | { |
176 | 0 | *la &= mask (a) - 1; |
177 | 0 | la++; |
178 | |
|
179 | 0 | hb_memset (la, 0, (char *) lb - (char *) la); |
180 | |
|
181 | 0 | *lb &= ~((mask (b) << 1) - 1llu); |
182 | 0 | } |
183 | 0 | else |
184 | 0 | return; |
185 | 0 | dirty (); |
186 | 0 | } |
187 | | void set_range (hb_codepoint_t a, hb_codepoint_t b, bool v) |
188 | 0 | { if (v) add_range (a, b); else del_range (a, b); } |
189 | | |
190 | | |
191 | | // Writes out page values to the array p. Returns the number of values |
192 | | // written. At most size codepoints will be written. |
193 | | unsigned int write (uint32_t base, |
194 | | unsigned int start_value, |
195 | | hb_codepoint_t *p, |
196 | | unsigned int size) const |
197 | 0 | { |
198 | 0 | unsigned int start_v = start_value / ELT_BITS; |
199 | 0 | unsigned int start_bit = start_value & ELT_MASK; |
200 | 0 | unsigned int count = 0; |
201 | 0 | for (unsigned i = start_v; i < len () && count < size; i++) |
202 | 0 | { |
203 | 0 | elt_t bits = v[i]; |
204 | 0 | uint32_t v_base = base | (i * ELT_BITS); |
205 | 0 | for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) |
206 | 0 | { |
207 | 0 | if ((elt_t(1) << j) & bits) { |
208 | 0 | *p++ = v_base | j; |
209 | 0 | count++; |
210 | 0 | } |
211 | 0 | } |
212 | 0 | start_bit = 0; |
213 | 0 | } |
214 | 0 | return count; |
215 | 0 | } |
216 | | |
217 | | // Writes out the values NOT in this page to the array p. Returns the |
218 | | // number of values written. At most size codepoints will be written. |
219 | | // Returns the number of codepoints written. next_value holds the next value |
220 | | // that should be written (if not present in this page). This is used to fill |
221 | | // any missing value gaps between this page and the previous page, if any. |
222 | | // next_value is updated to one more than the last value present in this page. |
223 | | unsigned int write_inverted (uint32_t base, |
224 | | unsigned int start_value, |
225 | | hb_codepoint_t *p, |
226 | | unsigned int size, |
227 | | hb_codepoint_t *next_value) const |
228 | 0 | { |
229 | 0 | unsigned int start_v = start_value / ELT_BITS; |
230 | 0 | unsigned int start_bit = start_value & ELT_MASK; |
231 | 0 | unsigned int count = 0; |
232 | 0 | for (unsigned i = start_v; i < len () && count < size; i++) |
233 | 0 | { |
234 | 0 | elt_t bits = v[i]; |
235 | 0 | uint32_t v_offset = i * ELT_BITS; |
236 | 0 | for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) |
237 | 0 | { |
238 | 0 | if ((elt_t(1) << j) & bits) |
239 | 0 | { |
240 | 0 | hb_codepoint_t value = base | v_offset | j; |
241 | | // Emit all the missing values from next_value up to value - 1. |
242 | 0 | for (hb_codepoint_t k = *next_value; k < value && count < size; k++) |
243 | 0 | { |
244 | 0 | *p++ = k; |
245 | 0 | count++; |
246 | 0 | } |
247 | | // Skip over this value; |
248 | 0 | *next_value = value + 1; |
249 | 0 | } |
250 | 0 | } |
251 | 0 | start_bit = 0; |
252 | 0 | } |
253 | 0 | return count; |
254 | 0 | } |
255 | | |
256 | 0 | bool operator == (const hb_bit_page_t &other) const { return is_equal (other); } |
257 | 0 | bool is_equal (const hb_bit_page_t &other) const { return v == other.v; } |
258 | | bool intersects (const hb_bit_page_t &other) const |
259 | 80 | { |
260 | 720 | for (unsigned i = 0; i < len (); i++) |
261 | 640 | if (v[i] & other.v[i]) |
262 | 0 | return true; |
263 | 80 | return false; |
264 | 80 | } |
265 | | bool may_intersect (const hb_bit_page_t &other) const |
266 | 0 | { return intersects (other); } |
267 | | |
268 | 0 | bool operator <= (const hb_bit_page_t &larger_page) const { return is_subset (larger_page); } |
269 | | bool is_subset (const hb_bit_page_t &larger_page) const |
270 | 0 | { |
271 | 0 | if (has_population () && larger_page.has_population () && |
272 | 0 | population > larger_page.population) |
273 | 0 | return false; |
274 | | |
275 | 0 | for (unsigned i = 0; i < len (); i++) |
276 | 0 | if (~larger_page.v[i] & v[i]) |
277 | 0 | return false; |
278 | 0 | return true; |
279 | 0 | } |
280 | | |
281 | 0 | bool has_population () const { return population != UINT_MAX; } |
282 | | unsigned get_population () const |
283 | 0 | { |
284 | 0 | if (has_population ()) return population; |
285 | 0 | return population = v; |
286 | 0 | } |
287 | | |
288 | | bool next (hb_codepoint_t *codepoint) const |
289 | 0 | { |
290 | 0 | unsigned int m = (*codepoint + 1) & MASK; |
291 | 0 | if (!m) |
292 | 0 | { |
293 | 0 | *codepoint = INVALID; |
294 | 0 | return false; |
295 | 0 | } |
296 | 0 | unsigned int i = m / ELT_BITS; |
297 | 0 | unsigned int j = m & ELT_MASK; |
298 | |
|
299 | 0 | const elt_t vv = v[i] & ~((elt_t (1) << j) - 1); |
300 | 0 | for (const elt_t *p = &vv; i < len (); p = ((const elt_t *) &v[0]) + (++i)) |
301 | 0 | if (*p) |
302 | 0 | { |
303 | 0 | *codepoint = i * ELT_BITS + elt_get_min (*p); |
304 | 0 | return true; |
305 | 0 | } |
306 | | |
307 | 0 | *codepoint = INVALID; |
308 | 0 | return false; |
309 | 0 | } |
310 | | bool previous (hb_codepoint_t *codepoint) const |
311 | 0 | { |
312 | 0 | unsigned int m = (*codepoint - 1) & MASK; |
313 | 0 | if (m == MASK) |
314 | 0 | { |
315 | 0 | *codepoint = INVALID; |
316 | 0 | return false; |
317 | 0 | } |
318 | 0 | unsigned int i = m / ELT_BITS; |
319 | 0 | unsigned int j = m & ELT_MASK; |
320 | | |
321 | | /* Fancy mask to avoid shifting by elt_t bitsize, which is undefined. */ |
322 | 0 | const elt_t mask = j < 8 * sizeof (elt_t) - 1 ? |
323 | 0 | ((elt_t (1) << (j + 1)) - 1) : |
324 | 0 | (elt_t) -1; |
325 | 0 | const elt_t vv = v[i] & mask; |
326 | 0 | const elt_t *p = &vv; |
327 | 0 | while (true) |
328 | 0 | { |
329 | 0 | if (*p) |
330 | 0 | { |
331 | 0 | *codepoint = i * ELT_BITS + elt_get_max (*p); |
332 | 0 | return true; |
333 | 0 | } |
334 | 0 | if ((int) i <= 0) break; |
335 | 0 | p = &v[--i]; |
336 | 0 | } |
337 | | |
338 | 0 | *codepoint = INVALID; |
339 | 0 | return false; |
340 | 0 | } |
341 | | hb_codepoint_t get_min () const |
342 | 0 | { |
343 | 0 | for (unsigned int i = 0; i < len (); i++) |
344 | 0 | if (v[i]) |
345 | 0 | return i * ELT_BITS + elt_get_min (v[i]); |
346 | 0 | return INVALID; |
347 | 0 | } |
348 | | hb_codepoint_t get_max () const |
349 | 0 | { |
350 | 0 | for (int i = len () - 1; i >= 0; i--) |
351 | 0 | if (v[i]) |
352 | 0 | return i * ELT_BITS + elt_get_max (v[i]); |
353 | 0 | return INVALID; |
354 | 0 | } |
355 | | |
356 | | /* |
357 | | * Iterator implementation. |
358 | | */ |
359 | | struct iter_t : hb_iter_with_fallback_t<iter_t, hb_codepoint_t> |
360 | | { |
361 | | static constexpr bool is_sorted_iterator = true; |
362 | | iter_t (const hb_bit_page_t &s_ = Null (hb_bit_page_t), bool init = true) : s (&s_), v (INVALID) |
363 | 0 | { |
364 | 0 | if (init) |
365 | 0 | v = s->get_min (); |
366 | 0 | } |
367 | | |
368 | | typedef hb_codepoint_t __item_t__; |
369 | 0 | hb_codepoint_t __item__ () const { return v; } |
370 | 0 | bool __more__ () const { return v != INVALID; } |
371 | 0 | void __next__ () { |
372 | 0 | s->next (&v); |
373 | 0 | } |
374 | 0 | void __prev__ () { s->previous (&v); } |
375 | 0 | iter_t end () const { return iter_t (*s, false); } |
376 | | bool operator != (const iter_t& o) const |
377 | 0 | { return v != o.v; } |
378 | | |
379 | | protected: |
380 | | const hb_bit_page_t *s; |
381 | | hb_codepoint_t v; |
382 | | }; |
383 | 0 | iter_t iter () const { return iter_t (*this); } |
384 | 0 | operator iter_t () const { return iter (); } |
385 | | |
386 | | static constexpr hb_codepoint_t INVALID = HB_SET_VALUE_INVALID; |
387 | | |
388 | | typedef unsigned long long elt_t; |
389 | | static constexpr unsigned PAGE_BITS_LOG_2 = 9; // 512 bits |
390 | | static constexpr unsigned PAGE_BITS = 1 << PAGE_BITS_LOG_2; |
391 | | static_assert (1 << PAGE_BITS_LOG_2 == PAGE_BITS, ""); |
392 | | static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, ""); |
393 | | static constexpr unsigned PAGE_BITMASK = PAGE_BITS - 1; |
394 | | |
395 | 0 | static unsigned int elt_get_min (const elt_t &elt) { return hb_ctz (elt); } |
396 | 0 | static unsigned int elt_get_max (const elt_t &elt) { return hb_bit_storage (elt) - 1; } |
397 | | |
398 | | typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t; |
399 | | |
400 | | static constexpr unsigned ELT_BITS = sizeof (elt_t) * 8; |
401 | | static constexpr unsigned ELT_MASK = ELT_BITS - 1; |
402 | | |
403 | | static constexpr unsigned BITS = sizeof (vector_t) * 8; |
404 | | static constexpr unsigned MASK = BITS - 1; |
405 | | static_assert ((unsigned) PAGE_BITS == (unsigned) BITS, ""); |
406 | | |
407 | 645k | elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; } |
408 | 545 | const elt_t& elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } |
409 | 646k | static constexpr elt_t mask (hb_codepoint_t g) { return elt_t (1) << (g & ELT_MASK); } |
410 | | |
411 | | mutable unsigned population; |
412 | | vector_t v; |
413 | | }; |
414 | | |
415 | | |
416 | | #endif /* HB_BIT_PAGE_HH */ |