/src/harfbuzz/src/hb-bit-page.hh
Line | Count | Source (jump to first uncovered line) |
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 | 28.2M | elt_t& operator [] (unsigned int i) { return v[i]; } |
43 | 0 | const elt_t& operator [] (unsigned int i) const { return v[i]; } |
44 | | |
45 | | void init0 () |
46 | 10.3M | { |
47 | 93.3M | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
48 | 82.9M | v[i] = 0; |
49 | 10.3M | } |
50 | | void init1 () |
51 | 11.7M | { |
52 | 105M | for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) |
53 | 93.9M | v[i] = (elt_t) -1; |
54 | 11.7M | } |
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-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_20>($_20 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<$_18>($_18 const&) const Unexecuted instantiation: hb-buffer.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 const&) const Unexecuted instantiation: hb-common.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 const&) const Unexecuted instantiation: hb-face.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 const&) const Unexecuted instantiation: hb-font.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 const&) const Unexecuted instantiation: hb-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 const&) const Unexecuted instantiation: hb-ot-color.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 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<$_20>($_20 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<$_19>($_19 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<$_20>($_20 const&) const Unexecuted instantiation: hb-ot-math.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 const&) const Unexecuted instantiation: hb-ot-meta.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 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<$_19>($_19 const&) const Unexecuted instantiation: hb-ot-name.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 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<$_18>($_18 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<$_19>($_19 const&) const Unexecuted instantiation: hb-set.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_18>($_18 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<$_19>($_19 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<$_19>($_19 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<$_18>($_18 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<$_20>($_20 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_18>($_18 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<$_20>($_20 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<$_18>($_18 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<$_18>($_18 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-aat-layout.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_17>($_17 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<$_18>($_18 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<$_21>($_21 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-aat-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-common.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-common.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_17>($_17 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-common.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_20>($_20 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-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-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-map.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-color.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-color.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_17>($_17 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-color.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_20>($_20 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<$_17>($_17 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<$_18>($_18 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<$_21>($_21 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 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<$_18>($_18 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<$_17>($_17 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<$_21>($_21 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-math.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-math.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_17>($_17 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-math.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_20>($_20 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-meta.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-meta.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-meta.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-name.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-name.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 const&, hb_vector_size_t<unsigned long long, 64u> const&) const Unexecuted instantiation: hb-ot-name.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_19>($_19 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-shape.cc:hb_vector_size_t<unsigned long long, 64u> hb_vector_size_t<unsigned long long, 64u>::process<$_16>($_16 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<$_19>($_19 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 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<$_16>($_16 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<$_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<$_19>($_19 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 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<$_16>($_16 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<$_17>($_17 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<$_20>($_20 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<$_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<$_16>($_16 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<$_19>($_19 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<$_17>($_17 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<$_18>($_18 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<$_21>($_21 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<$_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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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<$_17>($_17 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<$_18>($_18 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<$_21>($_21 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<$_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<$_16>($_16 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<$_19>($_19 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<$_15>($_15 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<$_16>($_16 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<$_19>($_19 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 | | hb_array_t<const elt_t> iter () const |
82 | 0 | { return hb_array (v); } |
83 | | |
84 | | private: |
85 | | static_assert (0 == byte_size % sizeof (elt_t), ""); |
86 | | elt_t v[byte_size / sizeof (elt_t)]; |
87 | | }; |
88 | | |
89 | | |
90 | | struct hb_bit_page_t |
91 | | { |
92 | 10.3M | void init0 () { v.init0 (); } |
93 | 11.7M | void init1 () { v.init1 (); } |
94 | | |
95 | | static inline constexpr unsigned len () |
96 | 0 | { return ARRAY_LENGTH_CONST (v); } |
97 | | |
98 | | bool is_empty () const |
99 | 0 | { |
100 | 0 | return |
101 | 0 | + hb_iter (v) |
102 | 0 | | hb_none |
103 | 0 | ; |
104 | 0 | } |
105 | | uint32_t hash () const |
106 | 0 | { |
107 | 0 | return |
108 | 0 | + hb_iter (v) |
109 | 0 | | hb_reduce ([] (uint32_t h, const elt_t &_) { return h * 31 + hb_hash (_); }, (uint32_t) 0u) |
110 | 0 | ; |
111 | 0 | } |
112 | | |
113 | 1.14M | void add (hb_codepoint_t g) { elt (g) |= mask (g); } |
114 | 18.0M | void del (hb_codepoint_t g) { elt (g) &= ~mask (g); } |
115 | 0 | void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); } |
116 | 0 | bool get (hb_codepoint_t g) const { return elt (g) & mask (g); } |
117 | | |
118 | | void add_range (hb_codepoint_t a, hb_codepoint_t b) |
119 | 4.18M | { |
120 | 4.18M | elt_t *la = &elt (a); |
121 | 4.18M | elt_t *lb = &elt (b); |
122 | 4.18M | if (la == lb) |
123 | 3.16M | *la |= (mask (b) << 1) - mask(a); |
124 | 1.02M | else |
125 | 1.02M | { |
126 | 1.02M | *la |= ~(mask (a) - 1); |
127 | 1.02M | la++; |
128 | | |
129 | 1.02M | hb_memset (la, 0xff, (char *) lb - (char *) la); |
130 | | |
131 | 1.02M | *lb |= ((mask (b) << 1) - 1); |
132 | 1.02M | } |
133 | 4.18M | } |
134 | | void del_range (hb_codepoint_t a, hb_codepoint_t b) |
135 | 368k | { |
136 | 368k | elt_t *la = &elt (a); |
137 | 368k | elt_t *lb = &elt (b); |
138 | 368k | if (la == lb) |
139 | 84.6k | *la &= ~((mask (b) << 1) - mask(a)); |
140 | 283k | else |
141 | 283k | { |
142 | 283k | *la &= mask (a) - 1; |
143 | 283k | la++; |
144 | | |
145 | 283k | hb_memset (la, 0, (char *) lb - (char *) la); |
146 | | |
147 | 283k | *lb &= ~((mask (b) << 1) - 1); |
148 | 283k | } |
149 | 368k | } |
150 | | void set_range (hb_codepoint_t a, hb_codepoint_t b, bool v) |
151 | 0 | { if (v) add_range (a, b); else del_range (a, b); } |
152 | | |
153 | | |
154 | | // Writes out page values to the array p. Returns the number of values |
155 | | // written. At most size codepoints will be written. |
156 | | unsigned int write (uint32_t base, |
157 | | unsigned int start_value, |
158 | | hb_codepoint_t *p, |
159 | | unsigned int size) const |
160 | 0 | { |
161 | 0 | unsigned int start_v = start_value / ELT_BITS; |
162 | 0 | unsigned int start_bit = start_value & ELT_MASK; |
163 | 0 | unsigned int count = 0; |
164 | 0 | for (unsigned i = start_v; i < len () && count < size; i++) |
165 | 0 | { |
166 | 0 | elt_t bits = v[i]; |
167 | 0 | uint32_t v_base = base | (i * ELT_BITS); |
168 | 0 | for (unsigned int j = start_bit; j < ELT_BITS && count < size; j++) |
169 | 0 | { |
170 | 0 | if ((elt_t(1) << j) & bits) { |
171 | 0 | *p++ = v_base | j; |
172 | 0 | count++; |
173 | 0 | } |
174 | 0 | } |
175 | 0 | start_bit = 0; |
176 | 0 | } |
177 | 0 | return count; |
178 | 0 | } |
179 | | |
180 | | // Writes out the values NOT in this page to the array p. Returns the |
181 | | // number of values written. At most size codepoints will be written. |
182 | | // Returns the number of codepoints written. next_value holds the next value |
183 | | // that should be written (if not present in this page). This is used to fill |
184 | | // any missing value gaps between this page and the previous page, if any. |
185 | | // next_value is updated to one more than the last value present in this page. |
186 | | unsigned int write_inverted (uint32_t base, |
187 | | unsigned int start_value, |
188 | | hb_codepoint_t *p, |
189 | | unsigned int size, |
190 | | hb_codepoint_t *next_value) 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_offset = 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 | { |
203 | 0 | hb_codepoint_t value = base | v_offset | j; |
204 | | // Emit all the missing values from next_value up to value - 1. |
205 | 0 | for (hb_codepoint_t k = *next_value; k < value && count < size; k++) |
206 | 0 | { |
207 | 0 | *p++ = k; |
208 | 0 | count++; |
209 | 0 | } |
210 | | // Skip over this value; |
211 | 0 | *next_value = value + 1; |
212 | 0 | } |
213 | 0 | } |
214 | 0 | start_bit = 0; |
215 | 0 | } |
216 | 0 | return count; |
217 | 0 | } |
218 | | |
219 | | bool is_equal (const hb_bit_page_t &other) const |
220 | 0 | { |
221 | 0 | for (unsigned i = 0; i < len (); i++) |
222 | 0 | if (v[i] != other.v[i]) |
223 | 0 | return false; |
224 | 0 | return true; |
225 | 0 | } |
226 | | bool is_subset (const hb_bit_page_t &larger_page) const |
227 | 0 | { |
228 | 0 | for (unsigned i = 0; i < len (); i++) |
229 | 0 | if (~larger_page.v[i] & v[i]) |
230 | 0 | return false; |
231 | 0 | return true; |
232 | 0 | } |
233 | | |
234 | | unsigned int get_population () const |
235 | 0 | { |
236 | 0 | return |
237 | 0 | + hb_iter (v) |
238 | 0 | | hb_reduce ([] (unsigned pop, const elt_t &_) { return pop + hb_popcount (_); }, 0u) |
239 | 0 | ; |
240 | 0 | } |
241 | | |
242 | | bool next (hb_codepoint_t *codepoint) const |
243 | 0 | { |
244 | 0 | unsigned int m = (*codepoint + 1) & MASK; |
245 | 0 | if (!m) |
246 | 0 | { |
247 | 0 | *codepoint = INVALID; |
248 | 0 | return false; |
249 | 0 | } |
250 | 0 | unsigned int i = m / ELT_BITS; |
251 | 0 | unsigned int j = m & ELT_MASK; |
252 | |
|
253 | 0 | const elt_t vv = v[i] & ~((elt_t (1) << j) - 1); |
254 | 0 | for (const elt_t *p = &vv; i < len (); p = &v[++i]) |
255 | 0 | if (*p) |
256 | 0 | { |
257 | 0 | *codepoint = i * ELT_BITS + elt_get_min (*p); |
258 | 0 | return true; |
259 | 0 | } |
260 | | |
261 | 0 | *codepoint = INVALID; |
262 | 0 | return false; |
263 | 0 | } |
264 | | bool previous (hb_codepoint_t *codepoint) const |
265 | 0 | { |
266 | 0 | unsigned int m = (*codepoint - 1) & MASK; |
267 | 0 | if (m == MASK) |
268 | 0 | { |
269 | 0 | *codepoint = INVALID; |
270 | 0 | return false; |
271 | 0 | } |
272 | 0 | unsigned int i = m / ELT_BITS; |
273 | 0 | unsigned int j = m & ELT_MASK; |
274 | | |
275 | | /* Fancy mask to avoid shifting by elt_t bitsize, which is undefined. */ |
276 | 0 | const elt_t mask = j < 8 * sizeof (elt_t) - 1 ? |
277 | 0 | ((elt_t (1) << (j + 1)) - 1) : |
278 | 0 | (elt_t) -1; |
279 | 0 | const elt_t vv = v[i] & mask; |
280 | 0 | const elt_t *p = &vv; |
281 | 0 | while (true) |
282 | 0 | { |
283 | 0 | if (*p) |
284 | 0 | { |
285 | 0 | *codepoint = i * ELT_BITS + elt_get_max (*p); |
286 | 0 | return true; |
287 | 0 | } |
288 | 0 | if ((int) i <= 0) break; |
289 | 0 | p = &v[--i]; |
290 | 0 | } |
291 | | |
292 | 0 | *codepoint = INVALID; |
293 | 0 | return false; |
294 | 0 | } |
295 | | hb_codepoint_t get_min () const |
296 | 0 | { |
297 | 0 | for (unsigned int i = 0; i < len (); i++) |
298 | 0 | if (v[i]) |
299 | 0 | return i * ELT_BITS + elt_get_min (v[i]); |
300 | 0 | return INVALID; |
301 | 0 | } |
302 | | hb_codepoint_t get_max () const |
303 | 0 | { |
304 | 0 | for (int i = len () - 1; i >= 0; i--) |
305 | 0 | if (v[i]) |
306 | 0 | return i * ELT_BITS + elt_get_max (v[i]); |
307 | 0 | return 0; |
308 | 0 | } |
309 | | |
310 | | static constexpr hb_codepoint_t INVALID = HB_SET_VALUE_INVALID; |
311 | | |
312 | | typedef unsigned long long elt_t; |
313 | | static constexpr unsigned PAGE_BITS_LOG_2 = 9; // 512 bits |
314 | | static constexpr unsigned PAGE_BITS = 1 << PAGE_BITS_LOG_2; |
315 | | static_assert (1 << PAGE_BITS_LOG_2 == PAGE_BITS, ""); |
316 | | static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, ""); |
317 | | static constexpr unsigned PAGE_BITMASK = PAGE_BITS - 1; |
318 | | |
319 | 0 | static unsigned int elt_get_min (const elt_t &elt) { return hb_ctz (elt); } |
320 | 0 | static unsigned int elt_get_max (const elt_t &elt) { return hb_bit_storage (elt) - 1; } |
321 | | |
322 | | typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t; |
323 | | |
324 | | static constexpr unsigned ELT_BITS = sizeof (elt_t) * 8; |
325 | | static constexpr unsigned ELT_MASK = ELT_BITS - 1; |
326 | | |
327 | | static constexpr unsigned BITS = sizeof (vector_t) * 8; |
328 | | static constexpr unsigned MASK = BITS - 1; |
329 | | static_assert ((unsigned) PAGE_BITS == (unsigned) BITS, ""); |
330 | | |
331 | 28.2M | elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; } |
332 | 0 | const elt_t& elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } |
333 | 28.2M | static constexpr elt_t mask (hb_codepoint_t g) { return elt_t (1) << (g & ELT_MASK); } |
334 | | |
335 | | vector_t v; |
336 | | }; |
337 | | static_assert (hb_bit_page_t::PAGE_BITS == sizeof (hb_bit_page_t) * 8, ""); |
338 | | |
339 | | |
340 | | #endif /* HB_BIT_PAGE_HH */ |