Current implementation is an alias to -mtune-crtl=(Alias(mtune-ctrl=,
use_gather, ^use_gather)), and maybe override by another -mtune-crtl=
.i.e -mgather -mscatter will only enable mscatter
The patch fixes the issue.
gcc/ChangeLog:
* config/i386/i386-options.cc (set_ix86_tune_features): Set
gather/scatter tune if OPTION_SET_P.
* config/i386/i386.opt: Refactor mgather/mscatter.
}
parse_mtune_ctrl_str (opts, dump);
+
+ /* mgather/mscatter option would overwrite -mtune-crtl option. */
+ if (OPTION_SET_P (ix86_use_gather))
+ {
+ ix86_tune_features[X86_TUNE_USE_GATHER_2PARTS] = ix86_use_gather;
+ ix86_tune_features[X86_TUNE_USE_GATHER_4PARTS] = ix86_use_gather;
+ ix86_tune_features[X86_TUNE_USE_GATHER_8PARTS] = ix86_use_gather;
+ }
+
+ if (OPTION_SET_P (ix86_use_scatter))
+ {
+ ix86_tune_features[X86_TUNE_USE_SCATTER_2PARTS] = ix86_use_scatter;
+ ix86_tune_features[X86_TUNE_USE_SCATTER_4PARTS] = ix86_use_scatter;
+ ix86_tune_features[X86_TUNE_USE_SCATTER_8PARTS] = ix86_use_scatter;
+ }
}
SM4 built-in functions and code generation.
mgather
-Target Alias(mtune-ctrl=, use_gather, ^use_gather)
+Target Var(ix86_use_gather) Init(0) Optimization.
Enable vectorization for gather instruction.
mscatter
-Target Alias(mtune-ctrl=, use_scatter, ^use_scatter)
+Target Var(ix86_use_scatter) Init(0) Optimization
Enable vectorization for scatter instruction.
mapxf