Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
facd2857
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
facd2857
编写于
8月 16, 2009
作者:
B
Blue Swirl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
user: compile host-utils.c only once
Signed-off-by:
N
Blue Swirl
<
blauwirbel@gmail.com
>
上级
e27b27b3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
19 deletion
+20
-19
Makefile
Makefile
+1
-1
Makefile.target
Makefile.target
+1
-1
host-utils.c
host-utils.c
+2
-1
host-utils.h
host-utils.h
+16
-16
未找到文件。
Makefile
浏览文件 @
facd2857
...
...
@@ -162,7 +162,7 @@ libqemu_common.a: $(obj-y)
#######################################################################
# user-obj-y is code used by qemu userspace emulation
user-obj-y
=
cutils.o cache-utils.o path.o envlist.o
user-obj-y
=
cutils.o cache-utils.o path.o envlist.o
host-utils.o
libqemu_user.a
:
$(user-obj-y)
...
...
Makefile.target
浏览文件 @
facd2857
...
...
@@ -35,7 +35,7 @@ all: $(PROGS)
#########################################################
# cpu emulator library
libobj-y
=
exec.o translate-all.o cpu-exec.o translate.o
host-utils.o
libobj-y
=
exec.o translate-all.o cpu-exec.o translate.o
libobj-$(CONFIG_KQEMU)
+=
kqemu.o
libobj-y
+=
tcg/tcg.o tcg/tcg-runtime.o
libobj-$(CONFIG_SOFTFLOAT)
+=
fpu/softfloat.o
...
...
host-utils.c
浏览文件 @
facd2857
...
...
@@ -23,7 +23,8 @@
* THE SOFTWARE.
*/
#include "exec.h"
#include <stdlib.h>
#include <stdint.h>
#include "host-utils.h"
//#define DEBUG_MULDIV
...
...
host-utils.h
浏览文件 @
facd2857
...
...
@@ -27,16 +27,16 @@
#if defined(__x86_64__)
#define __HAVE_FAST_MULU64__
static
always_inline
void
mulu64
(
uint64_t
*
plow
,
uint64_t
*
phigh
,
uint64_t
a
,
uint64_t
b
)
static
inline
void
mulu64
(
uint64_t
*
plow
,
uint64_t
*
phigh
,
uint64_t
a
,
uint64_t
b
)
{
__asm__
(
"mul %0
\n\t
"
:
"=d"
(
*
phigh
),
"=a"
(
*
plow
)
:
"a"
(
a
),
"0"
(
b
));
}
#define __HAVE_FAST_MULS64__
static
always_inline
void
muls64
(
uint64_t
*
plow
,
uint64_t
*
phigh
,
int64_t
a
,
int64_t
b
)
static
inline
void
muls64
(
uint64_t
*
plow
,
uint64_t
*
phigh
,
int64_t
a
,
int64_t
b
)
{
__asm__
(
"imul %0
\n\t
"
:
"=d"
(
*
phigh
),
"=a"
(
*
plow
)
...
...
@@ -49,7 +49,7 @@ void mulu64(uint64_t *phigh, uint64_t *plow, uint64_t a, uint64_t b);
/* Binary search for leading zeros. */
static
always_
inline
int
clz32
(
uint32_t
val
)
static
inline
int
clz32
(
uint32_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
if
(
val
)
...
...
@@ -86,12 +86,12 @@ static always_inline int clz32(uint32_t val)
#endif
}
static
always_
inline
int
clo32
(
uint32_t
val
)
static
inline
int
clo32
(
uint32_t
val
)
{
return
clz32
(
~
val
);
}
static
always_
inline
int
clz64
(
uint64_t
val
)
static
inline
int
clz64
(
uint64_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
if
(
val
)
...
...
@@ -111,12 +111,12 @@ static always_inline int clz64(uint64_t val)
#endif
}
static
always_
inline
int
clo64
(
uint64_t
val
)
static
inline
int
clo64
(
uint64_t
val
)
{
return
clz64
(
~
val
);
}
static
always_
inline
int
ctz32
(
uint32_t
val
)
static
inline
int
ctz32
(
uint32_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
if
(
val
)
...
...
@@ -155,12 +155,12 @@ static always_inline int ctz32(uint32_t val)
#endif
}
static
always_
inline
int
cto32
(
uint32_t
val
)
static
inline
int
cto32
(
uint32_t
val
)
{
return
ctz32
(
~
val
);
}
static
always_
inline
int
ctz64
(
uint64_t
val
)
static
inline
int
ctz64
(
uint64_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
if
(
val
)
...
...
@@ -180,12 +180,12 @@ static always_inline int ctz64(uint64_t val)
#endif
}
static
always_
inline
int
cto64
(
uint64_t
val
)
static
inline
int
cto64
(
uint64_t
val
)
{
return
ctz64
(
~
val
);
}
static
always_
inline
int
ctpop8
(
uint8_t
val
)
static
inline
int
ctpop8
(
uint8_t
val
)
{
val
=
(
val
&
0x55
)
+
((
val
>>
1
)
&
0x55
);
val
=
(
val
&
0x33
)
+
((
val
>>
2
)
&
0x33
);
...
...
@@ -194,7 +194,7 @@ static always_inline int ctpop8(uint8_t val)
return
val
;
}
static
always_
inline
int
ctpop16
(
uint16_t
val
)
static
inline
int
ctpop16
(
uint16_t
val
)
{
val
=
(
val
&
0x5555
)
+
((
val
>>
1
)
&
0x5555
);
val
=
(
val
&
0x3333
)
+
((
val
>>
2
)
&
0x3333
);
...
...
@@ -204,7 +204,7 @@ static always_inline int ctpop16(uint16_t val)
return
val
;
}
static
always_
inline
int
ctpop32
(
uint32_t
val
)
static
inline
int
ctpop32
(
uint32_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
return
__builtin_popcount
(
val
);
...
...
@@ -219,7 +219,7 @@ static always_inline int ctpop32(uint32_t val)
#endif
}
static
always_
inline
int
ctpop64
(
uint64_t
val
)
static
inline
int
ctpop64
(
uint64_t
val
)
{
#if QEMU_GNUC_PREREQ(3, 4)
return
__builtin_popcountll
(
val
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录