Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
#ifndef BITONIC_SORT_AVX2_INT32_T_H
#define BITONIC_SORT_AVX2_INT32_T_H

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx2")
#endif
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -1557,12 +1555,10 @@ template<> struct bitonic<int32_t, AVX2> {
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
#ifndef BITONIC_SORT_AVX2_INT64_T_H
#define BITONIC_SORT_AVX2_INT64_T_H

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx2")
#endif
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -1517,12 +1515,10 @@ template<> struct bitonic<int64_t, AVX2> {
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
#define BITONIC_SORT_AVX512_INT32_T_H


#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
Comment thread
MichalStrehovsky marked this conversation as resolved.
Resolved
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -1442,12 +1440,9 @@ template<> struct bitonic<int32_t, AVX512> {
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
#define BITONIC_SORT_AVX512_INT64_T_H


#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
Comment thread
MichalStrehovsky marked this conversation as resolved.
Resolved
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -1402,12 +1400,9 @@ template<> struct bitonic<int64_t, AVX512> {
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif

12 changes: 4 additions & 8 deletions src/coreclr/gc/vxsort/smallsort/codegen/avx2.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,12 @@ def generate_prologue(self, f):
#ifndef BITONIC_SORT_AVX2_{t.upper()}_H
#define BITONIC_SORT_AVX2_{t.upper()}_H

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx2")
#endif
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -321,13 +319,11 @@ def generate_epilogue(self, f):
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif
"""
print(s, file=f)
Expand Down
12 changes: 4 additions & 8 deletions src/coreclr/gc/vxsort/smallsort/codegen/avx512.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,12 @@ def generate_prologue(self, f):
#define BITONIC_SORT_AVX512_{t.upper()}_H


#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
Comment thread
MichalStrehovsky marked this conversation as resolved.
Resolved
#endif

#include <immintrin.h>
#include "bitonic_sort.h"
Expand Down Expand Up @@ -317,14 +315,12 @@ def generate_epilogue(self, f):
#undef s2d
#undef d2s

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
#endif
"""
print(s, file=f)

Expand Down
6 changes: 2 additions & 4 deletions src/coreclr/gc/vxsort/vxsort.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
#define VXSORT_VXSORT_H

#if defined(TARGET_AMD64)
#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("popcnt"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("popcnt")
#endif
#endif
#endif // TARGET_AMD64

#include <assert.h>
Expand Down
6 changes: 2 additions & 4 deletions src/coreclr/gc/vxsort/vxsort_targets_disable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.


#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute pop
#else
#elif defined(__GNUC__)
#pragma GCC pop_options
#endif
#endif
6 changes: 2 additions & 4 deletions src/coreclr/gc/vxsort/vxsort_targets_enable_avx2.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
#endif
6 changes: 2 additions & 4 deletions src/coreclr/gc/vxsort/vxsort_targets_enable_avx512.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#ifdef __GNUC__
#ifdef __clang__
#if defined(__clang__)
#pragma clang attribute push (__attribute__((target("avx512f,avx512dq"))), apply_to = any(function))
#else
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target("avx512f,avx512dq")
#endif
#endif