Index: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp =================================================================== --- llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -552,6 +552,34 @@ { ISD::FP_TO_UINT, MVT::nxv8i16, MVT::nxv8f32, 1 }, { ISD::FP_TO_UINT, MVT::nxv8i8, MVT::nxv8f32, 1 }, + // Complex, from nxv8f16 + { ISD::FP_TO_SINT, MVT::nxv8i64, MVT::nxv8f16, 4 }, + { ISD::FP_TO_SINT, MVT::nxv8i32, MVT::nxv8f16, 2 }, + { ISD::FP_TO_SINT, MVT::nxv8i8, MVT::nxv8f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv8i64, MVT::nxv8f16, 4 }, + { ISD::FP_TO_UINT, MVT::nxv8i32, MVT::nxv8f16, 2 }, + { ISD::FP_TO_UINT, MVT::nxv8i8, MVT::nxv8f16, 1 }, + + // Complex, from nxv4f16 + { ISD::FP_TO_SINT, MVT::nxv4i64, MVT::nxv4f16, 2 }, + { ISD::FP_TO_SINT, MVT::nxv4i32, MVT::nxv4f16, 1 }, + { ISD::FP_TO_SINT, MVT::nxv4i16, MVT::nxv4f16, 1 }, + { ISD::FP_TO_SINT, MVT::nxv4i8, MVT::nxv4f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv4i64, MVT::nxv4f16, 2 }, + { ISD::FP_TO_UINT, MVT::nxv4i32, MVT::nxv4f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv4i16, MVT::nxv4f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv4i8, MVT::nxv4f16, 1 }, + + // Complex, from nxv2f16 + { ISD::FP_TO_SINT, MVT::nxv2i64, MVT::nxv2f16, 1 }, + { ISD::FP_TO_SINT, MVT::nxv2i32, MVT::nxv2f16, 1 }, + { ISD::FP_TO_SINT, MVT::nxv2i16, MVT::nxv2f16, 1 }, + { ISD::FP_TO_SINT, MVT::nxv2i8, MVT::nxv2f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i64, MVT::nxv2f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i32, MVT::nxv2f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i16, MVT::nxv2f16, 1 }, + { ISD::FP_TO_UINT, MVT::nxv2i8, MVT::nxv2f16, 1 }, + // Truncate from nxvmf32 to nxvmf16. { ISD::FP_ROUND, MVT::nxv2f16, MVT::nxv2f32, 1 }, { ISD::FP_ROUND, MVT::nxv4f16, MVT::nxv4f32, 1 }, Index: llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll =================================================================== --- llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll +++ llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll @@ -8,6 +8,12 @@ define void @sve-fptoi() { ;CHECK-LABEL: 'sve-fptoi' + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui64 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si8 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui8 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si32 = fptosi undef to @@ -20,6 +26,12 @@ ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv2f64_to_ui32 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_si64 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f16_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f16_to_ui64 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f32_to_si8 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f32_to_ui8 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_si32 = fptosi undef to @@ -32,6 +44,12 @@ ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_ui32 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_si64 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv4f64_to_ui64 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f16_to_si8 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f16_to_ui8 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f16_to_si32 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f16_to_ui32 = fptoui undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f16_to_si64 = fptosi undef to + ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f16_to_ui64 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f32_to_si8 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f32_to_ui8 = fptoui undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %nv8f32_to_si32 = fptosi undef to @@ -45,6 +63,13 @@ ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f64_to_si64 = fptosi undef to ;CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f64_to_ui64 = fptoui undef to + %nv2f16_to_si8 = fptosi undef to + %nv2f16_to_ui8 = fptoui undef to + %nv2f16_to_si32 = fptosi undef to + %nv2f16_to_ui32 = fptoui undef to + %nv2f16_to_si64 = fptosi undef to + %nv2f16_to_ui64 = fptoui undef to + %nv2f32_to_si8 = fptosi undef to %nv2f32_to_ui8 = fptoui undef to %nv2f32_to_si32 = fptosi undef to @@ -59,6 +84,13 @@ %nv2f64_to_si64 = fptosi undef to %nv2f64_to_ui64 = fptoui undef to + %nv4f16_to_si8 = fptosi undef to + %nv4f16_to_ui8 = fptoui undef to + %nv4f16_to_si32 = fptosi undef to + %nv4f16_to_ui32 = fptoui undef to + %nv4f16_to_si64 = fptosi undef to + %nv4f16_to_ui64 = fptoui undef to + %nv4f32_to_si8 = fptosi undef to %nv4f32_to_ui8 = fptoui undef to %nv4f32_to_si32 = fptosi undef to @@ -73,6 +105,13 @@ %nv4f64_to_si64 = fptosi undef to %nv4f64_to_ui64 = fptoui undef to + %nv8f16_to_si8 = fptosi undef to + %nv8f16_to_ui8 = fptoui undef to + %nv8f16_to_si32 = fptosi undef to + %nv8f16_to_ui32 = fptoui undef to + %nv8f16_to_si64 = fptosi undef to + %nv8f16_to_ui64 = fptoui undef to + %nv8f32_to_si8 = fptosi undef to %nv8f32_to_ui8 = fptoui undef to %nv8f32_to_si32 = fptosi undef to