Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d775d79a
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d775d79a
编写于
11月 25, 2017
作者:
S
Scott McMurray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update compiler-builtins and use it the 128-bit lowering MIR test
上级
70517540
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
92 deletion
+33
-92
src/libcompiler_builtins
src/libcompiler_builtins
+1
-1
src/test/mir-opt/lower_128bit_debug_test.rs
src/test/mir-opt/lower_128bit_debug_test.rs
+16
-46
src/test/mir-opt/lower_128bit_test.rs
src/test/mir-opt/lower_128bit_test.rs
+16
-45
未找到文件。
libcompiler_builtins
@
18feaccb
比较
02b3734a
...
18feaccb
Subproject commit
02b3734a5ba6de984eb5a02c50860cc014e58d5
6
Subproject commit
18feaccbfd0dfbd5ab5d0a2a6eac9c04be66726
6
src/test/mir-opt/lower_128bit_debug_test.rs
浏览文件 @
d775d79a
...
...
@@ -13,36 +13,6 @@
#![feature(i128_type)]
#![feature(lang_items)]
#[lang=
"i128_div"
]
fn
i128_div
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
3
}
#[lang=
"u128_div"
]
fn
u128_div
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
4
}
#[lang=
"i128_rem"
]
fn
i128_rem
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
5
}
#[lang=
"u128_rem"
]
fn
u128_rem
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
6
}
#[lang=
"i128_addo"
]
fn
i128_addo
(
_
x
:
i128
,
_
y
:
i128
)
->
(
i128
,
bool
)
{
(
0
,
false
)
}
#[lang=
"u128_addo"
]
fn
u128_addo
(
_
x
:
u128
,
_
y
:
u128
)
->
(
u128
,
bool
)
{
(
1
,
false
)
}
#[lang=
"i128_subo"
]
fn
i128_subo
(
_
x
:
i128
,
_
y
:
i128
)
->
(
i128
,
bool
)
{
(
2
,
false
)
}
#[lang=
"u128_subo"
]
fn
u128_subo
(
_
x
:
u128
,
_
y
:
u128
)
->
(
u128
,
bool
)
{
(
3
,
false
)
}
#[lang=
"i128_mulo"
]
fn
i128_mulo
(
_
x
:
i128
,
_
y
:
i128
)
->
(
i128
,
bool
)
{
(
4
,
false
)
}
#[lang=
"u128_mulo"
]
fn
u128_mulo
(
_
x
:
u128
,
_
y
:
u128
)
->
(
u128
,
bool
)
{
(
5
,
false
)
}
#[lang=
"i128_shlo"
]
fn
i128_shlo
(
_
x
:
i128
,
_
y
:
u128
)
->
(
i128
,
bool
)
{
(
6
,
false
)
}
#[lang=
"u128_shlo"
]
fn
u128_shlo
(
_
x
:
u128
,
_
y
:
u128
)
->
(
u128
,
bool
)
{
(
6
,
false
)
}
#[lang=
"i128_shro"
]
fn
i128_shro
(
_
x
:
i128
,
_
y
:
u128
)
->
(
i128
,
bool
)
{
(
7
,
false
)
}
#[lang=
"u128_shro"
]
fn
u128_shro
(
_
x
:
u128
,
_
y
:
u128
)
->
(
u128
,
bool
)
{
(
8
,
false
)
}
fn
test_signed
(
mut
x
:
i128
)
->
i128
{
x
+=
1
;
x
-=
2
;
...
...
@@ -66,31 +36,31 @@ fn test_unsigned(mut x: u128) -> u128 {
}
fn
main
()
{
test_signed
(
-
200
);
test_unsigned
(
200
);
assert_eq!
(
test_signed
(
-
222
),
-
1
);
assert_eq!
(
test_unsigned
(
200
),
2
);
}
// END RUST SOURCE
// START rustc.test_signed.Lower128Bit.after.mir
// _2 = const i128_addo(_1, const 1i128) -> bb10;
// _2 = const
compiler_builtins::int::addsub::rust_
i128_addo(_1, const 1i128) -> bb10;
// ...
// _1 = move (_2.0: i128);
// _3 = const i128_subo(_1, const 2i128) -> bb11;
// _3 = const
compiler_builtins::int::addsub::rust_
i128_subo(_1, const 2i128) -> bb11;
// ...
// _1 = move (_3.0: i128);
// _4 = const i128_mulo(_1, const 3i128) -> bb12;
// _4 = const
compiler_builtins::int::mul::rust_
i128_mulo(_1, const 3i128) -> bb12;
// ...
// _1 = move (_4.0: i128);
// ...
// _1 = const i128_div(_1, const 4i128) -> bb13;
// _1 = const
compiler_builtins::int::sdiv::rust_
i128_div(_1, const 4i128) -> bb13;
// ...
// _1 = const i128_rem(_1, const 5i128) -> bb15;
// _1 = const
compiler_builtins::int::sdiv::rust_
i128_rem(_1, const 5i128) -> bb15;
// ...
// _1 = move (_13.0: i128);
// ...
// _17 = const 7i32 as u128 (Misc);
// _14 = const i128_shro(_1, move _17) -> bb16;
// _14 = const
compiler_builtins::int::shift::rust_
i128_shro(_1, move _17) -> bb16;
// ...
// _1 = move (_14.0: i128);
// ...
...
...
@@ -103,30 +73,30 @@ fn main() {
// assert(!move (_13.1: bool), "attempt to shift left with overflow") -> bb8;
// ...
// _16 = const 6i32 as u128 (Misc);
// _13 = const i128_shlo(_1, move _16) -> bb14;
// _13 = const
compiler_builtins::int::shift::rust_
i128_shlo(_1, move _16) -> bb14;
// ...
// assert(!move (_14.1: bool), "attempt to shift right with overflow") -> bb9;
// END rustc.test_signed.Lower128Bit.after.mir
// START rustc.test_unsigned.Lower128Bit.after.mir
// _2 = const u128_addo(_1, const 1u128) -> bb8;
// _2 = const
compiler_builtins::int::addsub::rust_
u128_addo(_1, const 1u128) -> bb8;
// ...
// _1 = move (_2.0: u128);
// _3 = const u128_subo(_1, const 2u128) -> bb9;
// _3 = const
compiler_builtins::int::addsub::rust_
u128_subo(_1, const 2u128) -> bb9;
// ...
// _1 = move (_3.0: u128);
// _4 = const u128_mulo(_1, const 3u128) -> bb10;
// _4 = const
compiler_builtins::int::mul::rust_
u128_mulo(_1, const 3u128) -> bb10;
// ...
// _1 = move (_4.0: u128);
// ...
// _1 = const u128_div(_1, const 4u128) -> bb11;
// _1 = const
compiler_builtins::int::udiv::rust_
u128_div(_1, const 4u128) -> bb11;
// ...
// _1 = const u128_rem(_1, const 5u128) -> bb13;
// _1 = const
compiler_builtins::int::udiv::rust_
u128_rem(_1, const 5u128) -> bb13;
// ...
// _1 = move (_7.0: u128);
// ...
// _11 = const 7i32 as u128 (Misc);
// _8 = const u128_shro(_1, move _11) -> bb14;
// _8 = const
compiler_builtins::int::shift::rust_
u128_shro(_1, move _11) -> bb14;
// ...
// _1 = move (_8.0: u128);
// ...
...
...
@@ -139,7 +109,7 @@ fn main() {
// assert(!move (_7.1: bool), "attempt to shift left with overflow") -> bb6;
// ...
// _10 = const 6i32 as u128 (Misc);
// _7 = const u128_shlo(_1, move _10) -> bb12;
// _7 = const
compiler_builtins::int::shift::rust_
u128_shlo(_1, move _10) -> bb12;
// ...
// assert(!move (_8.1: bool), "attempt to shift right with overflow") -> bb7;
// END rustc.test_unsigned.Lower128Bit.after.mir
src/test/mir-opt/lower_128bit_test.rs
浏览文件 @
d775d79a
...
...
@@ -13,35 +13,6 @@
#![feature(i128_type)]
#![feature(lang_items)]
#[lang=
"i128_add"
]
fn
i128_add
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
0
}
#[lang=
"u128_add"
]
fn
u128_add
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
0
}
#[lang=
"i128_sub"
]
fn
i128_sub
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
1
}
#[lang=
"u128_sub"
]
fn
u128_sub
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
1
}
#[lang=
"i128_mul"
]
fn
i128_mul
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
2
}
#[lang=
"u128_mul"
]
fn
u128_mul
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
2
}
#[lang=
"i128_div"
]
fn
i128_div
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
3
}
#[lang=
"u128_div"
]
fn
u128_div
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
4
}
#[lang=
"i128_rem"
]
fn
i128_rem
(
_
x
:
i128
,
_
y
:
i128
)
->
i128
{
5
}
#[lang=
"u128_rem"
]
fn
u128_rem
(
_
x
:
u128
,
_
y
:
u128
)
->
u128
{
6
}
#[lang=
"i128_shl"
]
fn
i128_shl
(
_
x
:
i128
,
_
y
:
u32
)
->
i128
{
7
}
#[lang=
"u128_shl"
]
fn
u128_shl
(
_
x
:
u128
,
_
y
:
u32
)
->
u128
{
7
}
#[lang=
"i128_shr"
]
fn
i128_shr
(
_
x
:
i128
,
_
y
:
u32
)
->
i128
{
8
}
#[lang=
"u128_shr"
]
fn
u128_shr
(
_
x
:
u128
,
_
y
:
u32
)
->
u128
{
9
}
fn
test_signed
(
mut
x
:
i128
)
->
i128
{
x
+=
1
;
x
-=
2
;
...
...
@@ -65,44 +36,44 @@ fn test_unsigned(mut x: u128) -> u128 {
}
fn
main
()
{
test_signed
(
-
200
);
test_unsigned
(
200
);
assert_eq!
(
test_signed
(
-
222
),
-
1
);
assert_eq!
(
test_unsigned
(
200
),
2
);
}
// END RUST SOURCE
// START rustc.test_signed.Lower128Bit.after.mir
// _1 = const i128_add(_1, const 1i128) -> bb7;
// _1 = const
compiler_builtins::int::addsub::rust_
i128_add(_1, const 1i128) -> bb7;
// ...
// _1 = const i128_div(_1, const 4i128) -> bb8;
// _1 = const
compiler_builtins::int::sdiv::rust_
i128_div(_1, const 4i128) -> bb8;
// ...
// _1 = const i128_rem(_1, const 5i128) -> bb11;
// _1 = const
compiler_builtins::int::sdiv::rust_
i128_rem(_1, const 5i128) -> bb11;
// ...
// _1 = const i128_mul(_1, const 3i128) -> bb5;
// _1 = const
compiler_builtins::int::mul::rust_
i128_mul(_1, const 3i128) -> bb5;
// ...
// _1 = const i128_sub(_1, const 2i128) -> bb6;
// _1 = const
compiler_builtins::int::addsub::rust_
i128_sub(_1, const 2i128) -> bb6;
// ...
// _11 = const 7i32 as u32 (Misc);
// _1 = const i128_shr(_1, move _11) -> bb9;
// _1 = const
compiler_builtins::int::shift::rust_
i128_shr(_1, move _11) -> bb9;
// ...
// _12 = const 6i32 as u32 (Misc);
// _1 = const i128_shl(_1, move _12) -> bb10;
// _1 = const
compiler_builtins::int::shift::rust_
i128_shl(_1, move _12) -> bb10;
// END rustc.test_signed.Lower128Bit.after.mir
// START rustc.test_unsigned.Lower128Bit.after.mir
// _1 = const u128_add(_1, const 1u128) -> bb5;
// _1 = const
compiler_builtins::int::addsub::rust_
u128_add(_1, const 1u128) -> bb5;
// ...
// _1 = const u128_div(_1, const 4u128) -> bb6;
// _1 = const
compiler_builtins::int::udiv::rust_
u128_div(_1, const 4u128) -> bb6;
// ...
// _1 = const u128_rem(_1, const 5u128) -> bb9;
// _1 = const
compiler_builtins::int::udiv::rust_
u128_rem(_1, const 5u128) -> bb9;
// ...
// _1 = const u128_mul(_1, const 3u128) -> bb3;
// _1 = const
compiler_builtins::int::mul::rust_
u128_mul(_1, const 3u128) -> bb3;
// ...
// _1 = const u128_sub(_1, const 2u128) -> bb4;
// _1 = const
compiler_builtins::int::addsub::rust_
u128_sub(_1, const 2u128) -> bb4;
// ...
// _5 = const 7i32 as u32 (Misc);
// _1 = const u128_shr(_1, move _5) -> bb7;
// _1 = const
compiler_builtins::int::shift::rust_
u128_shr(_1, move _5) -> bb7;
// ...
// _6 = const 6i32 as u32 (Misc);
// _1 = const u128_shl(_1, move _6) -> bb8;
// _1 = const
compiler_builtins::int::shift::rust_
u128_shl(_1, move _6) -> bb8;
// END rustc.test_unsigned.Lower128Bit.after.mir
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录