diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -1337,6 +1337,9 @@ setOperationAction(ISD::AVGFLOORU, VT, Custom); setOperationAction(ISD::AVGCEILS, VT, Custom); setOperationAction(ISD::AVGCEILU, VT, Custom); + + if (!Subtarget->isLittleEndian()) + setOperationAction(ISD::BITCAST, VT, Expand); } // Illegal unpacked integer vector types. @@ -1486,6 +1489,9 @@ setCondCodeAction(ISD::SETUGT, VT, Expand); setCondCodeAction(ISD::SETUEQ, VT, Expand); setCondCodeAction(ISD::SETONE, VT, Expand); + + if (!Subtarget->isLittleEndian()) + setOperationAction(ISD::BITCAST, VT, Expand); } for (auto VT : {MVT::nxv2bf16, MVT::nxv4bf16, MVT::nxv8bf16}) { @@ -1495,6 +1501,9 @@ setOperationAction(ISD::MLOAD, VT, Custom); setOperationAction(ISD::INSERT_SUBVECTOR, VT, Custom); setOperationAction(ISD::SPLAT_VECTOR, VT, Legal); + + if (!Subtarget->isLittleEndian()) + setOperationAction(ISD::BITCAST, VT, Expand); } setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::i8, Custom); diff --git a/llvm/test/CodeGen/AArch64/sve-bitcast.ll b/llvm/test/CodeGen/AArch64/sve-bitcast.ll --- a/llvm/test/CodeGen/AArch64/sve-bitcast.ll +++ b/llvm/test/CodeGen/AArch64/sve-bitcast.ll @@ -1,6 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -mtriple=aarch64-linux-gnu < %s | FileCheck %s -; RUN: not --crash llc -mtriple=aarch64_be < %s +; RUN: llc -mtriple=aarch64_be < %s | FileCheck %s --check-prefix=CHECK_BE ; ; bitcast to nxv16i8 @@ -10,6 +10,18 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -18,6 +30,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -26,6 +50,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -34,6 +70,18 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -42,6 +90,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -50,6 +110,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -58,6 +130,18 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv16i8: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv16i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -70,6 +154,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -78,6 +174,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -86,6 +194,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -94,6 +214,17 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -102,6 +233,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -110,6 +253,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -118,6 +273,17 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv8i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv8i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -130,6 +296,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -138,6 +316,18 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -146,6 +336,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -154,6 +356,18 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -162,6 +376,17 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -170,6 +395,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -178,6 +415,18 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv4i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv4i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -190,6 +439,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -198,6 +459,18 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -206,6 +479,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -214,6 +499,18 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -222,6 +519,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -230,6 +539,17 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -238,6 +558,18 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv2i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv2i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -250,6 +582,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -258,6 +602,17 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -266,6 +621,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -274,6 +641,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -282,6 +661,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -290,6 +681,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -298,6 +701,17 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv8f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv8f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -310,6 +724,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -318,6 +744,18 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -326,6 +764,17 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -334,6 +783,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -342,6 +803,18 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -350,6 +823,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -358,6 +843,18 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv4f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv4f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -370,6 +867,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -378,6 +887,18 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -386,6 +907,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -394,6 +927,17 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -402,6 +946,18 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -410,6 +966,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -418,6 +986,18 @@ ; CHECK-LABEL: bitcast_nxv8bf16_to_nxv2f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8bf16_to_nxv2f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -430,6 +1010,18 @@ ; CHECK-LABEL: bitcast_nxv16i8_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv16i8_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -438,6 +1030,17 @@ ; CHECK-LABEL: bitcast_nxv8i16_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i16_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -446,6 +1049,18 @@ ; CHECK-LABEL: bitcast_nxv4i32_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i32_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -454,6 +1069,18 @@ ; CHECK-LABEL: bitcast_nxv2i64_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i64_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -462,6 +1089,17 @@ ; CHECK-LABEL: bitcast_nxv8f16_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8f16_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -470,6 +1108,18 @@ ; CHECK-LABEL: bitcast_nxv4f32_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f32_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -478,6 +1128,18 @@ ; CHECK-LABEL: bitcast_nxv2f64_to_nxv8bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f64_to_nxv8bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -498,6 +1160,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1b { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -514,6 +1188,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1b { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -523,6 +1209,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.h, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.h, z0.b +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -539,6 +1238,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1b { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -555,6 +1266,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1b { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -564,6 +1287,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.h, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.h, z0.b +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -580,6 +1316,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv8i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1b { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -600,6 +1348,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -616,6 +1376,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -625,6 +1397,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -633,6 +1418,18 @@ ; CHECK-LABEL: bitcast_nxv4f16_to_nxv4i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -649,6 +1446,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -658,6 +1467,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -666,6 +1488,18 @@ ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv4i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv4i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -686,6 +1520,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -702,6 +1548,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -711,6 +1569,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -727,6 +1598,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -735,6 +1618,18 @@ ; CHECK-LABEL: bitcast_nxv2f32_to_nxv2i32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -744,6 +1639,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -760,6 +1668,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv2i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -773,6 +1693,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -782,6 +1715,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -791,6 +1737,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -800,6 +1759,24 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -809,6 +1786,23 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ptrue p1.d +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -817,6 +1811,17 @@ ; CHECK-LABEL: bitcast_nxv1f64_to_nxv1i64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -826,6 +1831,24 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv1i64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -846,6 +1869,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -854,6 +1889,18 @@ ; CHECK-LABEL: bitcast_nxv4i16_to_nxv4f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -870,6 +1917,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -879,6 +1938,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -895,6 +1967,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -904,6 +1988,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -912,6 +2009,17 @@ ; CHECK-LABEL: bitcast_nxv4bf16_to_nxv4f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv4f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -932,6 +2040,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -948,6 +2068,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -956,6 +2088,18 @@ ; CHECK-LABEL: bitcast_nxv2i32_to_nxv2f32: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -965,6 +2109,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -981,6 +2138,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -990,6 +2159,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1006,6 +2188,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv2f32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1019,6 +2213,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1028,6 +2235,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1037,6 +2257,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1045,6 +2278,17 @@ ; CHECK-LABEL: bitcast_nxv1i64_to_nxv1f64: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1054,6 +2298,24 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1063,6 +2325,23 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ptrue p1.d +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ld1d { z0.d }, p1/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1072,6 +2351,24 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4bf16_to_nxv1f64: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-3 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp] +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #2, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp, #2, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #3 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1092,6 +2389,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv8i8_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1b { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1100,6 +2409,18 @@ ; CHECK-LABEL: bitcast_nxv4i16_to_nxv4bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i16_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1116,6 +2437,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i32_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1125,6 +2458,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i64_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1133,6 +2479,17 @@ ; CHECK-LABEL: bitcast_nxv4f16_to_nxv4bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4f16_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1149,6 +2506,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f32_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1w { z0.d }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1h { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1158,6 +2527,19 @@ ; CHECK: // %bb.0: ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1f64_to_nxv4bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1178,6 +2560,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv4i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1b { z0.s }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1188,6 +2582,20 @@ ; CHECK-NEXT: uunpklo z0.h, z0.b ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i32_to_nxv4i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.h, z0.b +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1204,6 +2612,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv4i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1b { z0.s }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1222,6 +2642,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv4i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1b { z0.s }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1242,6 +2674,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1252,6 +2696,20 @@ ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i32_to_nxv2i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1w { z0.s }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1260,6 +2718,18 @@ ; CHECK-LABEL: bitcast_nxv2f16_to_nxv2i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv2i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1270,6 +2740,18 @@ ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv2i16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv2i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1284,6 +2766,20 @@ ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv1i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1294,6 +2790,20 @@ ; CHECK-NEXT: uzp1 z0.s, z0.s, z0.s ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv1i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1310,6 +2820,21 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv1i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-2 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #2 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1328,6 +2853,21 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv1i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-2 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: ld1w { z0.s }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #2 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1348,6 +2888,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1356,6 +2908,18 @@ ; CHECK-LABEL: bitcast_nxv2i16_to_nxv2f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv2f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1367,6 +2931,17 @@ ; CHECK-LABEL: bitcast_nxv2bf16_to_nxv2f16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2bf16_to_nxv2f16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1397,6 +2972,18 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv4i8_to_nxv2bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: st1b { z0.s }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1405,6 +2992,18 @@ ; CHECK-LABEL: bitcast_nxv2i16_to_nxv2bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i16_to_nxv2bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1415,6 +3014,17 @@ ; CHECK-LABEL: bitcast_nxv2f16_to_nxv2bf16: ; CHECK: // %bb.0: ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2f16_to_nxv2bf16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: st1h { z0.d }, p0, [sp, #3, mul vl] +; CHECK_BE-NEXT: ld1h { z0.d }, p0/z, [sp, #3, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1432,6 +3042,21 @@ ; CHECK-NEXT: uunpklo z0.s, z0.h ; CHECK-NEXT: uunpklo z0.d, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv1i16_to_nxv2i8: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: st1h { z0.h }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: ld1b { z0.b }, p0/z, [sp] +; CHECK_BE-NEXT: uunpklo z0.h, z0.b +; CHECK_BE-NEXT: uunpklo z0.s, z0.h +; CHECK_BE-NEXT: uunpklo z0.d, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1450,6 +3075,21 @@ ; CHECK-NEXT: uzp1 z0.h, z0.h, z0.h ; CHECK-NEXT: uzp1 z0.b, z0.b, z0.b ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_nxv2i8_to_nxv1i16: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: uzp1 z0.s, z0.s, z0.s +; CHECK_BE-NEXT: ptrue p0.b +; CHECK_BE-NEXT: uzp1 z0.h, z0.h, z0.h +; CHECK_BE-NEXT: uzp1 z0.b, z0.b, z0.b +; CHECK_BE-NEXT: st1b { z0.b }, p0, [sp] +; CHECK_BE-NEXT: ptrue p0.h +; CHECK_BE-NEXT: ld1h { z0.h }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %bc = bitcast %v to ret %bc } @@ -1483,6 +3123,19 @@ ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: fcvt z0.s, p0/m, z0.d ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_short_float_to_i32: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: fcvt z0.s, p0/m, z0.d +; CHECK_BE-NEXT: st1w { z0.s }, p1, [sp] +; CHECK_BE-NEXT: ld1d { z0.d }, p0/z, [sp] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %trunc = fptrunc %v to %bitcast = bitcast %trunc to ret %bitcast @@ -1494,6 +3147,19 @@ ; CHECK-NEXT: ptrue p0.d ; CHECK-NEXT: fcvt z0.d, p0/m, z0.s ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_short_i32_to_float: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ptrue p1.s +; CHECK_BE-NEXT: st1d { z0.d }, p0, [sp] +; CHECK_BE-NEXT: ld1w { z0.s }, p1/z, [sp] +; CHECK_BE-NEXT: fcvt z0.d, p0/m, z0.s +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %trunc = trunc %v to %bitcast = bitcast %trunc to %extended = fpext %bitcast to @@ -1513,6 +3179,19 @@ ; CHECK-NEXT: addvl sp, sp, #1 ; CHECK-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload ; CHECK-NEXT: ret +; +; CHECK_BE-LABEL: bitcast_short_half_to_float: +; CHECK_BE: // %bb.0: +; CHECK_BE-NEXT: str x29, [sp, #-16]! // 8-byte Folded Spill +; CHECK_BE-NEXT: addvl sp, sp, #-1 +; CHECK_BE-NEXT: ptrue p0.s +; CHECK_BE-NEXT: fadd z0.h, p0/m, z0.h, z0.h +; CHECK_BE-NEXT: st1h { z0.s }, p0, [sp, #1, mul vl] +; CHECK_BE-NEXT: ptrue p0.d +; CHECK_BE-NEXT: ld1w { z0.d }, p0/z, [sp, #1, mul vl] +; CHECK_BE-NEXT: addvl sp, sp, #1 +; CHECK_BE-NEXT: ldr x29, [sp], #16 // 8-byte Folded Reload +; CHECK_BE-NEXT: ret %add = fadd %v, %v %bitcast = bitcast %add to ret %bitcast