1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Reference: PTX Writer's Guide to Interoperability
12 // http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability
14 use abi::{ArgType, FnType, LayoutExt};
16 fn classify_ret_ty(ret: &mut ArgType) {
17 if ret.layout.is_aggregate() && ret.layout.size.bits() > 64 {
20 ret.extend_integer_width_to(64);
24 fn classify_arg_ty(arg: &mut ArgType) {
25 if arg.layout.is_aggregate() && arg.layout.size.bits() > 64 {
28 arg.extend_integer_width_to(64);
32 pub fn compute_abi_info(fty: &mut FnType) {
33 if !fty.ret.is_ignore() {
34 classify_ret_ty(&mut fty.ret);
37 for arg in &mut fty.args {