mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-25 21:28:13 +00:00
src: Allow clang-style +/- for target features
This largely works as expected, except that as far as I can tell, without explicit annotations added to the caller, (or a `#force_inline`), the LLVM `target-features` function attribute gets ignored by the inliner under the rationale of `-sse,-avx,-avx2` is a subset of `+sse,+avx,+avx2`. With `#force_no_inline` the correct code does get generated, but in the regression I am trying to fix, the caller gratuitously also uses SIMD, leading to horrific performance.
This commit is contained in:
@@ -201,12 +201,15 @@ gb_internal lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool i
|
||||
for (;;) {
|
||||
String str = string_split_iterator(&it, ',');
|
||||
if (str == "") break;
|
||||
bool add_prefix = !(string_starts_with(str, '+') || string_starts_with(str, '-'));
|
||||
if (!first) {
|
||||
feature_str = gb_string_appendc(feature_str, ",");
|
||||
}
|
||||
first = false;
|
||||
|
||||
feature_str = gb_string_appendc(feature_str, "+");
|
||||
if (add_prefix) {
|
||||
feature_str = gb_string_appendc(feature_str, "+");
|
||||
}
|
||||
feature_str = gb_string_append_length(feature_str, str.text, str.len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user