]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_target/src/abi/call/s390x.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / compiler / rustc_target / src / abi / call / s390x.rs
index 38aaee64a4d6b6978daa0a02c0933aed38542958..13706e8c217250a672552ddfd965721c9ad74f98 100644 (file)
@@ -2,7 +2,7 @@
 // for a pre-z13 machine or using -mno-vx.
 
 use crate::abi::call::{ArgAbi, FnAbi, Reg};
-use crate::abi::{self, HasDataLayout, TyAbiInterface, TyAndLayout};
+use crate::abi::{HasDataLayout, TyAbiInterface};
 
 fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
     if !ret.layout.is_aggregate() && ret.layout.size.bits() <= 64 {
@@ -12,24 +12,6 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
     }
 }
 
-fn is_single_fp_element<'a, Ty, C>(cx: &C, layout: TyAndLayout<'a, Ty>) -> bool
-where
-    Ty: TyAbiInterface<'a, C>,
-    C: HasDataLayout,
-{
-    match layout.abi {
-        abi::Abi::Scalar(scalar) => scalar.value.is_float(),
-        abi::Abi::Aggregate { .. } => {
-            if layout.fields.count() == 1 && layout.fields.offset(0).bytes() == 0 {
-                is_single_fp_element(cx, layout.field(cx, 0))
-            } else {
-                false
-            }
-        }
-        _ => false,
-    }
-}
-
 fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>)
 where
     Ty: TyAbiInterface<'a, C> + Copy,
@@ -40,7 +22,7 @@ where
         return;
     }
 
-    if is_single_fp_element(cx, arg.layout) {
+    if arg.layout.is_single_fp_element(cx) {
         match arg.layout.size.bytes() {
             4 => arg.cast_to(Reg::f32()),
             8 => arg.cast_to(Reg::f64()),