Skip to content

Commit

Permalink
CodeEmitter: Minor fixes to SVE fcvtz{u,s}
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sonicadvance1 committed Feb 13, 2025
1 parent 6651f9e commit cd5f42e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CodeEmitter/CodeEmitter/SVEOps.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit cd5f42e

Please sign in to comment.