Skip to content

Commit e48d452

Browse files
committed
Allocate registers for i128
Closes #38763.
1 parent c1a08a5 commit e48d452

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_trans/cabi_x86_64.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use abi::{ArgType, CastTarget, FnType, LayoutExt, Reg, RegKind};
1515
use context::CrateContext;
1616

17-
use rustc::ty::layout::{self, TyLayout, Size};
17+
use rustc::ty::layout::{self, Integer, Primitive, TyLayout, Size};
1818

1919
#[derive(Clone, Copy, PartialEq, Debug)]
2020
enum Class {
@@ -87,7 +87,12 @@ fn classify_arg<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &ArgType<'tcx>)
8787
layout::Abi::Uninhabited => return Ok(()),
8888

8989
layout::Abi::Scalar(ref scalar) => {
90+
if let Primitive::Int(Integer::I128, _) = scalar.value {
91+
unify(cls, off, Class::Int);
92+
unify(cls, off + Size::from_bytes(8), Class::Int);
93+
} else {
9094
unify(cls, off, Class::from_layout(ccx, layout));
95+
}
9196
off + scalar.value.size(ccx)
9297
}
9398

0 commit comments

Comments
 (0)