Skip to content

Commit 443da3d

Browse files
committed
Push/pop GCC options in AEGIS code
Attempt to fix issue #186.
1 parent 758edef commit 443da3d

27 files changed

+77
-2
lines changed

src/aegis/aegis128l/aegis128l_aesni.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#ifdef __clang__
2121
# pragma clang attribute push(__attribute__((target("aes,avx"))), apply_to = function)
2222
#elif defined(__GNUC__)
23+
# pragma GCC push_options
2324
# pragma GCC target("aes,avx")
2425
#endif
2526

@@ -105,6 +106,8 @@ struct aegis128l_implementation aegis128l_aesni_implementation = {
105106

106107
#ifdef __clang__
107108
# pragma clang attribute pop
109+
#elif defined(__GNUC__)
110+
# pragma GCC pop_options
108111
#endif
109112

110113
#endif

src/aegis/aegis128l/aegis128l_altivec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifdef __clang__
2323
# pragma clang attribute push(__attribute__((target("altivec,crypto"))), apply_to = function)
2424
#elif defined(__GNUC__)
25+
# pragma GCC push_options
2526
# pragma GCC target("altivec,crypto")
2627
#endif
2728

@@ -101,6 +102,8 @@ struct aegis128l_implementation aegis128l_altivec_implementation = {
101102

102103
#ifdef __clang__
103104
# pragma clang attribute pop
105+
#elif defined(__GNUC__)
106+
# pragma GCC pop_options
104107
#endif
105108

106109
#endif

src/aegis/aegis128l/aegis128l_armcrypto.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), \
3737
apply_to = function)
3838
#elif defined(__GNUC__)
39+
# pragma GCC push_options
3940
# pragma GCC target("+simd+crypto")
4041
#endif
4142

@@ -115,6 +116,8 @@ struct aegis128l_implementation aegis128l_armcrypto_implementation = {
115116

116117
#ifdef __clang__
117118
# pragma clang attribute pop
119+
#elif defined(__GNUC__)
120+
# pragma GCC pop_options
118121
#endif
119122

120123
#endif

src/aegis/aegis128x2/aegis128x2_aesni.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#ifdef __clang__
2121
# pragma clang attribute push(__attribute__((target("aes,avx"))), apply_to = function)
2222
#elif defined(__GNUC__)
23+
# pragma GCC push_options
2324
# pragma GCC target("aes,avx")
2425
#endif
2526

@@ -111,6 +112,8 @@ struct aegis128x2_implementation aegis128x2_aesni_implementation = {
111112

112113
#ifdef __clang__
113114
# pragma clang attribute pop
115+
#elif defined(__GNUC__)
116+
# pragma GCC pop_options
114117
#endif
115118

116119
#endif

src/aegis/aegis128x2/aegis128x2_altivec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifdef __clang__
2323
# pragma clang attribute push(__attribute__((target("altivec,crypto"))), apply_to = function)
2424
#elif defined(__GNUC__)
25+
# pragma GCC push_options
2526
# pragma GCC target("altivec,crypto")
2627
#endif
2728

@@ -106,6 +107,8 @@ struct aegis128x2_implementation aegis128x2_altivec_implementation = {
106107

107108
#ifdef __clang__
108109
# pragma clang attribute pop
110+
#elif defined(__GNUC__)
111+
# pragma GCC pop_options
109112
#endif
110113

111114
#endif

src/aegis/aegis128x2/aegis128x2_armcrypto.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), \
3737
apply_to = function)
3838
#elif defined(__GNUC__)
39+
# pragma GCC push_options
3940
# pragma GCC target("+simd+crypto")
4041
#endif
4142

@@ -120,6 +121,8 @@ struct aegis128x2_implementation aegis128x2_armcrypto_implementation = {
120121

121122
#ifdef __clang__
122123
# pragma clang attribute pop
124+
#elif defined(__GNUC__)
125+
# pragma GCC pop_options
123126
#endif
124127

125128
#endif

src/aegis/aegis128x2/aegis128x2_avx2.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifdef __clang__
2323
# pragma clang attribute push(__attribute__((target("vaes,avx2"))), apply_to = function)
2424
#elif defined(__GNUC__)
25+
# pragma GCC push_options
2526
# pragma GCC target("vaes,avx2")
2627
#endif
2728

@@ -106,6 +107,8 @@ struct aegis128x2_implementation aegis128x2_avx2_implementation = {
106107

107108
#ifdef __clang__
108109
# pragma clang attribute pop
110+
#elif defined(__GNUC__)
111+
# pragma GCC pop_options
109112
#endif
110113

111114
#endif /* HAVE_VAESINTRIN_H */

src/aegis/aegis128x4/aegis128x4_aesni.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#ifdef __clang__
2121
# pragma clang attribute push(__attribute__((target("aes,avx"))), apply_to = function)
2222
#elif defined(__GNUC__)
23+
# pragma GCC push_options
2324
# pragma GCC target("aes,avx")
2425
#endif
2526

@@ -120,6 +121,8 @@ struct aegis128x4_implementation aegis128x4_aesni_implementation = {
120121

121122
#ifdef __clang__
122123
# pragma clang attribute pop
124+
#elif defined(__GNUC__)
125+
# pragma GCC pop_options
123126
#endif
124127

125128
#endif

src/aegis/aegis128x4/aegis128x4_altivec.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifdef __clang__
2323
# pragma clang attribute push(__attribute__((target("altivec,crypto"))), apply_to = function)
2424
#elif defined(__GNUC__)
25+
# pragma GCC push_options
2526
# pragma GCC target("altivec,crypto")
2627
#endif
2728

@@ -114,6 +115,8 @@ struct aegis128x4_implementation aegis128x4_altivec_implementation = {
114115

115116
#ifdef __clang__
116117
# pragma clang attribute pop
118+
#elif defined(__GNUC__)
119+
# pragma GCC pop_options
117120
#endif
118121

119122
#endif

src/aegis/aegis128x4/aegis128x4_armcrypto.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# pragma clang attribute push(__attribute__((target("neon,crypto,aes"))), \
3737
apply_to = function)
3838
#elif defined(__GNUC__)
39+
# pragma GCC push_options
3940
# pragma GCC target("+simd+crypto")
4041
#endif
4142

@@ -128,6 +129,8 @@ struct aegis128x4_implementation aegis128x4_armcrypto_implementation = {
128129

129130
#ifdef __clang__
130131
# pragma clang attribute pop
132+
#elif defined(__GNUC__)
133+
# pragma GCC pop_options
131134
#endif
132135

133136
#endif

0 commit comments

Comments
 (0)