From cd5f42ec793484c1526489648f09cf8ecb9a1350 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 12 Feb 2025 23:09:41 -0800 Subject: [PATCH] CodeEmitter: Minor fixes to SVE fcvtz{u,s} We had duplicated code paths in the ternary selection for 64-bit source size, and on 32-bit source size 16-bit is an invalid target so the second ternary was dead. --- CodeEmitter/CodeEmitter/SVEOps.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeEmitter/CodeEmitter/SVEOps.inl b/CodeEmitter/CodeEmitter/SVEOps.inl index cecfb0d8d6..573ae613b1 100644 --- a/CodeEmitter/CodeEmitter/SVEOps.inl +++ b/CodeEmitter/CodeEmitter/SVEOps.inl @@ -2379,13 +2379,13 @@ public: } else if (srcsize == SubRegSize::i32Bit) { // Srcsize = fp32, opc1 encodes dst size LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__); + opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b10; opc2 = 0b10; - opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b10 : 0b00; } else if (srcsize == SubRegSize::i64Bit) { LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__); // SrcSize = fp64, opc2 encodes dst size opc1 = 0b11; - opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b00 : 0b00; + opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b00; } else { FEX_UNREACHABLE; } @@ -2400,13 +2400,13 @@ public: } else if (srcsize == SubRegSize::i32Bit) { // Srcsize = fp32, opc1 encodes dst size LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__); + opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b10; opc2 = 0b10; - opc1 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b10 : 0b00; } else if (srcsize == SubRegSize::i64Bit) { LOGMAN_THROW_A_FMT(dstsize != SubRegSize::i16Bit, "Unsupported size in {}", __func__); // SrcSize = fp64, opc2 encodes dst size opc1 = 0b11; - opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : dstsize == SubRegSize::i32Bit ? 0b00 : 0b00; + opc2 = dstsize == SubRegSize::i64Bit ? 0b11 : 0b00; } else { FEX_UNREACHABLE; }