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