AVX fixes: add missing 8/16-bit gathers and scatters, set features string appropriately when AVX is enabled.

This commit is contained in:
Matt Pharr
2011-07-22 12:36:44 +01:00
parent 165f90357f
commit da0fd93315
2 changed files with 12 additions and 6 deletions

View File

@@ -949,10 +949,12 @@ Module::writeObjectFileOrAssembly(OutputType outputType, const char *outFileName
} }
std::string featuresString; std::string featuresString;
llvm::TargetMachine *targetMachine = NULL;
#if defined LLVM_3_0svn || defined LLVM_3_0 #if defined LLVM_3_0svn || defined LLVM_3_0
llvm::TargetMachine *targetMachine = if (g->target.isa == Target::AVX)
target->createTargetMachine(triple.getTriple(), g->target.cpu, featuresString = "+avx";
featuresString); targetMachine = target->createTargetMachine(triple.getTriple(), g->target.cpu,
featuresString);
#else #else
if (g->target.cpu.size()) { if (g->target.cpu.size()) {
llvm::SubtargetFeatures features; llvm::SubtargetFeatures features;
@@ -960,8 +962,8 @@ Module::writeObjectFileOrAssembly(OutputType outputType, const char *outFileName
featuresString = features.getString(); featuresString = features.getString();
} }
llvm::TargetMachine *targetMachine = targetMachine = target->createTargetMachine(triple.getTriple(),
target->createTargetMachine(triple.getTriple(), featuresString); featuresString);
#endif #endif
if (targetMachine == NULL) { if (targetMachine == NULL) {
fprintf(stderr, "Unable to create target machine for target \"%s\"!", fprintf(stderr, "Unable to create target machine for target \"%s\"!",

View File

@@ -698,12 +698,16 @@ define void @__masked_store_blend_64(<8 x i64>* nocapture %ptr, <8 x i64> %new,
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; gather/scatter ;; gather/scatter
gen_gather(8, i8)
gen_gather(8, i16)
gen_gather(8, i32) gen_gather(8, i32)
gen_gather(8, i64) gen_gather(8, i64)
gen_scatter(8, i8)
gen_scatter(8, i16)
gen_scatter(8, i32) gen_scatter(8, i32)
gen_scatter(8, i64) gen_scatter(8, i64)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; double precision sqrt ;; double precision sqrt