You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def SplatB: SDNodeXForm<imm, [{
uint32_t V = N->getZExtValue();
assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
uint32_t S = V << 24 | V << 16 | V << 8 | V;
V &= 0xFF;
return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;
clang static analyzer reports this as a dead store - but isn't the problem that we need to mask V's bottom 8 bits before S 'splats' it across the 32-bits:
def SplatB: SDNodeXForm<imm, [{
uint32_t V = N->getZExtValue();
assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
V &= 0xFF;
uint32_t S = V << 24 | V << 16 | V << 8 | V;
return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;
The text was updated successfully, but these errors were encountered:
Extended Description
def SplatB: SDNodeXForm<imm, [{
uint32_t V = N->getZExtValue();
assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
uint32_t S = V << 24 | V << 16 | V << 8 | V;
V &= 0xFF;
return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;
clang static analyzer reports this as a dead store - but isn't the problem that we need to mask V's bottom 8 bits before S 'splats' it across the 32-bits:
def SplatB: SDNodeXForm<imm, [{
uint32_t V = N->getZExtValue();
assert(isUInt<8>(V) || V >> 8 == 0xFFFFFF);
V &= 0xFF;
uint32_t S = V << 24 | V << 16 | V << 8 | V;
return CurDAG->getTargetConstant(S, SDLoc(N), MVT::i32);
}]>;
The text was updated successfully, but these errors were encountered: