source: libcfa/src/limits.hfa @ af67ee1

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationpthread-emulationqualifiedEnum
Last change on this file since af67ee1 was 6fbe9a5, checked in by Michael Brooks <mlbrooks@…>, 3 years ago

Fixing code-gen of constants. Fixes #182? Removes workaround 58b6d1.

Forcing recent GCC versions to place CFA-initialized constants in writeable memory, so CFA initialization doesn't segfault when writing them. See the const-init test for specifics about recent GCC versions.

src/InitTweak/FixGlobalInit.cc: generating the attribute to control GCC's placement
libcfa/src/limits.* : removing workaround from 58b6d1, making these limits const again
tests//limits.* : commenting old test that uses the constants from licfa-limits, explaining what the test doesn't exercise
tests/
/const-init.* : new test of static constants, taken from #182, and comments explaining how to test this issue

  • Property mode set to 100644
File size: 5.3 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// limits --
8//
9// Author           : Peter A. Buhr
10// Created On       : Wed Apr  6 18:06:52 2016
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Thu Mar  1 16:20:54 2018
13// Update Count     : 13
14//
15
16#pragma once
17
18// Integral Constants
19
20extern const signed char MIN;
21extern const unsigned char MIN;
22extern const short int MIN;
23extern const unsigned short int MIN;
24extern const int MIN;
25extern const unsigned int MIN;
26extern const long int MIN;
27extern const unsigned long int MIN;
28extern const long long int MIN;
29extern const unsigned long long int MIN;
30
31extern const signed char MAX;
32extern const unsigned char MAX;
33extern const short int MAX;
34extern const unsigned short int MAX;
35extern const int MAX;
36extern const unsigned int MAX;
37extern const long int MAX;
38extern const unsigned long int MAX;
39extern const long long int MAX;
40extern const unsigned long long int MAX;
41
42// Floating-Point Constants
43
44extern const float MIN;
45extern const double MIN;
46extern const long double MIN;
47extern const float _Complex MIN;
48extern const double _Complex MIN;
49extern const long double _Complex MIN;
50
51extern const float MAX;
52extern const double MAX;
53extern const long double MAX;
54extern const float _Complex MAX;
55extern const double _Complex MAX;
56extern const long double _Complex MAX;
57
58extern const float PI;                                                                  // pi
59extern const float PI_2;                                                                // pi / 2
60extern const float PI_4;                                                                // pi / 4
61extern const float _1_PI;                                                               // 1 / pi
62extern const float _2_PI;                                                               // 2 / pi
63extern const float _2_SQRT_PI;                                                  // 2 / sqrt(pi)
64
65extern const double PI;                                                                 // pi
66extern const double PI_2;                                                               // pi / 2
67extern const double PI_4;                                                               // pi / 4
68extern const double _1_PI;                                                              // 1 / pi
69extern const double _2_PI;                                                              // 2 / pi
70extern const double _2_SQRT_PI;                                                 // 2 / sqrt(pi)
71
72extern const long double PI;                                                    // pi
73extern const long double PI_2;                                                  // pi / 2
74extern const long double PI_4;                                                  // pi / 4
75extern const long double _1_PI;                                                 // 1 / pi
76extern const long double _2_PI;                                                 // 2 / pi
77extern const long double _2_SQRT_PI;                                    // 2 / sqrt(pi)
78
79extern const float _Complex PI;                                                 // pi
80extern const float _Complex PI_2;                                               // pi / 2
81extern const float _Complex PI_4;                                               // pi / 4
82extern const float _Complex _1_PI;                                              // 1 / pi
83extern const float _Complex _2_PI;                                              // 2 / pi
84extern const float _Complex _2_SQRT_PI;                                 // 2 / sqrt(pi)
85
86extern const double _Complex PI;                                                // pi
87extern const double _Complex PI_2;                                              // pi / 2
88extern const double _Complex PI_4;                                              // pi / 4
89extern const double _Complex _1_PI;                                             // 1 / pi
90extern const double _Complex _2_PI;                                             // 2 / pi
91extern const double _Complex _2_SQRT_PI;                                // 2 / sqrt(pi)
92
93extern const long double _Complex PI;                                   // pi
94extern const long double _Complex PI_2;                                 // pi / 2
95extern const long double _Complex PI_4;                                 // pi / 4
96extern const long double _Complex _1_PI;                                // 1 / pi
97extern const long double _Complex _2_PI;                                // 2 / pi
98extern const long double _Complex _2_SQRT_PI;                   // 2 / sqrt(pi)
99
100extern const float E;                                                                   // e
101extern const float LOG2_E;                                                              // log_2(e)
102extern const float LOG10_E;                                                             // log_10(e)
103extern const float LN_2;                                                                // log_e(2)
104extern const float LN_10;                                                               // log_e(10)
105extern const float SQRT_2;                                                              // sqrt(2)
106extern const float _1_SQRT_2;                                                   // 1 / sqrt(2)
107
108extern const double E;                                                                  // e
109extern const double LOG2_E;                                                             // log_2(e)
110extern const double LOG10_E;                                                    // log_10(e)
111extern const double LN_2;                                                               // log_e(2)
112extern const double LN_10;                                                              // log_e(10)
113extern const double SQRT_2;                                                             // sqrt(2)
114extern const double _1_SQRT_2;                                                  // 1 / sqrt(2)
115
116extern const long double E;                                                             // e
117extern const long double LOG2_E;                                                // log_2(e)
118extern const long double LOG10_E;                                               // log_10(e)
119extern const long double LN_2;                                                  // log_e(2)
120extern const long double LN_10;                                                 // log_e(10)
121extern const long double SQRT_2;                                                // sqrt(2)
122extern const long double _1_SQRT_2;                                             // 1/sqrt(2)
123
124extern const float _Complex E;                                                  // e
125extern const float _Complex LOG2_E;                                             // log_2(e)
126extern const float _Complex LOG10_E;                                    // log_10(e)
127extern const float _Complex LN_2;                                               // log_e(2)
128extern const float _Complex LN_10;                                              // log_e(10)
129extern const float _Complex SQRT_2;                                             // sqrt(2)
130extern const float _Complex _1_SQRT_2;                                  // 1 / sqrt(2)
131
132extern const double _Complex E;                                                 // e
133extern const double _Complex LOG2_E;                                    // log_2(e)
134extern const double _Complex LOG10_E;                                   // log_10(e)
135extern const double _Complex LN_2;                                              // log_e(2)
136extern const double _Complex LN_10;                                             // log_e(10)
137extern const double _Complex SQRT_2;                                    // sqrt(2)
138extern const double _Complex _1_SQRT_2;                                 // 1 / sqrt(2)
139
140extern const long double _Complex E;                                    // e
141extern const long double _Complex LOG2_E;                               // log_2(e)
142extern const long double _Complex LOG10_E;                              // log_10(e)
143extern const long double _Complex LN_2;                                 // log_e(2)
144extern const long double _Complex LN_10;                                // log_e(10)
145extern const long double _Complex SQRT_2;                               // sqrt(2)
146extern const long double _Complex _1_SQRT_2;                    // 1 / sqrt(2)
147
148// Local Variables: //
149// mode: c //
150// tab-width: 4 //
151// End: //
Note: See TracBrowser for help on using the repository browser.