Return bools in GPR registers.

Boolean types are returned in %rax, so regclass_for_abi_type() should
return GPR.

Fixes #179.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-25 13:34:55 -07:00
parent 02e81dd1d7
commit 1b71285b34
2 changed files with 25 additions and 1 deletions

View File

@@ -125,7 +125,11 @@ pub fn legalize_signature(sig: &mut ir::Signature, flags: &shared_settings::Flag
/// Get register class for a type appearing in a legalized signature.
pub fn regclass_for_abi_type(ty: ir::Type) -> RegClass {
if ty.is_int() { GPR } else { FPR }
if ty.is_int() || ty.is_bool() {
GPR
} else {
FPR
}
}
/// Get the set of allocatable registers for `func`.