Coverage Report

Created: 2025-07-01 07:01

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