/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 | 841k | elt_t& operator [] (unsigned int i) { return v[i]; } |
43 | 290 | const elt_t& operator [] (unsigned int i) const { return v[i]; } |
44 | | |
45 | | void init0 () |
46 | 644 | { |
47 | 5.79k | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
48 | 5.15k | v[i] = 0; |
49 | 644 | } |
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<$_12>($_12 const&) const Unexecuted instantiation: hb-face.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-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<$_13>($_13 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<$_13>($_13 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&) const Unexecuted instantiation: hb-ot-metrics.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-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<$_13>($_13 const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_11>($_11 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<$_13>($_13 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<$_13>($_13 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<$_13>($_13 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<$_9>($_9 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<$_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<$_13>($_13 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<$_10>($_10 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<$_14>($_14 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<$_10>($_10 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<$_14>($_14 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<$_10>($_10 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<$_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<$_11>($_11 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<$_12>($_12 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: hb-ot-metrics.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-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<$_14>($_14 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<$_10>($_10 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<$_14>($_14 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<$_8>($_8 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<$_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<$_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<$_10>($_10 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<$_14>($_14 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<$_10>($_10 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<$_14>($_14 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<$_10>($_10 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<$_14>($_14 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 | 322 | hb_bit_page_t () { init0 (); } |
115 | | |
116 | 644 | void init0 () { v.init0 (); population = 0; } |
117 | 0 | void init1 () { v.init1 (); population = PAGE_BITS; } |
118 | | |
119 | 841k | void dirty () { population = UINT_MAX; } |
120 | | |
121 | | static inline constexpr unsigned len () |
122 | 0 | { 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 | 841k | void add (hb_codepoint_t g) { elt (g) |= mask (g); dirty (); } |
138 | 0 | void del (hb_codepoint_t g) { elt (g) &= ~mask (g); dirty (); } |
139 | 0 | void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); } |
140 | 290 | bool get (hb_codepoint_t g) const { return elt (g) & mask (g); } |
141 | 0 | bool may_have (hb_codepoint_t g) const { return get (g); } |
142 | | |
143 | 0 | bool operator [] (hb_codepoint_t g) const { return get (g); } |
144 | 0 | bool operator () (hb_codepoint_t g) const { return get (g); } |
145 | 0 | bool has (hb_codepoint_t g) const { return get (g); } |
146 | | |
147 | | void add_range (hb_codepoint_t a, hb_codepoint_t b) |
148 | 0 | { |
149 | 0 | elt_t *la = &elt (a); |
150 | 0 | elt_t *lb = &elt (b); |
151 | 0 | if (la == lb) |
152 | 0 | *la |= (mask (b) << 1) - mask(a); |
153 | 0 | else |
154 | 0 | { |
155 | 0 | *la |= ~(mask (a) - 1llu); |
156 | 0 | la++; |
157 | |
|
158 | 0 | hb_memset (la, 0xff, (char *) lb - (char *) la); |
159 | |
|
160 | 0 | *lb |= ((mask (b) << 1) - 1llu); |
161 | 0 | } |
162 | 0 | dirty (); |
163 | 0 | } |
164 | | void del_range (hb_codepoint_t a, hb_codepoint_t b) |
165 | 0 | { |
166 | 0 | elt_t *la = &elt (a); |
167 | 0 | elt_t *lb = &elt (b); |
168 | 0 | if (la == lb) |
169 | 0 | *la &= ~((mask (b) << 1llu) - mask(a)); |
170 | 0 | else |
171 | 0 | { |
172 | 0 | *la &= mask (a) - 1; |
173 | 0 | la++; |
174 | |
|
175 | 0 | hb_memset (la, 0, (char *) lb - (char *) la); |
176 | |
|
177 | 0 | *lb &= ~((mask (b) << 1) - 1llu); |
178 | 0 | } |
179 | 0 | dirty (); |
180 | 0 | } |
181 | | void set_range (hb_codepoint_t a, hb_codepoint_t b, bool v) |
182 | 0 | { if (v) add_range (a, b); else del_range (a, b); } |
183 | | |
184 | | |
185 | | // Writes out page values to the array p. Returns the number of values |
186 | | // written. At most size codepoints will be written. |
187 | | unsigned int write (uint32_t base, |
188 | | unsigned int start_value, |
189 | | hb_codepoint_t *p, |
190 | | unsigned int size) const |
191 | 0 | { |
192 | 0 | unsigned int start_v = start_value / ELT_BITS; |
193 | 0 | unsigned int start_bit = start_value & ELT_MASK; |
194 | 0 | unsigned int count = 0; |
195 | 0 | for (unsigned i = start_v; i < len () && count < size; i++) |
196 | 0 | { |
197 | 0 | elt_t bits = v[i]; |
198 | 0 | uint32_t v_base = base | (i * ELT_BITS); |
199 | 0 | for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) |
200 | 0 | { |
201 | 0 | if ((elt_t(1) << j) & bits) { |
202 | 0 | *p++ = v_base | j; |
203 | 0 | count++; |
204 | 0 | } |
205 | 0 | } |
206 | 0 | start_bit = 0; |
207 | 0 | } |
208 | 0 | return count; |
209 | 0 | } |
210 | | |
211 | | // Writes out the values NOT in this page to the array p. Returns the |
212 | | // number of values written. At most size codepoints will be written. |
213 | | // Returns the number of codepoints written. next_value holds the next value |
214 | | // that should be written (if not present in this page). This is used to fill |
215 | | // any missing value gaps between this page and the previous page, if any. |
216 | | // next_value is updated to one more than the last value present in this page. |
217 | | unsigned int write_inverted (uint32_t base, |
218 | | unsigned int start_value, |
219 | | hb_codepoint_t *p, |
220 | | unsigned int size, |
221 | | hb_codepoint_t *next_value) const |
222 | 0 | { |
223 | 0 | unsigned int start_v = start_value / ELT_BITS; |
224 | 0 | unsigned int start_bit = start_value & ELT_MASK; |
225 | 0 | unsigned int count = 0; |
226 | 0 | for (unsigned i = start_v; i < len () && count < size; i++) |
227 | 0 | { |
228 | 0 | elt_t bits = v[i]; |
229 | 0 | uint32_t v_offset = i * ELT_BITS; |
230 | 0 | for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) |
231 | 0 | { |
232 | 0 | if ((elt_t(1) << j) & bits) |
233 | 0 | { |
234 | 0 | hb_codepoint_t value = base | v_offset | j; |
235 | | // Emit all the missing values from next_value up to value - 1. |
236 | 0 | for (hb_codepoint_t k = *next_value; k < value && count < size; k++) |
237 | 0 | { |
238 | 0 | *p++ = k; |
239 | 0 | count++; |
240 | 0 | } |
241 | | // Skip over this value; |
242 | 0 | *next_value = value + 1; |
243 | 0 | } |
244 | 0 | } |
245 | 0 | start_bit = 0; |
246 | 0 | } |
247 | 0 | return count; |
248 | 0 | } |
249 | | |
250 | 0 | bool operator == (const hb_bit_page_t &other) const { return is_equal (other); } |
251 | 0 | bool is_equal (const hb_bit_page_t &other) const { return v == other.v; } |
252 | | bool intersects (const hb_bit_page_t &other) const |
253 | 0 | { |
254 | 0 | for (unsigned i = 0; i < len (); i++) |
255 | 0 | if (v[i] & other.v[i]) |
256 | 0 | return true; |
257 | 0 | return false; |
258 | 0 | } |
259 | | bool may_intersect (const hb_bit_page_t &other) const |
260 | 0 | { return intersects (other); } |
261 | | |
262 | 0 | bool operator <= (const hb_bit_page_t &larger_page) const { return is_subset (larger_page); } |
263 | | bool is_subset (const hb_bit_page_t &larger_page) const |
264 | 0 | { |
265 | 0 | if (has_population () && larger_page.has_population () && |
266 | 0 | population > larger_page.population) |
267 | 0 | return false; |
268 | | |
269 | 0 | for (unsigned i = 0; i < len (); i++) |
270 | 0 | if (~larger_page.v[i] & v[i]) |
271 | 0 | return false; |
272 | 0 | return true; |
273 | 0 | } |
274 | | |
275 | 0 | bool has_population () const { return population != UINT_MAX; } |
276 | | unsigned get_population () const |
277 | 0 | { |
278 | 0 | if (has_population ()) return population; |
279 | 0 | return population = v; |
280 | 0 | } |
281 | | |
282 | | bool next (hb_codepoint_t *codepoint) const |
283 | 0 | { |
284 | 0 | unsigned int m = (*codepoint + 1) & MASK; |
285 | 0 | if (!m) |
286 | 0 | { |
287 | 0 | *codepoint = INVALID; |
288 | 0 | return false; |
289 | 0 | } |
290 | 0 | unsigned int i = m / ELT_BITS; |
291 | 0 | unsigned int j = m & ELT_MASK; |
292 | |
|
293 | 0 | const elt_t vv = v[i] & ~((elt_t (1) << j) - 1); |
294 | 0 | for (const elt_t *p = &vv; i < len (); p = ((const elt_t *) &v[0]) + (++i)) |
295 | 0 | if (*p) |
296 | 0 | { |
297 | 0 | *codepoint = i * ELT_BITS + elt_get_min (*p); |
298 | 0 | return true; |
299 | 0 | } |
300 | | |
301 | 0 | *codepoint = INVALID; |
302 | 0 | return false; |
303 | 0 | } |
304 | | bool previous (hb_codepoint_t *codepoint) const |
305 | 0 | { |
306 | 0 | unsigned int m = (*codepoint - 1) & MASK; |
307 | 0 | if (m == MASK) |
308 | 0 | { |
309 | 0 | *codepoint = INVALID; |
310 | 0 | return false; |
311 | 0 | } |
312 | 0 | unsigned int i = m / ELT_BITS; |
313 | 0 | unsigned int j = m & ELT_MASK; |
314 | | |
315 | | /* Fancy mask to avoid shifting by elt_t bitsize, which is undefined. */ |
316 | 0 | const elt_t mask = j < 8 * sizeof (elt_t) - 1 ? |
317 | 0 | ((elt_t (1) << (j + 1)) - 1) : |
318 | 0 | (elt_t) -1; |
319 | 0 | const elt_t vv = v[i] & mask; |
320 | 0 | const elt_t *p = &vv; |
321 | 0 | while (true) |
322 | 0 | { |
323 | 0 | if (*p) |
324 | 0 | { |
325 | 0 | *codepoint = i * ELT_BITS + elt_get_max (*p); |
326 | 0 | return true; |
327 | 0 | } |
328 | 0 | if ((int) i <= 0) break; |
329 | 0 | p = &v[--i]; |
330 | 0 | } |
331 | | |
332 | 0 | *codepoint = INVALID; |
333 | 0 | return false; |
334 | 0 | } |
335 | | hb_codepoint_t get_min () const |
336 | 0 | { |
337 | 0 | for (unsigned int i = 0; i < len (); i++) |
338 | 0 | if (v[i]) |
339 | 0 | return i * ELT_BITS + elt_get_min (v[i]); |
340 | 0 | return INVALID; |
341 | 0 | } |
342 | | hb_codepoint_t get_max () const |
343 | 0 | { |
344 | 0 | for (int i = len () - 1; i >= 0; i--) |
345 | 0 | if (v[i]) |
346 | 0 | return i * ELT_BITS + elt_get_max (v[i]); |
347 | 0 | return 0; |
348 | 0 | } |
349 | | |
350 | | /* |
351 | | * Iterator implementation. |
352 | | */ |
353 | | struct iter_t : hb_iter_with_fallback_t<iter_t, hb_codepoint_t> |
354 | | { |
355 | | static constexpr bool is_sorted_iterator = true; |
356 | | iter_t (const hb_bit_page_t &s_ = Null (hb_bit_page_t), bool init = true) : s (&s_), v (INVALID) |
357 | 0 | { |
358 | 0 | if (init) |
359 | 0 | v = s->get_min (); |
360 | 0 | } |
361 | | |
362 | | typedef hb_codepoint_t __item_t__; |
363 | 0 | hb_codepoint_t __item__ () const { return v; } |
364 | 0 | bool __more__ () const { return v != INVALID; } |
365 | 0 | void __next__ () { |
366 | 0 | s->next (&v); |
367 | 0 | } |
368 | 0 | void __prev__ () { s->previous (&v); } |
369 | 0 | iter_t end () const { return iter_t (*s, false); } |
370 | | bool operator != (const iter_t& o) const |
371 | 0 | { return v != o.v; } |
372 | | |
373 | | protected: |
374 | | const hb_bit_page_t *s; |
375 | | hb_codepoint_t v; |
376 | | }; |
377 | 0 | iter_t iter () const { return iter_t (*this); } |
378 | 0 | operator iter_t () const { return iter (); } |
379 | | |
380 | | static constexpr hb_codepoint_t INVALID = HB_SET_VALUE_INVALID; |
381 | | |
382 | | typedef unsigned long long elt_t; |
383 | | static constexpr unsigned PAGE_BITS_LOG_2 = 9; // 512 bits |
384 | | static constexpr unsigned PAGE_BITS = 1 << PAGE_BITS_LOG_2; |
385 | | static_assert (1 << PAGE_BITS_LOG_2 == PAGE_BITS, ""); |
386 | | static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, ""); |
387 | | static constexpr unsigned PAGE_BITMASK = PAGE_BITS - 1; |
388 | | |
389 | 0 | static unsigned int elt_get_min (const elt_t &elt) { return hb_ctz (elt); } |
390 | 0 | static unsigned int elt_get_max (const elt_t &elt) { return hb_bit_storage (elt) - 1; } |
391 | | |
392 | | typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t; |
393 | | |
394 | | static constexpr unsigned ELT_BITS = sizeof (elt_t) * 8; |
395 | | static constexpr unsigned ELT_MASK = ELT_BITS - 1; |
396 | | |
397 | | static constexpr unsigned BITS = sizeof (vector_t) * 8; |
398 | | static constexpr unsigned MASK = BITS - 1; |
399 | | static_assert ((unsigned) PAGE_BITS == (unsigned) BITS, ""); |
400 | | |
401 | 841k | elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; } |
402 | 290 | const elt_t& elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } |
403 | 841k | static constexpr elt_t mask (hb_codepoint_t g) { return elt_t (1) << (g & ELT_MASK); } |
404 | | |
405 | | mutable unsigned population; |
406 | | vector_t v; |
407 | | }; |
408 | | |
409 | | |
410 | | #endif /* HB_BIT_PAGE_HH */ |