Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f7a45851
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f7a45851
编写于
5月 15, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add hb_bitwise_* ops
上级
d822e0a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
28 deletion
+42
-28
src/hb-algs.hh
src/hb-algs.hh
+35
-21
src/hb-set.hh
src/hb-set.hh
+7
-7
未找到文件。
src/hb-algs.hh
浏览文件 @
f7a45851
...
...
@@ -765,30 +765,44 @@ hb_codepoint_parse (const char *s, unsigned int len, int base, hb_codepoint_t *o
}
struct
HbOpO
r
struct
hb_bitwise_o
r
{
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
true
;
template
<
typename
T
>
static
void
process
(
T
&
o
,
const
T
&
a
,
const
T
&
b
)
{
o
=
a
|
b
;
}
};
struct
HbOpAnd
template
<
typename
T
>
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
|
b
)
}
HB_FUNCOBJ
(
hb_bitwise_or
);
struct
hb_bitwise_and
{
static
constexpr
bool
passthru_left
=
false
;
static
constexpr
bool
passthru_right
=
false
;
template
<
typename
T
>
static
void
process
(
T
&
o
,
const
T
&
a
,
const
T
&
b
)
{
o
=
a
&
b
;
}
};
struct
HbOpMinus
template
<
typename
T
>
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
&
b
)
}
HB_FUNCOBJ
(
hb_bitwise_and
);
struct
hb_bitwise_xor
{
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
false
;
template
<
typename
T
>
static
void
process
(
T
&
o
,
const
T
&
a
,
const
T
&
b
)
{
o
=
a
&
~
b
;
}
};
struct
HbOpXor
static
constexpr
bool
passthru_right
=
true
;
template
<
typename
T
>
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
^
b
)
}
HB_FUNCOBJ
(
hb_bitwise_xor
);
struct
hb_bitwise_sub
{
static
constexpr
bool
passthru_left
=
true
;
static
constexpr
bool
passthru_right
=
true
;
template
<
typename
T
>
static
void
process
(
T
&
o
,
const
T
&
a
,
const
T
&
b
)
{
o
=
a
^
b
;
}
};
static
constexpr
bool
passthru_right
=
false
;
template
<
typename
T
>
auto
operator
()
(
const
T
&
a
,
const
T
&
b
)
const
HB_AUTO_RETURN
(
a
&
~
b
)
}
HB_FUNCOBJ
(
hb_bitwise_sub
);
struct
hb_bitwise_neg
{
template
<
typename
T
>
auto
operator
()
(
const
T
&
a
)
const
HB_AUTO_RETURN
(
~
a
)
}
HB_FUNCOBJ
(
hb_bitwise_neg
);
/* Compiler-assisted vectorization. */
...
...
@@ -804,26 +818,26 @@ struct hb_vector_size_t
void
clear
(
unsigned
char
v
=
0
)
{
memset
(
this
,
v
,
sizeof
(
*
this
));
}
template
<
class
Op
>
hb_vector_size_t
process
(
const
hb_vector_size_t
&
o
)
const
template
<
typename
Op
>
hb_vector_size_t
process
(
const
Op
&
op
,
const
hb_vector_size_t
&
o
)
const
{
hb_vector_size_t
r
;
#if HB_VECTOR_SIZE
if
(
HB_VECTOR_SIZE
&&
0
==
(
byte_size
*
8
)
%
HB_VECTOR_SIZE
)
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
u
.
vec
);
i
++
)
Op
::
process
(
r
.
u
.
vec
[
i
],
u
.
vec
[
i
],
o
.
u
.
vec
[
i
]);
r
.
u
.
vec
[
i
]
=
op
(
u
.
vec
[
i
],
o
.
u
.
vec
[
i
]);
else
#endif
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
u
.
v
);
i
++
)
Op
::
process
(
r
.
u
.
v
[
i
],
u
.
v
[
i
],
o
.
u
.
v
[
i
]);
r
.
u
.
v
[
i
]
=
op
(
u
.
v
[
i
],
o
.
u
.
v
[
i
]);
return
r
;
}
hb_vector_size_t
operator
|
(
const
hb_vector_size_t
&
o
)
const
{
return
process
<
HbOpOr
>
(
o
);
}
{
return
process
(
hb_bitwise_or
,
o
);
}
hb_vector_size_t
operator
&
(
const
hb_vector_size_t
&
o
)
const
{
return
process
<
HbOpAnd
>
(
o
);
}
{
return
process
(
hb_bitwise_and
,
o
);
}
hb_vector_size_t
operator
^
(
const
hb_vector_size_t
&
o
)
const
{
return
process
<
HbOpXor
>
(
o
);
}
{
return
process
(
hb_bitwise_xor
,
o
);
}
hb_vector_size_t
operator
~
()
const
{
hb_vector_size_t
r
;
...
...
src/hb-set.hh
浏览文件 @
f7a45851
...
...
@@ -440,8 +440,8 @@ struct hb_set_t
return
true
;
}
template
<
class
Op
>
void
process
(
const
hb_set_t
*
other
)
template
<
typename
Op
>
void
process
(
const
Op
&
op
,
const
hb_set_t
*
other
)
{
if
(
unlikely
(
!
successful
))
return
;
...
...
@@ -495,7 +495,7 @@ struct hb_set_t
b
--
;
count
--
;
page_map
[
count
]
=
page_map
[
a
];
Op
::
process
(
page_at
(
count
).
v
,
page_at
(
a
).
v
,
other
->
page_at
(
b
).
v
);
page_at
(
count
).
v
=
op
(
page_at
(
a
).
v
,
other
->
page_at
(
b
).
v
);
}
else
if
(
page_map
[
a
-
1
].
major
>
other
->
page_map
[
b
-
1
].
major
)
{
...
...
@@ -541,19 +541,19 @@ struct hb_set_t
void
union_
(
const
hb_set_t
*
other
)
{
process
<
HbOpOr
>
(
other
);
process
(
hb_bitwise_or
,
other
);
}
void
intersect
(
const
hb_set_t
*
other
)
{
process
<
HbOpAnd
>
(
other
);
process
(
hb_bitwise_and
,
other
);
}
void
subtract
(
const
hb_set_t
*
other
)
{
process
<
HbOpMinus
>
(
other
);
process
(
hb_bitwise_sub
,
other
);
}
void
symmetric_difference
(
const
hb_set_t
*
other
)
{
process
<
HbOpXor
>
(
other
);
process
(
hb_bitwise_xor
,
other
);
}
bool
next
(
hb_codepoint_t
*
codepoint
)
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录