Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
1b0c9cd0
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
接近 2 年 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1b0c9cd0
编写于
10月 13, 2015
作者:
A
Alex Dowad
提交者:
Rich Felker
10月 13, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
recognize partial register operands in i386 CFI generation
上级
8cfdfa9c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
10 deletion
+19
-10
tools/add-cfi.i386.awk
tools/add-cfi.i386.awk
+19
-10
未找到文件。
tools/add-cfi.i386.awk
浏览文件 @
1b0c9cd0
...
...
@@ -27,20 +27,29 @@ function get_const1() {
match
(
$0
,
/-
?(
0x
[
0-9a-fA-F
]
+|
[
0-9
]
+
)
,/
)
return
parse_const
(
substr
(
$0
,
RSTART
,
RLENGTH
-
1
))
}
function
canonicalize_reg
(
register
)
{
if
(
match
(
register
,
/^e/
))
return
register
else
if
(
match
(
register
,
/
[
hl
]
$/
))
# AH, AL, BH, BL, etc
return
"e"
substr
(
register
,
1
,
1
)
"x"
else
# AX, BX, CX, etc
return
"e"
register
}
function
get_reg
()
{
# only use if you already know there is 1 and only 1 register
match
(
$0
,
/%e
(
ax|bx|cx|dx
|si|di|bp
)
/
)
return
substr
(
$0
,
RSTART
+
1
,
3
)
match
(
$0
,
/%e
?([
abcd
][
hlx
]
|si|di|bp
)
/
)
return
canonicalize_reg
(
substr
(
$0
,
RSTART
+
1
,
RLENGTH
-
1
)
)
}
function
get_reg1
()
{
# for instructions with 2 operands, get 1st operand (assuming it is register)
match
(
$0
,
/%e
(
ax|bx|cx|dx
|si|di|bp
)
,/
)
return
substr
(
$0
,
RSTART
+
1
,
3
)
match
(
$0
,
/%e
?([
abcd
][
hlx
]
|si|di|bp
)
,/
)
return
canonicalize_reg
(
substr
(
$0
,
RSTART
+
1
,
RLENGTH
-
2
)
)
}
function
get_reg2
()
{
# for instructions with 2 operands, get 2nd operand (assuming it is register)
match
(
$0
,
/,%e
(
ax|bx|cx|dx
|si|di|bp
)
/
)
return
substr
(
$0
,
RSTART
+
RLENGTH
-
3
,
3
)
match
(
$0
,
/,%e
?([
abcd
][
hlx
]
|si|di|bp
)
/
)
return
canonicalize_reg
(
substr
(
$0
,
RSTART
+
2
,
RLENGTH
-
2
)
)
}
function
adjust_sp_offset
(
delta
)
{
...
...
@@ -184,14 +193,14 @@ function trashed(register) {
}
# this does NOT exhaustively check for all possible instructions which could
# overwrite a register value inherited from the caller (just the common ones)
/mov.*,%e
(
ax|bx|cx|dx
|si|di|bp
)
$/
{
trashed
(
get_reg2
())
}
/
(
add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr
)
.*,%e
(
ax|bx|cx|dx
|si|di|bp
)
$/
{
/mov.*,%e
?([
abcd
][
hlx
]
|si|di|bp
)
$/
{
trashed
(
get_reg2
())
}
/
(
add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr
)
.*,%e
?([
abcd
][
hlx
]
|si|di|bp
)
$/
{
trashed
(
get_reg2
())
}
/^i
?
mul
[^
,
]
*$/
{
trashed
(
"eax"
);
trashed
(
"edx"
)
}
/^i
?
mul.*,%e
(
ax|bx|cx|dx
|si|di|bp
)
$/
{
trashed
(
get_reg2
())
}
/^i
?
mul.*,%e
?([
abcd
][
hlx
]
|si|di|bp
)
$/
{
trashed
(
get_reg2
())
}
/^i
?
div/
{
trashed
(
"eax"
);
trashed
(
"edx"
)
}
/
(
dec|inc|not|neg|pop
)
%e
(
ax|bx|cx|dx
|si|di|bp
)
/
{
trashed
(
get_reg
())
}
/
(
dec|inc|not|neg|pop
)
%e
?([
abcd
][
hlx
]
|si|di|bp
)
/
{
trashed
(
get_reg
())
}
/cpuid/
{
trashed
(
"eax"
);
trashed
(
"ebx"
);
trashed
(
"ecx"
);
trashed
(
"edx"
)
}
END
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录