Disallow some vector ops and fix integral vector identity comparisons

Bail out on unsupported vector ops (not checking the rhs type for binops
though) in the frontend instead of causing LLVM errors.

Also precompute the target's critical section size once at startup, like
DMD.
This commit is contained in:
Martin Kinkelin 2019-05-24 23:08:58 +02:00
parent 8dd4f5f893
commit a44c78fb88
6 changed files with 189 additions and 117 deletions

View file

@ -384,7 +384,7 @@ LLValue *DtoBinFloatsEquals(Loc &loc, DValue *lhs, DValue *rhs, TOK op) {
LLValue *mergeVectorEquals(LLValue *resultsVector, TOK op) {
// `resultsVector` is a vector of i1 values, the pair-wise results.
// Bitcast to an integer and checks the bits via additional integer
// Bitcast to an integer and check the bits via additional integer
// comparison.
const auto sizeInBits = getTypeBitSize(resultsVector->getType());
LLType *integerType = LLType::getIntNTy(gIR->context(), sizeInBits);