[machine.rl] Remove unlikely from what happens 1/16 of the time

This commit is contained in:
Behdad Esfahbod 2022-11-24 12:52:15 -07:00
parent 1248574454
commit 76420ef769
8 changed files with 36 additions and 36 deletions

View File

@ -53,7 +53,7 @@ enum indic_syllable_type_t {
};
#line 57 "hb-ot-shaper-indic-machine.hh"
#line 54 "hb-ot-shaper-indic-machine.hh"
#define indic_syllable_machine_ex_A 9u
#define indic_syllable_machine_ex_C 1u
#define indic_syllable_machine_ex_CM 16u
@ -75,7 +75,7 @@ enum indic_syllable_type_t {
#define indic_syllable_machine_ex_ZWNJ 5u
#line 79 "hb-ot-shaper-indic-machine.hh"
#line 74 "hb-ot-shaper-indic-machine.hh"
static const unsigned char _indic_syllable_machine_trans_keys[] = {
8u, 8u, 4u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 4u, 12u, 4u, 8u, 8u, 8u,
5u, 7u, 5u, 8u, 4u, 8u, 4u, 12u, 4u, 12u, 4u, 12u, 8u, 8u, 5u, 7u,
@ -412,7 +412,7 @@ static const int indic_syllable_machine_en_main = 27;
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void
@ -422,7 +422,7 @@ find_syllables_indic (hb_buffer_t *buffer)
int cs;
hb_glyph_info_t *info = buffer->info;
#line 426 "hb-ot-shaper-indic-machine.hh"
#line 415 "hb-ot-shaper-indic-machine.hh"
{
cs = indic_syllable_machine_start;
ts = 0;
@ -438,7 +438,7 @@ find_syllables_indic (hb_buffer_t *buffer)
unsigned int syllable_serial = 1;
#line 442 "hb-ot-shaper-indic-machine.hh"
#line 427 "hb-ot-shaper-indic-machine.hh"
{
int _slen;
int _trans;
@ -452,7 +452,7 @@ _resume:
#line 1 "NONE"
{ts = p;}
break;
#line 456 "hb-ot-shaper-indic-machine.hh"
#line 439 "hb-ot-shaper-indic-machine.hh"
}
_keys = _indic_syllable_machine_trans_keys + (cs<<1);
@ -555,7 +555,7 @@ _eof_trans:
#line 113 "hb-ot-shaper-indic-machine.rl"
{act = 6;}
break;
#line 559 "hb-ot-shaper-indic-machine.hh"
#line 521 "hb-ot-shaper-indic-machine.hh"
}
_again:
@ -564,7 +564,7 @@ _again:
#line 1 "NONE"
{ts = 0;}
break;
#line 568 "hb-ot-shaper-indic-machine.hh"
#line 528 "hb-ot-shaper-indic-machine.hh"
}
if ( ++p != pe )

View File

@ -122,7 +122,7 @@ main := |*
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void

View File

@ -48,7 +48,7 @@ enum khmer_syllable_type_t {
};
#line 52 "hb-ot-shaper-khmer-machine.hh"
#line 49 "hb-ot-shaper-khmer-machine.hh"
#define khmer_syllable_machine_ex_C 1u
#define khmer_syllable_machine_ex_DOTTEDCIRCLE 11u
#define khmer_syllable_machine_ex_H 4u
@ -66,7 +66,7 @@ enum khmer_syllable_type_t {
#define khmer_syllable_machine_ex_ZWNJ 5u
#line 70 "hb-ot-shaper-khmer-machine.hh"
#line 65 "hb-ot-shaper-khmer-machine.hh"
static const unsigned char _khmer_syllable_machine_trans_keys[] = {
5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u,
5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u,
@ -284,7 +284,7 @@ static const int khmer_syllable_machine_en_main = 21;
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void
@ -294,7 +294,7 @@ find_syllables_khmer (hb_buffer_t *buffer)
int cs;
hb_glyph_info_t *info = buffer->info;
#line 298 "hb-ot-shaper-khmer-machine.hh"
#line 287 "hb-ot-shaper-khmer-machine.hh"
{
cs = khmer_syllable_machine_start;
ts = 0;
@ -310,7 +310,7 @@ find_syllables_khmer (hb_buffer_t *buffer)
unsigned int syllable_serial = 1;
#line 314 "hb-ot-shaper-khmer-machine.hh"
#line 299 "hb-ot-shaper-khmer-machine.hh"
{
int _slen;
int _trans;
@ -324,7 +324,7 @@ _resume:
#line 1 "NONE"
{ts = p;}
break;
#line 328 "hb-ot-shaper-khmer-machine.hh"
#line 311 "hb-ot-shaper-khmer-machine.hh"
}
_keys = _khmer_syllable_machine_trans_keys + (cs<<1);
@ -394,7 +394,7 @@ _eof_trans:
#line 98 "hb-ot-shaper-khmer-machine.rl"
{act = 3;}
break;
#line 398 "hb-ot-shaper-khmer-machine.hh"
#line 368 "hb-ot-shaper-khmer-machine.hh"
}
_again:
@ -403,7 +403,7 @@ _again:
#line 1 "NONE"
{ts = 0;}
break;
#line 407 "hb-ot-shaper-khmer-machine.hh"
#line 375 "hb-ot-shaper-khmer-machine.hh"
}
if ( ++p != pe )

View File

@ -107,7 +107,7 @@ main := |*
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void

View File

@ -50,7 +50,7 @@ enum myanmar_syllable_type_t {
};
#line 54 "hb-ot-shaper-myanmar-machine.hh"
#line 51 "hb-ot-shaper-myanmar-machine.hh"
#define myanmar_syllable_machine_ex_A 9u
#define myanmar_syllable_machine_ex_As 32u
#define myanmar_syllable_machine_ex_C 1u
@ -77,7 +77,7 @@ enum myanmar_syllable_type_t {
#define myanmar_syllable_machine_ex_ZWNJ 5u
#line 81 "hb-ot-shaper-myanmar-machine.hh"
#line 76 "hb-ot-shaper-myanmar-machine.hh"
static const unsigned char _myanmar_syllable_machine_trans_keys[] = {
1u, 41u, 3u, 41u, 5u, 39u, 5u, 8u, 3u, 41u, 3u, 39u, 3u, 39u, 5u, 39u,
5u, 39u, 3u, 39u, 3u, 39u, 3u, 41u, 5u, 39u, 1u, 15u, 3u, 39u, 3u, 39u,
@ -433,7 +433,7 @@ static const int myanmar_syllable_machine_en_main = 0;
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void
@ -443,7 +443,7 @@ find_syllables_myanmar (hb_buffer_t *buffer)
int cs;
hb_glyph_info_t *info = buffer->info;
#line 447 "hb-ot-shaper-myanmar-machine.hh"
#line 436 "hb-ot-shaper-myanmar-machine.hh"
{
cs = myanmar_syllable_machine_start;
ts = 0;
@ -459,7 +459,7 @@ find_syllables_myanmar (hb_buffer_t *buffer)
unsigned int syllable_serial = 1;
#line 463 "hb-ot-shaper-myanmar-machine.hh"
#line 448 "hb-ot-shaper-myanmar-machine.hh"
{
int _slen;
int _trans;
@ -473,7 +473,7 @@ _resume:
#line 1 "NONE"
{ts = p;}
break;
#line 477 "hb-ot-shaper-myanmar-machine.hh"
#line 460 "hb-ot-shaper-myanmar-machine.hh"
}
_keys = _myanmar_syllable_machine_trans_keys + (cs<<1);
@ -519,7 +519,7 @@ _eof_trans:
#line 113 "hb-ot-shaper-myanmar-machine.rl"
{te = p;p--;{ found_syllable (myanmar_non_myanmar_cluster); }}
break;
#line 523 "hb-ot-shaper-myanmar-machine.hh"
#line 498 "hb-ot-shaper-myanmar-machine.hh"
}
_again:
@ -528,7 +528,7 @@ _again:
#line 1 "NONE"
{ts = 0;}
break;
#line 532 "hb-ot-shaper-myanmar-machine.hh"
#line 505 "hb-ot-shaper-myanmar-machine.hh"
}
if ( ++p != pe )

View File

@ -122,7 +122,7 @@ main := |*
for (unsigned int i = ts; i < te; i++) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
inline void

View File

@ -53,7 +53,7 @@ enum use_syllable_type_t {
};
#line 57 "hb-ot-shaper-use-machine.hh"
#line 54 "hb-ot-shaper-use-machine.hh"
#define use_syllable_machine_ex_B 1u
#define use_syllable_machine_ex_CGJ 6u
#define use_syllable_machine_ex_CMAbv 31u
@ -97,7 +97,7 @@ enum use_syllable_type_t {
#define use_syllable_machine_ex_ZWNJ 14u
#line 101 "hb-ot-shaper-use-machine.hh"
#line 96 "hb-ot-shaper-use-machine.hh"
static const unsigned char _use_syllable_machine_trans_keys[] = {
0u, 53u, 11u, 53u, 11u, 53u, 1u, 53u, 14u, 48u, 14u, 47u, 14u, 47u, 14u, 47u,
14u, 46u, 14u, 46u, 14u, 14u, 14u, 48u, 14u, 48u, 14u, 48u, 1u, 14u, 14u, 48u,
@ -839,7 +839,7 @@ static const int use_syllable_machine_en_main = 0;
for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END
@ -929,7 +929,7 @@ find_syllables_use (hb_buffer_t *buffer)
unsigned int act HB_UNUSED;
int cs;
#line 933 "hb-ot-shaper-use-machine.hh"
#line 922 "hb-ot-shaper-use-machine.hh"
{
cs = use_syllable_machine_start;
ts = 0;
@ -942,7 +942,7 @@ find_syllables_use (hb_buffer_t *buffer)
unsigned int syllable_serial = 1;
#line 946 "hb-ot-shaper-use-machine.hh"
#line 931 "hb-ot-shaper-use-machine.hh"
{
int _slen;
int _trans;
@ -956,7 +956,7 @@ _resume:
#line 1 "NONE"
{ts = p;}
break;
#line 960 "hb-ot-shaper-use-machine.hh"
#line 943 "hb-ot-shaper-use-machine.hh"
}
_keys = _use_syllable_machine_trans_keys + (cs<<1);
@ -1046,7 +1046,7 @@ _eof_trans:
#line 178 "hb-ot-shaper-use-machine.rl"
{te = p;p--;{ found_syllable (use_non_cluster); }}
break;
#line 1050 "hb-ot-shaper-use-machine.hh"
#line 1014 "hb-ot-shaper-use-machine.hh"
}
_again:
@ -1055,7 +1055,7 @@ _again:
#line 1 "NONE"
{ts = 0;}
break;
#line 1059 "hb-ot-shaper-use-machine.hh"
#line 1021 "hb-ot-shaper-use-machine.hh"
}
if ( ++p != pe )

View File

@ -187,7 +187,7 @@ main := |*
for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \
info[i].syllable() = (syllable_serial << 4) | syllable_type; \
syllable_serial++; \
if (unlikely (syllable_serial == 16)) syllable_serial = 1; \
if (syllable_serial == 16) syllable_serial = 1; \
} HB_STMT_END