if readDest:
readDestCode = 'destElem = letoh(destReg.elements[i]);'
eWalkCode += '''
- if (imm < 0 && imm >= eCount) {
+ if (imm >= eCount) {
fault = std::make_shared<UndefinedInstruction>(machInst, false,
mnemonic);
} else {
if readDest:
readDestCode = 'destElem = letoh(destReg.elements[i]);'
eWalkCode += '''
- if (imm < 0 && imm >= eCount) {
+ if (imm >= eCount) {
fault = std::make_shared<UndefinedInstruction>(machInst, false,
mnemonic);
} else {
if readDest:
readDestCode = 'destReg = destRegs[i];'
eWalkCode += '''
- if (imm < 0 && imm >= eCount) {
+ if (imm >= eCount) {
fault = std::make_shared<UndefinedInstruction>(machInst, false,
mnemonic);
} else {
destElem = srcElem1 - (count * imm);
bool negDest = (destElem < 0);
bool negSrc = (srcElem1 < 0);
- bool posCount = ((count * imm) >= 0);
- if ((negDest != negSrc) && (negSrc == posCount)) {
+ if (!negDest && negSrc) {
destElem = static_cast<%(dstType)s>(
(%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1)
);
- if (negDest)
- destElem -= 1;
}
'''
sveElemCountInst('sqdec', 'Sqdec32', 'SimdAluOp', signedTypes,
destElem = srcElem1 + (count * imm);
bool negDest = (destElem < 0);
bool negSrc = (srcElem1 < 0);
- bool negCount = ((count * imm) < 0);
- if ((negDest != negSrc) && (negSrc == negCount)) {
+ if (negDest && !negSrc) {
destElem = static_cast<%(dstType)s>(
(%(dstType)s)1 << (sizeof(%(dstType)s) * 8 - 1)
);
- if (negDest)
- destElem -= 1;
+ destElem -= 1;
}
'''
sveElemCountInst('sqinc', 'Sqinc32', 'SimdAluOp', signedTypes,