diff --git a/dmd/idgen.c b/dmd/idgen.c index 49166c26..54967c05 100644 --- a/dmd/idgen.c +++ b/dmd/idgen.c @@ -229,9 +229,6 @@ Msgtable msgtable[] = { "no_typeinfo" }, { "no_moduleinfo" }, { "Alloca", "alloca" }, - { "Shufflevector", "shufflevector" }, - { "Extractelement", "extractelement" }, - { "Insertelement", "insertelement" }, { "vastart", "va_start" }, { "vacopy", "va_copy" }, { "vaend", "va_end" }, diff --git a/dmd2/idgen.c b/dmd2/idgen.c index dbb2ef93..e8936702 100644 --- a/dmd2/idgen.c +++ b/dmd2/idgen.c @@ -273,9 +273,6 @@ Msgtable msgtable[] = { "no_typeinfo" }, { "no_moduleinfo" }, { "Alloca", "alloca" }, - { "Shufflevector", "shufflevector" }, - { "Extractelement", "extractelement" }, - { "Insertelement", "insertelement" }, { "vastart", "va_start" }, { "vacopy", "va_copy" }, { "vaend", "va_end" }, diff --git a/gen/pragma.cpp b/gen/pragma.cpp index 3969f38a..79367a6a 100644 --- a/gen/pragma.cpp +++ b/gen/pragma.cpp @@ -105,28 +105,6 @@ Pragma DtoGetPragma(Scope *sc, PragmaDeclaration *decl, std::string &arg1str) return LLVMalloca; } - // pragma(shufflevector) { funcdecl(s) } - else if (ident == Id::Shufflevector) - { - if (args && args->dim > 0) - { - error("takes no parameters"); - fatal(); - } - return LLVMshufflevector; - } - - // pragma(extractelement or insertelement) { funcdecl(s) } - else if (ident == Id::Extractelement || ident == Id::Insertelement) - { - if (args && args->dim > 0) - { - error("takes no parameters"); - fatal(); - } - return ident == Id::Extractelement ? LLVMextractelement : LLVMinsertelement; - } - // pragma(va_start) { templdecl(s) } else if (ident == Id::vastart) { @@ -385,31 +363,6 @@ void DtoCheckPragma(PragmaDeclaration *decl, Dsymbol *s, } break; - case LLVMshufflevector: - if (FuncDeclaration* fd = s->isFuncDeclaration()) - { - fd->llvmInternal = llvm_internal; - } - else - { - error("the '%s' pragma must only be used on function declarations.", ident->toChars()); - fatal(); - } - break; - - case LLVMextractelement: - case LLVMinsertelement: - if (FuncDeclaration* fd = s->isFuncDeclaration()) - { - fd->llvmInternal = llvm_internal; - } - else - { - error("the '%s' pragma must only be used on function declarations.", ident->toChars()); - fatal(); - } - break; - case LLVMinline_asm: if (TemplateDeclaration* td = s->isTemplateDeclaration()) { diff --git a/gen/pragma.h b/gen/pragma.h index fb28b9d9..dc057153 100644 --- a/gen/pragma.h +++ b/gen/pragma.h @@ -14,9 +14,6 @@ enum Pragma LLVMno_typeinfo, LLVMno_moduleinfo, LLVMalloca, - LLVMshufflevector, - LLVMextractelement, - LLVMinsertelement, LLVMva_start, LLVMva_copy, LLVMva_end, diff --git a/gen/toir.cpp b/gen/toir.cpp index ec95d896..db0234be 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -988,51 +988,6 @@ DValue* CallExp::toElem(IRState* p) if (expv->getType()->toBasetype()->ty != Tint32) expv = DtoCast(loc, expv, Type::tint32); return new DImValue(type, p->ir->CreateAlloca(LLType::getInt8Ty(gIR->context()), expv->getRVal(), ".alloca")); - } - // shufflevector - else if (fndecl->llvmInternal == LLVMshufflevector) { - llvm::SmallVector mask; - for(int i = 2, n = arguments->dim; i < n; i++){ - Expression* exp = static_cast(arguments->data[i]); - if(exp->op != TOKint64 || exp->type->ty != Tint32){ - error("Function %s was declared with pragma shufflevector. Because of that all of its arguments except for the first two must be int literals.", fndecl->toChars()); - fatal(); - } - IntegerExp* iexp = static_cast(arguments->data[i]); - mask.push_back(iexp->toConstElem(p)); - } - LLValue* maskVal = llvm::ConstantVector::get(mask); - Expression* exp1 = static_cast(arguments->data[0]); - Expression* exp2 = static_cast(arguments->data[1]); - LLValue* v1 = exp1->toElem(p)->getRVal(); - LLValue* v2 = exp2->toElem(p)->getRVal(); - return new DImValue(type, p->ir->CreateShuffleVector(v1, v2, maskVal)); - } - // extractelement - else if(fndecl->llvmInternal == LLVMextractelement) { - Expression* exp2 = static_cast(arguments->data[1]); - if(exp2->op != TOKint64 || exp2->type->ty != Tint32){ - error("Function %s was declared with pragma extractelement. Because of that its second argument must be an int literal.", fndecl->toChars()); - fatal(); - } - LLValue* idx = exp2->toElem(p)->getRVal(); - Expression* exp1 = static_cast(arguments->data[0]); - LLValue* vec = exp1->toElem(p)->getRVal(); - return new DImValue(type, p->ir->CreateExtractElement(vec, idx)); - } - // insertelement - else if(fndecl->llvmInternal == LLVMinsertelement) { - Expression* exp3 = static_cast(arguments->data[2]); - if(exp3->op != TOKint64 || exp3->type->ty != Tint32){ - error("Function %s was declared with pragma insertelement. Because of that its third argument must be an int literal.", fndecl->toChars()); - fatal(); - } - LLValue* idx = exp3->toElem(p)->getRVal(); - Expression* exp1 = static_cast(arguments->data[0]); - LLValue* vec = exp1->toElem(p)->getRVal(); - Expression* exp2 = static_cast(arguments->data[1]); - LLValue* scal = exp2->toElem(p)->getRVal(); - return new DImValue(type, p->ir->CreateInsertElement(vec, scal, idx)); } // fence instruction else if (fndecl->llvmInternal == LLVMfence) {