Changes in / [0b0a285:c84dd61]
- Files:
-
- 30 added
- 80 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/Makefile
r0b0a285 rc84dd61 50 50 figures/nasus_Channel_Contention \ 51 51 figures/pyke_Channel_Contention \ 52 figures/pyke_Future \ 53 figures/nasus_Future \ 54 figures/pyke_Contend_2 \ 55 figures/pyke_Contend_4 \ 56 figures/pyke_Contend_8 \ 57 figures/pyke_Spin_2 \ 58 figures/pyke_Spin_4 \ 59 figures/pyke_Spin_8 \ 60 figures/nasus_Contend_2 \ 61 figures/nasus_Contend_4 \ 62 figures/nasus_Contend_8 \ 63 figures/nasus_Spin_2 \ 64 figures/nasus_Spin_4 \ 65 figures/nasus_Spin_8 \ 52 66 } 53 67 -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/balance.cfa
r0b0a285 rc84dd61 33 33 allocation receive( d_actor & this, start_msg & msg ) with( this ) { 34 34 for ( i; Set ) { 35 *actor_arr[i + gstart] <<shared_msg;35 *actor_arr[i + gstart] | shared_msg; 36 36 } 37 37 return Nodelete; … … 42 42 if ( recs % Batch == 0 ) { 43 43 for ( i; Batch ) { 44 *actor_arr[gstart + sends % Set] <<shared_msg;44 *actor_arr[gstart + sends % Set] | shared_msg; 45 45 sends += 1; 46 46 } … … 163 163 #ifndef MULTI 164 164 for ( i; qpw ) 165 *actors[i * ActorsPerQueue] <<start_send;165 *actors[i * ActorsPerQueue] | start_send; 166 166 #else 167 167 for ( i; qpw * ActorProcs ) { 168 *actors[i * ActorsPerQueue] <<start_send;168 *actors[i * ActorsPerQueue] | start_send; 169 169 } 170 170 #endif 171 171 172 172 for ( i; FillActors ) 173 *filler_actors[i] <<shared_msg;173 *filler_actors[i] | shared_msg; 174 174 175 175 stop_actor_system(); -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/dynamic.cfa
r0b0a285 rc84dd61 33 33 derived_actor * d_actor = malloc(); 34 34 (*d_actor){}; 35 *d_actor <<*d_msg;35 *d_actor | *d_msg; 36 36 return Delete; 37 37 } … … 62 62 derived_actor * d_actor = malloc(); 63 63 (*d_actor){}; 64 *d_actor <<*d_msg;64 *d_actor | *d_msg; 65 65 66 66 -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/executor.cfa
r0b0a285 rc84dd61 29 29 if ( recs % Batch == 0 ) { 30 30 for ( i; Batch ) { 31 gstart[sends % Set] <<shared_msg;31 gstart[sends % Set] | shared_msg; 32 32 sends += 1; 33 33 } … … 94 94 95 95 for ( i; Actors ) { 96 actors[i] <<shared_msg;96 actors[i] | shared_msg; 97 97 } // for 98 98 -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/matrix.cfa
r0b0a285 rc84dd61 103 103 104 104 for ( unsigned int r = 0; r < xr; r += 1 ) { 105 actors[r] <<messages[r];105 actors[r] | messages[r]; 106 106 } // for 107 107 -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/repeat.cfa
r0b0a285 rc84dd61 46 46 47 47 Client * cl; 48 allocation receive( Server & this, IntMsg & msg ) { msg.val = 7; *cl <<msg; return Nodelete; }49 allocation receive( Server & this, CharMsg & msg ) { msg.val = 'x'; *cl <<msg; return Nodelete; }48 allocation receive( Server & this, IntMsg & msg ) { msg.val = 7; *cl | msg; return Nodelete; } 49 allocation receive( Server & this, CharMsg & msg ) { msg.val = 'x'; *cl | msg; return Nodelete; } 50 50 allocation receive( Server & this, StateMsg & msg ) { return Finished; } 51 51 52 52 void terminateServers( Client & this ) with(this) { 53 53 for ( i; Messages ) { 54 servers[i] <<stateMsg;54 servers[i] | stateMsg; 55 55 } // for 56 56 } … … 60 60 if ( times == Times ) { terminateServers( this ); return Finished; } 61 61 results = 0; 62 this <<stateMsg;62 this | stateMsg; 63 63 return Nodelete; 64 64 } … … 74 74 allocation receive( Client & this, StateMsg & msg ) with(this) { 75 75 for ( i; Messages ) { 76 servers[i] <<intmsg[i];77 servers[i] <<charmsg[i];76 servers[i] | intmsg[i]; 77 servers[i] | charmsg[i]; 78 78 } 79 79 return Nodelete; … … 124 124 Client client; 125 125 cl = &client; 126 client <<stateMsg;126 client | stateMsg; 127 127 128 128 stop_actor_system(); -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/static.cfa
r0b0a285 rc84dd61 29 29 } 30 30 msg.cnt++; 31 receiver <<msg;31 receiver | msg; 32 32 return Nodelete; 33 33 } … … 58 58 derived_actor actor; 59 59 60 actor <<msg;60 actor | msg; 61 61 62 62 stop_actor_system(); -
doc/theses/colby_parsons_MMAth/benchmarks/actors/plotData.py
r0b0a285 rc84dd61 166 166 for idx, arr in enumerate(data): 167 167 plt.errorbar( procs, arr, [bars[idx][0], bars[idx][1]], capsize=2, marker=next(marker) ) 168 marker = itertools.cycle(('o', 's', 'D', 'x', 'p', '^', 'h', '*', 'v' )) 168 169 if currBench == Bench.Executor or currBench == Bench.Matrix or currBench == Bench.Balance_One or currBench == Bench.Repeat: 169 170 plt.yscale("log") -
doc/theses/colby_parsons_MMAth/benchmarks/channels/plotData.py
r0b0a285 rc84dd61 130 130 for idx, arr in enumerate(data): 131 131 plt.errorbar( procs, arr, [bars[idx][0], bars[idx][1]], capsize=2, marker=next(marker) ) 132 132 marker = itertools.cycle(('o', 's', 'D', 'x', 'p', '^', 'h', '*', 'v' )) 133 133 plt.yscale("log") 134 134 # plt.ylim(1, None) -
doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt/plotData.py
r0b0a285 rc84dd61 103 103 for idx, arr in enumerate(data): 104 104 plt.errorbar( procs, arr, [bars[idx][0], bars[idx][1]], capsize=2, marker=next(marker) ) 105 marker = itertools.cycle(('o', 's', 'D', 'x', 'p', '^', 'h', '*', 'v' )) 105 106 plt.yscale("log") 106 107 plt.xticks(procs) -
doc/theses/colby_parsons_MMAth/glossary.tex
r0b0a285 rc84dd61 37 37 \newabbreviation{toctou}{TOCTOU}{\Newterm{time-of-check to time-of-use}} 38 38 39 \newglossaryentry{actor} 40 { 39 \newglossaryentry{actor}{ 41 40 name=actor, 42 41 description={A basic unit of an actor system that can store local state and send messages to other actors.} 43 42 } 44 43 45 \newglossaryentry{gulp} 46 { 47 name=gulp,44 \newglossaryentry{gulp}{ 45 name={gulp}, 46 first={\Newterm{gulp}}, 48 47 description={Move the contents of message queue to a local queue of the executor thread using a single atomic instruction.} 49 48 } 50 49 51 \newglossaryentry{impl_concurrency} 52 { 50 \newglossaryentry{impl_concurrency}{ 53 51 name=implicit concurrency, 52 first={\Newterm{implicit concurrency}}, 54 53 description={A class of concurrency features that abstract away explicit thread synchronization and mutual exclusion.} 55 54 } 56 55 57 \newglossaryentry{actor_model} 58 { 56 \newglossaryentry{actor_model}{ 59 57 name=actor model, 58 first={\Newterm{actor model}}, 60 59 description={A concurrent computation model, where tasks are broken into units of work that are distributed to actors in the form of messages.} 61 60 } 62 61 63 \newglossaryentry{actor_system} 64 { 62 \newglossaryentry{actor_system}{ 65 63 name=actor system, 64 first={\Newterm{actor system}}, 66 65 description={An implementation of the actor model.} 67 66 } 68 67 69 \newglossaryentry{synch_multiplex} 70 { 68 \newglossaryentry{synch_multiplex}{ 71 69 name=synchronous multiplexing, 70 first={\Newterm{synchronous multiplexing}}, 72 71 description={synchronization on some subset of a set of resources.} 73 72 } -
doc/theses/colby_parsons_MMAth/local.bib
r0b0a285 rc84dd61 100 100 } 101 101 102 @misc{go:sched, 103 author = "The Go Programming Language", 104 title = "src/runtime/proc.go", 105 howpublished = {\href{https://go.dev/src/runtime/proc.go}}, 106 note = "[Online; accessed 23-May-2023]" 107 } 108 102 109 @misc{go:selectref, 103 110 author = "The Go Programming Language Specification", -
doc/theses/colby_parsons_MMAth/text/actors.tex
r0b0a285 rc84dd61 7 7 % C_TODO: add citations throughout chapter 8 8 Actors are an indirect concurrent feature that abstracts threading away from a programmer, and instead provides \gls{actor}s and messages as building blocks for concurrency, where message passing means there is no shared data to protect, making actors amenable in a distributed environment. 9 Actors are another message passing concurrency feature, similar to channels but with more abstraction, and are in the realm of \gls{impl_concurrency}, where programmers write concurrent code without dealing with explicit thread creat eor interaction.9 Actors are another message passing concurrency feature, similar to channels but with more abstraction, and are in the realm of \gls{impl_concurrency}, where programmers write concurrent code without dealing with explicit thread creation or interaction. 10 10 The study of actors can be broken into two concepts, the \gls{actor_model}, which describes the model of computation and the \gls{actor_system}, which refers to the implementation of the model. 11 11 Before discussing \CFA's actor system in detail, it is important to first describe the actor model, and the classic approach to implementing an actor system. … … 21 21 An actor is executed by an underlying \Newterm{executor} (kernel thread-pool) that fairly invokes each actor, where an actor invocation processes one or more messages from its mailbox. 22 22 The default number of executor threads is often proportional to the number of computer cores to achieve good performance. 23 An executor is often tunable with respect to the number of kernel threads and its scheduling algorithm, which optimize for specific actor applications and workloads \see{end of Section~\ref{s:CFAActor Syntax}}.24 25 \s ection{Classic Actor System}23 An executor is often tunable with respect to the number of kernel threads and its scheduling algorithm, which optimize for specific actor applications and workloads \see{end of Section~\ref{s:CFAActor}}. 24 25 \subsection{Classic Actor System} 26 26 An implementation of the actor model with a community of actors is called an actor system. 27 27 Actor systems largely follow the actor model, but can differ in some ways. … … 45 45 \end{figure} 46 46 47 \s ection{\CFA Actors}47 \subsection{\CFA Actor System} 48 48 Figure~\ref{f:standard_actor} shows an actor system designed as \Newterm{actor-centric}, where a set of actors are scheduled and run on underlying executor threads~\cite{CAF,Akka,ProtoActor}. 49 49 The simplest design has a single global queue of actors accessed by the executor threads, but this approach results in high contention as both ends of the queue by the executor threads. … … 92 92 \end{enumerate} 93 93 94 \section{\CFA Actor Syntax}\label{s:CFAActorSyntax}94 \section{\CFA Actor}\label{s:CFAActor} 95 95 \CFA is not an object oriented language and it does not have \gls{rtti}. 96 96 As such, all message sends and receives among actors can only occur using static type-matching, as in Typed-Akka~\cite{AkkaTyped}. … … 146 146 // messages 147 147 struct str_msg { 148 @inline message;@ $\C{// Plan-9 C nominal inheritance}$149 148 char str[12]; 149 @inline message;@ $\C{// Plan-9 C inheritance}$ 150 150 }; 151 151 void ?{}( str_msg & this, char * str ) { strcpy( this.str, str ); } $\C{// constructor}$ 152 152 struct int_msg { 153 @inline message;@ $\C{// Plan-9 C nominal inheritance}$154 153 int i; 154 @inline message;@ $\C{// Plan-9 C inheritance}$ 155 155 }; 156 void ?{}( int_msg & this, int i ) { this.i = i; } $\C{// constructor}$157 156 // behaviours 158 allocation receive( my_actor &, @str_msg & msg@ ) {159 sout | "string message \"" | msg.str | "\"";157 allocation receive( my_actor &, @str_msg & msg@ ) with(msg) { 158 sout | "string message \"" | str | "\""; 160 159 return Nodelete; $\C{// actor not finished}$ 161 160 } 162 allocation receive( my_actor &, @int_msg & msg@ ) {163 sout | "integer message" | msg.i;161 allocation receive( my_actor &, @int_msg & msg@ ) with(msg) { 162 sout | "integer message" | i; 164 163 return Nodelete; $\C{// actor not finished}$ 165 164 } 166 165 int main() { 166 str_msg str_msg{ "Hello World" }; $\C{// constructor call}$ 167 int_msg int_msg{ 42 }; $\C{// constructor call}$ 167 168 start_actor_system(); $\C{// sets up executor}$ 168 169 my_actor actor; $\C{// default constructor call}$ 169 str_msg str_msg{ "Hello World" }; $\C{// constructor call}$ 170 int_msg int_msg{ 42 }; $\C{// constructor call}$ 171 @actor << str_msg << int_msg;@ $\C{// cascade sends}$ 172 @actor << int_msg;@ $\C{// send}$ 173 @actor << finished_msg;@ $\C{// send => terminate actor (deallocation deferred)}$ 170 @actor | str_msg | int_msg;@ $\C{// cascade sends}$ 171 @actor | int_msg;@ $\C{// send}$ 172 @actor | finished_msg;@ $\C{// send => terminate actor (deallocation deferred)}$ 174 173 stop_actor_system(); $\C{// waits until actors finish}\CRT$ 175 174 } // deallocate int_msg, str_msg, actor 176 175 \end{cfa} 177 176 \caption{\CFA Actor Syntax} 178 \label{f:CFAActor Syntax}179 \end{figure} 180 181 Figure~\ref{f:CFAActor Syntax} shows a complete \CFA actor example starting with the actor type @my_actor@ created by defining a @struct@ that inherits from the base @actor@ @struct@ via the @inline@ keyword.182 This inheritance style is the Plan-9 C-style nominalinheritance discussed in Section~\ref{s:Inheritance}.177 \label{f:CFAActor} 178 \end{figure} 179 180 Figure~\ref{f:CFAActor} shows a complete \CFA actor example starting with the actor type @my_actor@ created by defining a @struct@ that inherits from the base @actor@ @struct@ via the @inline@ keyword. 181 This inheritance style is the Plan-9 C-style inheritance discussed in Section~\ref{s:Inheritance}. 183 182 Similarly, the message types @str_msg@ and @int_msg@ are created by defining a @struct@ that inherits from the base @message@ @struct@ via the @inline@ keyword. 184 Both message types have constructors to set the message value. 183 Only @str_msg@ needs a constructor to copy the C string; 184 @int_msg@ is initialized using its \CFA auto-generated constructors. 185 185 There are two matching @receive@ (behaviour) routines that process the corresponding typed messages. 186 The program main begins by calling @start_actor_system@ to start the actor implementation, including executor threads to run the actors. 187 An actor and two messages are created on the stack, and four messages are sent to the actor using operator @<<@. 188 The last message is the builtin @finish_msg@, which returns @Finished@ to an executor thread, which removes the actor from the actor system \see{Section~\ref{s:ActorBehaviours}}. 189 The call to @stop_actor_system@ blocks program main until all actors are finished and removed from the actor system. 190 The program main ends by deleting the actor and messages from the stack. 186 Both @receive@ routines use a @with@ clause so message fields are not qualified and return @Nodelete@ indicating the actor is not finished. 187 Also, all messages are marked with @Nodelete@ as their default allocation state. 188 The program main begins by creating two messages on the stack. 189 Then the executor system is started by calling @start_actor_system@. 190 Now an actor is created on the stack and four messages are sent it using operator @?|?@. 191 The last message is the builtin @finish_msg@, which returns @Finished@ to an executor thread, causing it to removes the actor from the actor system \see{Section~\ref{s:ActorBehaviours}}. 192 The call to @stop_actor_system@ blocks the program main until all actors are finished and removed from the actor system. 193 The program main ends by deleting the actor and two messages from the stack. 191 194 The output for the program is: 192 195 \begin{cfa} … … 237 240 Note, it is safe to construct an actor or message with a status other than @Nodelete@, since the executor only examines the allocation action after a behaviour returns. 238 241 242 \subsection{Actor Envelopes}\label{s:envelope} 243 As stated, each message, regardless of where it is allocated, can be sent to an arbitrary number of actors, and hence, appear on an arbitrary number of message queues. 244 Because a C program manages message lifetime, messages cannot be copied for each send, otherwise who manages the copies. 245 Therefore, it up to the actor program to manage message life-time across receives. 246 However, for a message to appear on multiple message queues, it needs an arbitrary number of associated destination behaviours. 247 Hence, there is the concept of an envelop, which is dynamically allocated on each send, that wraps a message with any extra implementation fields needed to persist between send and receive. 248 Managing the envelop is straightforward because it is created at the send and deleted after the receive, \ie there is 1:1 relationship for an envelop and a many to one relationship for a message. 249 250 % In actor systems, messages are sent and received by actors. 251 % When a actor receives a message it executes its behaviour that is associated with that message type. 252 % However the unit of work that stores the message, the receiving actor's address, and other pertinent information needs to persist between send and the receive. 253 % Furthermore the unit of work needs to be able to be stored in some fashion, usually in a queue, until it is executed by an actor. 254 % All these requirements are fulfilled by a construct called an envelope. 255 % The envelope wraps up the unit of work and also stores any information needed by data structures such as link fields. 256 257 % One may ask, "Could the link fields and other information be stored in the message?". 258 % This is a good question to ask since messages also need to have a lifetime that persists beyond the work it delivers. 259 % However, if one were to use messages as envelopes then a message would not be able to be sent to multiple actors at a time. 260 % Therefore this approach would just push the allocation into another location, and require the user to dynamically allocate a message for every send, or require careful ordering to allow for message reuse. 261 239 262 \subsection{Actor System}\label{s:ActorSystem} 240 263 The calls to @start_actor_system@, and @stop_actor_system@ mark the start and end of a \CFA actor system. … … 258 281 All actors must be created \emph{after} calling @start_actor_system@ so the executor can keep track of the number of actors that have entered the system but not yet terminated. 259 282 260 % All message sends are done using the left-shift operator, @<<@, similar to the syntax of \CC's stream output.261 % \begin{cfa}262 % allocation ?<<?( my_actor & receiver, my_msg & msg )263 % \end{cfa}264 % Notice this signature is the same as the @receive@ routine, which is no coincidence.265 % The \CFA compiler generates a @?<<?@ routine definition and forward declaration for each @receive@ routine that has the appropriate signature.266 % The generated routine packages the message and actor in an \hyperref[s:envelope]{envelope} and adds it to the executor's queues via an executor routine.267 % As part of packaging the envelope, the @?<<?@ routine sets a routine pointer in the envelope to point to the appropriate receive routine for given actor and message types.268 269 283 \subsection{Actor Send}\label{s:ActorSend} 270 All message sends are done using the left-shift operator, @<<@, similar to the syntax of \CC's stream output. 284 All message sends are done using the vertical-bar (bit-or) operator, @?|?@, similar to the syntax of the \CFA stream I/O. 285 Hence, programmers must write a matching @?|?@ routine for each @receive@ routine, which is awkward and generates a maintenance problem that must be solved. 286 \CFA's current best approach for creating a generic @?|?@ routine requires users to create routines for their actor and message types that access the base type. 287 Since these routines are not complex, they can be generated using macros that are used to annotate the user-defined actor and message types. 288 This approach is used in \CFA's intrusive list data structure. 289 This is not much better than asking users to write the @?|?@ routine themselves in terms of maintenance, since the user needs to remember the boilerplate macro annotation. 290 271 291 As stated, \CFA does not have named inheritance with RTTI. 272 292 \CFA does have a preliminary form of virtual routines, but it is not mature enough for use in this work. 273 Therefore, there is no mechanism to write a generic @<<@ routine taking a base actor and message type, and then dynamically selectingthe @receive@ routine from the actor argument.274 (For messages, the Plan-9 inheritance is sufficient because only the inherited fields are needed during the message send.) 275 Hence, programmers must write a matching @<<@ routine for each @receive@ routine, which is awkward and generates a maintenance problem. 276 Therefore, I chose to use a template-like approach, where the compiler generates a matching @<<@ routine for each @receive@ routine it finds with anactor/message type-signature.277 Th en, \CFA uses the type from the left-hand side of an assignment to select the matching receive routine.293 Virtuals would provide a mechanism to write a single generic @?|?@ routine taking a base actor and message type, that would dynamically select the @receive@ routine from the actor argument. 294 Note, virtuals are not needed for the send; Plan-9 inheritance is sufficient because only the inherited fields are needed during the message send (only upcasting is needed). 295 296 Therefore, a template-like approach was chosen, where the compiler generates a matching @?|?@ routine for each @receive@ routine it finds with the correct actor/message type-signature. 297 This approach requires no annotation or additional code to be written by users, thus it resolves the maintenance problem. 278 298 (When the \CFA virtual routines mature, it should be possible to seamlessly transition to it from the template approach.) 279 299 280 % Funneling all message sends through a single @allocation ?<<?(actor &, message &)@ routine is not feasible since the type of the actor and message would be erased, making it impossible to acquire a pointer to the correct @receive@. 281 % As such a @?<<?@ routine per @receive@ provides type information needed to write the correct "address" on the envelope. 282 283 % The left-shift operator routines are generated by the compiler. 284 An example of a receive routine and its corresponding generated operator routine is shown in Figure~\ref{f:actor_gen}. 285 Notice the parameter signature of @?<<?@ is the same as the @receive@ routine. 286 A @?<<?@ routine is generated per @receive@ routine with a matching signature. 287 The @?<<?@ routine packages the message and actor in an \hyperref[s:envelope]{envelope} and adds it to the executor's queues via the executor routine @send@. 288 The envelope is conceptually "addressed" to a behaviour, which is stored in the envelope as a function pointer to a @receive@ routine. 289 The @?<<?@ routines ensure that messages are sent to the right address, \ie sent to the right @receive@ routine based on actor and message type. 300 Figure~\ref{f:send_gen} shows the generated send routine for the @int_msg@ receive in Figure~\ref{f:CFAActor}. 301 Operator @?|?@ has the same parameter signature as the corresponding @receive@ routine and returns an @actor@ so the operator can be cascaded. 302 The routine sets @rec_fn@ to the matching @receive@ routine using the left-hand type to perform the selection. 303 Then the routine packages the base and derived actor and message and actor, along with the receive routine into an \hyperref[s:envelope]{envelope}. 304 Finally, the envelop is added to the executor queue designated by the actor using the executor routine @send@. 290 305 291 306 \begin{figure} 292 307 \begin{cfa} 293 $\LstCommentStyle{// from Figure~\ref{f:CFAActorSyntax}}$ 294 struct my_actor { inline actor; }; $\C[3.5in]{// actor}$ 295 struct int_msg { inline message; int i; }; $\C{// message}$ 296 void ?{}( int_msg & this, int i ) { this.i = i; } $\C{// constructor}$ 297 allocation receive( @my_actor &, int_msg & msg@ ) { $\C{// receiver}$ 298 sout | "integer message" | msg.i; 299 return Nodelete; 300 } 301 302 // compiler generated operator 303 #define RECEIVER( A, M ) (allocation (*)(actor &, message &))(allocation (*)( A &, M & ))receive 304 my_actor & ?<<?( @my_actor & receiver, int_msg & msg@ ) { 305 send( receiver, (request){ &receiver, &msg, RECEIVER( my_actor, int_msg ) } ); 308 $\LstCommentStyle{// from Figure~\ref{f:CFAActor}}$ 309 struct my_actor { inline actor; }; $\C[3.75in]{// actor}$ 310 struct int_msg { inline message; int i; }; $\C{// message}$ 311 allocation receive( @my_actor &, int_msg & msg@ ) {...} $\C{// receiver}$ 312 313 // compiler generated send operator 314 typedef allocation (*receive_t)( actor &, message & ); 315 actor & ?|?( @my_actor & receiver, int_msg & msg@ ) { 316 allocation (*rec_fn)( my_actor &, int_msg & ) = @receive@; // deduce receive routine 317 request req{ &receiver, (actor *)&receiver, &msg, (message *)&msg, (receive_t)rec_fn }; 318 send( receiver, req ); $\C{// queue message for execution}\CRT$ 306 319 return receiver; 307 320 } 308 321 \end{cfa} 309 322 \caption{Generated Send Operator} 310 \label{f:actor_gen} 323 \label{f:send_gen} 324 \end{figure} 325 326 \subsection{Actor Termination}\label{s:ActorTerm} 327 During a message send, the receiving actor and message being sent are stored via pointers in the envelope. 328 These pointers have the base actor and message types, so type information of the actor and message is lost and then recovered later when the typed receive routine is called. 329 After the receive routine is done, the executor must clean up the actor and message according to their allocation status. 330 If the allocation status is @Delete@ or @Destroy@, the appropriate destructor must be called by the executor. 331 This poses a problem; the correct type of the actor or message is not available to the executor, but it needs to call the right destructor! 332 This requires downcasting from the base type to derived type, which requires a virtual system. 333 Thus, a rudimentary destructor-only virtual system was added to \CFA as part of this work. 334 This virtual system is used via Plan-9 inheritance of the @virtual_dtor@ type, shown in Figure~\ref{f:VirtDtor}. 335 The @virtual_dtor@ type maintains a pointer to the start of the object, and a pointer to the correct destructor. 336 When a type inherits the @virtual_dtor@ type, the compiler adds code to its destructor to make sure that any destructor calls along this segment of the inheritance tree is called are intercepted, and restart at the appropriate destructor for that object. 337 338 \begin{figure} 339 \begin{cfa} 340 struct base_type { inline virtual_dtor; }; 341 struct intermediate_type { inline base_type; }; 342 struct derived_type { inline intermediate_type; }; 343 344 int main() { 345 derived_type d1, d2, d3; 346 intermediate_type & i = d2; 347 base_type & b = d3; 348 349 // these will call the destructors in the correct order 350 ^d1{}; ^i{}; ^b{}; 351 } 352 353 \end{cfa} 354 \caption{\CFA Virtual Destructor} 355 \label{f:VirtDtor} 356 \end{figure} 357 358 This virtual destructor system was built for this work, but is general and can be used in any type in \CFA. 359 Actors and messages opt into this system by inheriting the @virtual_dtor@ type, which allows the executor to call the right destructor without knowing the derived actor or message type. 360 361 Figure~\ref{f:ConvenienceMessages} shows three builtin convenience messages and receive routines used to terminate actors, depending on how an actor is allocated: @Delete@, @Destroy@ or @Finished@. 362 For example, in Figure~\ref{f:CFAActor}, the builtin @finished_msg@ message and receive are used to terminate the actor because the actor is allocated on the stack, so no deallocation actions are performed by the executor. 363 364 \begin{figure} 365 \begin{cfa} 366 message __base_msg_finished $@$= { .allocation_ : Finished }; // no auto-gen constructors 367 struct __delete_msg_t { inline message; } delete_msg = __base_msg_finished; 368 struct __destroy_msg_t { inline message; } destroy_msg = __base_msg_finished; 369 struct __finished_msg_t { inline message; } finished_msg = __base_msg_finished; 370 371 allocation receive( actor & this, __delete_msg_t & msg ) { return Delete; } 372 allocation receive( actor & this, __destroy_msg_t & msg ) { return Destroy; } 373 allocation receive( actor & this, __finished_msg_t & msg ) { return Finished; } 374 \end{cfa} 375 \caption{Builtin Convenience Messages} 376 \label{f:ConvenienceMessages} 311 377 \end{figure} 312 378 … … 319 385 The goal is to achieve better performance and scalability for certain kinds of actor applications by reducing executor locking. 320 386 Note, lock-free queues do not help because busy waiting on any atomic instruction is the source of the slowdown whether it is a lock or lock-free. 321 Work steal now becomes queue stealing, where an entire actor/message queue is stolen, which trivially preserves message ordering in a queue \see{Section~\ref{s:steal}}.322 387 323 388 \begin{figure} … … 330 395 331 396 Each executor thread iterates over its own message queues until it finds one with messages. 332 At this point, the executor thread atomically \gls{gulp}s the queue, meaning move the contents of message queue to a local queue of the executor thread using a single atomic instruction. 333 This step allows the executor threads to process the local queue without any atomics until the next gulp, while other executor threads are adding in parallel to the end of one of the message queues. 334 In detail, an executor thread performs a test-and-gulp, non-atomically checking if a queue is non-empty before gulping it. 335 If a test fails during a message add, the worst-case is cycling through all the message queues. 336 However, the gain is minimizing costly lock acquisitions. 397 At this point, the executor thread atomically \gls{gulp}s the queue, meaning it moves the contents of message queue to a local queue of the executor thread using a single atomic instruction. 337 398 An example of the queue gulping operation is shown in the right side of Figure \ref{f:gulp}, where a executor threads gulps queue 0 and begins to process it locally. 338 339 Processing a local queue involves removing a unit of work from the queue and executing it. 399 This step allows an executor thread to process the local queue without any atomics until the next gulp. 400 Other executor threads can continue adding to the ends of executor thread's message queues. 401 In detail, an executor thread performs a test-and-gulp, non-atomically checking if a queue is non-empty, before attempting to gulp it. 402 If an executor misses an non-empty queue due to a race, it eventually finds the queue after cycling through its message queues. 403 This approach minimizes costly lock acquisitions. 404 405 Processing a local queue involves: removing a unit of work from the queue, dereferencing the actor pointed-to by the work-unit, running the actor's behaviour on the work-unit message, examining the returned allocation status from the @receive@ routine for the actor and internal status in the delivered message, and taking the appropriate actions. 340 406 Since all messages to a given actor are in the same queue, this guarantees atomicity across behaviours of that actor since it can only execute on one thread at a time. 341 After running a behaviour, the executor thread examines the returned allocation status from the @receive@ routine for the actor and internal status in the delivered message, and takes the appropriate action. 342 Once all actors have marked themselves as being finished the executor initiates shutdown by inserting a sentinel value into the message queues. 343 Once a executor threads sees a sentinel it stops running. 344 After all executors stop running the actor system shutdown is complete. 345 346 \section{Envelopes}\label{s:envelope} 347 As stated, each message, regardless of where it is allocated, can be sent to an arbitrary number of actors, and hence, appear on an arbitrary number of message queues. 348 Because a C program manages message lifetime, messages cannot be copied for each send, otherwise who manages the copies. 349 Therefore, it up to the actor program to manage message life-time across receives. 350 However, for a message to appear on multiple message queues, it needs an arbitrary number of link fields. 351 Hence, there is the concept of an envelop, which is dynamically allocated on each send, that wraps a message with any extra implementation fields needed to persist between send and receive. 352 Managing the envelop is straightforward because it is created at the send and deleted after the receive, \ie there is 1:1 relationship for an envelop and a many to one relationship for a message. 353 354 % In actor systems, messages are sent and received by actors. 355 % When a actor receives a message it executes its behaviour that is associated with that message type. 356 % However the unit of work that stores the message, the receiving actor's address, and other pertinent information needs to persist between send and the receive. 357 % Furthermore the unit of work needs to be able to be stored in some fashion, usually in a queue, until it is executed by an actor. 358 % All these requirements are fulfilled by a construct called an envelope. 359 % The envelope wraps up the unit of work and also stores any information needed by data structures such as link fields. 360 361 % One may ask, "Could the link fields and other information be stored in the message?". 362 % This is a good question to ask since messages also need to have a lifetime that persists beyond the work it delivers. 363 % However, if one were to use messages as envelopes then a message would not be able to be sent to multiple actors at a time. 364 % Therefore this approach would just push the allocation into another location, and require the user to dynamically allocate a message for every send, or require careful ordering to allow for message reuse. 365 366 Unfortunately, this frequent allocation of envelopes for each send results in heavy contention on the memory allocator. 367 As such, a way to alleviate contention on the memory allocator would result in a performance improvement. 368 Contention is reduced using a novel data structure, called a \Newterm{copy queue}. 407 As each actor is created or terminated by an executor thread, it increments/decrements a global counter. 408 When an executor decrements the counter to zero, it sets a global boolean variable that is checked by each executor thread when it has no work. 409 Once a executor threads sees the flag is set it stops running. 410 After all executors stop, the actor system shutdown is complete. 369 411 370 412 \subsection{Copy Queue}\label{s:copyQueue} 413 Unfortunately, the frequent allocation of envelopes for each send results in heavy contention on the memory allocator. 414 This contention is reduced using a novel data structure, called a \Newterm{copy queue}. 371 415 The copy queue is a thin layer over a dynamically sized array that is designed with the envelope use case in mind. 372 A copy queue supports the typical queue operations of push/pop but in a different way than a typical arraybased queue.373 The copy queue is designed to take advantage of the \gls{gulp}ing pattern. 374 As such, the amortized runtime cost of each push/pop operation for the copy queue is$O(1)$.416 A copy queue supports the typical queue operations of push/pop but in a different way from a typical array-based queue. 417 418 The copy queue is designed to take advantage of the \gls{gulp}ing pattern, giving an amortized runtime cost for each push/pop operation of $O(1)$. 375 419 In contrast, a na\"ive array-based queue often has either push or pop cost $O(n)$ and the other cost $O(1)$ since one of the operations requires shifting the elements of the queue. 376 420 Since the executor threads gulp a queue to operate on it locally, this creates a usage pattern where all elements are popped from the copy queue without any interleaved pushes. … … 384 428 For many workload, the copy queues grow in size to facilitate the average number of messages in flight and there is no further dynamic allocations. 385 429 One downside of this approach that more storage is allocated than needed, \ie each copy queue is only partially full. 386 Comparatively, the individual envelope allocations of a list 430 Comparatively, the individual envelope allocations of a list-based queue mean that the actor system always uses the minimum amount of heap space and cleans up eagerly. 387 431 Additionally, bursty workloads can cause the copy queues to allocate a large amounts of space to accommodate the peaks of the throughput, even if most of that storage is not needed for the rest of the workload's execution. 388 432 … … 390 434 Initially, the memory reclamation na\"ively reclaims one index of the array per \gls{gulp}, if the array size is above a low fixed threshold. 391 435 However, this approach has a problem. 392 The high memory usagewatermark nearly doubled!393 The issue can easily behighlighted with an example.436 The high memory watermark nearly doubled! 437 The issue is highlighted with an example. 394 438 Assume a fixed throughput workload, where a queue never has more than 19 messages at a time. 395 439 If the copy queue starts with a size of 10, it ends up doubling at some point to size 20 to accommodate 19 messages. 396 440 However, after 2 gulps and subsequent reclamations the array size is 18. 397 441 The next time 19 messages are enqueued, the array size is doubled to 36! 398 To avoid this issue a second check is added. 399 Each copy queue started tracking the utilization of its array size. 442 To avoid this issue, a second check is added. 400 443 Reclamation only occurs if less than half of the array is utilized. 401 In doing this, the reclamation scheme is able to achieve a lower high-watermark and a lower overall memory utilization compared to the non-reclamation copy queues. 402 However, the use of copy queues still incurs a higher memory cost than list-based queueing. 403 With the inclusion of a memory reclamation scheme the increase in memory usage is reasonable considering the performance gains and is discussed further in Section~\ref{s:actor_perf}. 444 This check achieves a lower total storage and overall memory utilization compared to the non-reclamation copy queues. 445 However, the use of copy queues still incurs a higher memory cost than list-based queueing, but the increase in memory usage is reasonable considering the performance gains \see{Section~\ref{s:actor_perf}}. 404 446 405 447 \section{Work Stealing}\label{s:steal} 406 Work stealing is a scheduling strategy t hat attempts to load balance, and increase resource utilization by having idle threads steal work.407 The re are many parts that make up a work stealing actor scheduler, but the two that will be highlighted in this work are the stealing mechanism and victim selection.408 409 % C_TODO enter citation for langs 448 Work stealing is a scheduling strategy to provide \Newterm{load balance}. 449 The goal is to increase resource utilization by having idle threads steal work from working threads. 450 While there are multiple parts in work-stealing scheduler, the two important components are victim selection and the stealing mechanism. 451 410 452 \subsection{Stealing Mechanism} 411 In this discussion of work stealing the worker being stolen from will be referred to as the \textbf{victim} and the worker stealing work will be called the \textbf{thief}.412 The stealing mechanism presented here differs from existing work stealing actor systems due the inverted actorsystem.413 Other actor systems such as Akka \cite{} and CAF \cite{} have work stealing, but since they use an classic actor system that is actor-centric, stealing work is the act of stealing an actor from a dequeue.414 As an example, in CAF, the sharded actor queue is a set of double 415 When ever an actor is moved to a ready queue, it is inserted into a worker's dequeue.453 In work stealing, the stealing worker is called the \Newterm{thief} and the stolen-from worker is called the \Newterm{victim}. 454 The stealing mechanism presented here differs from existing work-stealing actor-systems because of the message-centric (inverted) actor-system. 455 Other actor systems, such as Akka~\cite{Akka} and CAF~\cite{CAF}, have work stealing, but use an actor-centric system where stealing is dequeuing from a non-empty ready-queue to an empty ready-queue. 456 As an example, in CAF, the sharded actor queue is a set of double-ended queues (dequeues). 457 When an actor has messages, it is inserted into a worker's dequeue (ready queue). 416 458 Workers then consume actors from the dequeue and execute their behaviours. 417 459 To steal work, thieves take one or more actors from a victim's dequeue. 418 This action creates contention on the dequeue, which can slow down the throughput of the victim. 419 The notion of which end of the dequeue is used for stealing, consuming, and inserting is not discussed since it isn't relevant. 420 By the pigeon hole principle there are three dequeue operations (push/victim pop/thief pop) that can occur concurrently and only two ends to a dequeue, so work stealing being present in a dequeue based system will always result in a potential increase in contention on the dequeues. 460 By the pigeon hole principle, there are three dequeue operations (push/victim pop/thief pop) that can occur concurrently and only two ends to a dequeue, so work stealing in a dequeue-based system always results in a potential increase in contention on the dequeues. 461 This contention can slows down the victim's throughput. 462 Note, which end of the dequeue is used for stealing, consuming, and inserting is not discussed since the largest cost is the mutual exclusion and its duration for safely performing the queue operations. 463 464 Work steal now becomes queue stealing, where an entire actor/message queue is stolen, which trivially preserves message ordering in a queue \see{Section~\ref{s:steal}}. 421 465 422 466 % C_TODO: maybe insert stealing diagram 423 467 424 In \CFA, the actor work stealing implementation is unique. 425 While other systems are concerned with stealing actors, the \CFA actor system steals queues. 426 This is a result of \CFA's use of the inverted actor system. 427 The goal of the \CFA actor work stealing mechanism is to have a zero-victim-cost stealing mechanism. 428 This does not means that stealing has no cost. 429 This goal is to ensure that stealing work does not impact the performance of victim workers. 430 This means that thieves can not contend with victims, and that victims should perform no stealing related work unless they become a thief. 431 In theory this goal is not achieved, but results will be presented that show the goal is achieved in practice. 432 In \CFA's actor system workers own a set of sharded queues which they iterate over and gulp. 433 If a worker has iterated over the queues they own twice without finding any work, they try to steal a queue from another worker. 434 Stealing a queue is done wait-free with a few atomic instructions that can only create contention with other stealing workers. 435 To steal a queue a worker does the following: 468 In \CFA, the actor work-stealing implementation is unique because of the message-centric system. 469 In this system, it is impractical to steal actors because an actor's messages are distributed in temporal order along the message queue. 470 To ensure sequential actor execution and FIFO message delivery, actor stealing requires finding and removing all of an actor's messages, and inserting them consecutively in another message queue. 471 This operation is $O(N)$ with a non-trivial constant. 472 The only way for work stealing to become practical is to shard the message queue, which also reduces contention, and steal queues to eliminate queue searching. 473 474 Given queue stealing, the goal is to have a zero-victim-cost stealing mechanism, which does not mean stealing has no cost. 475 It means work stealing does not affect the performance of the victim worker. 476 The implication is that thieves cannot contend with a victim, and that a victim should perform no stealing related work unless it becomes a thief. 477 In theory, this goal is not achievable, but results show the goal is achieved in practice. 478 479 In \CFA's actor system, workers own a set of sharded queues, which they iterate over and gulp. 480 If a worker has iterated over its message queues twice without finding any work, it tries to steal a queue from another worker. 481 Stealing a queue is done wait-free with a few atomic instructions that can only create contention with other stealing workers, not the victim. 482 To steal a queue, a worker does the following: 436 483 \begin{enumerate}[topsep=5pt,itemsep=3pt,parsep=0pt] 437 484 \item 438 The thief chooses a victim .485 The thief chooses a victim, which is trivial because all workers are stored in a shared array. 439 486 440 487 \item 441 488 The thief starts at a random index in the array of the victim's queues and searches for a candidate queue. 442 A candidate queue is any queue that is not empty, is not being stolen by another thief, and is not being processed by the victim. 443 These are not strictly enforced rules. 444 The candidate is identified non-atomically and as such queues that do not satisfy these rules may be stolen. 445 However, steals that do not meet these requirements do not affect correctness so they are allowed and do not constitute failed steals as the queues will still be swapped. 446 447 448 \item 449 Once a candidate queue is chosen, the thief attempts a wait-free swap of the victim's queue and a random on of the thief's queues. 450 This swap can fail. 451 If the swap is successful the thief swaps the two queues. 452 If the swap fails, another thief must have attempted to steal one of the two queues being swapped. 453 Failing to steal is good in this case since stealing a queue that was just swapped would likely result in stealing an empty queue. 489 A candidate queue is any non-empty queue not being processed by the victim and not being stolen by another thief. 490 These rules are not strictly enforced. 491 A candidate is identified non-atomically, and as such, queues that do not satisfy these rules may be stolen. 492 However, steals not meeting the rules do not affect correctness and do not constitute failed steals as the queue is always swapped. 493 494 \item 495 Once a candidate queue is chosen, the thief attempts a wait-free swap of a victim's queue to a random empty thief queue. 496 If the swap successes, the steal is completed. 497 If the swap fails, the victim may have been gulping that message queue or another thief must have attempted to steal the victim's queue. 498 In either case, that message queue is highly likely to be empty. 499 500 \item 501 Once a thief fails or succeeds in stealing a queue, it iterates over its messages queues again because new messages may have arrived during stealing. 502 Stealing is only repeated after two consecutive iterations over its owned queues without finding work. 454 503 \end{enumerate} 455 504 456 Once a thief fails or succeeds in stealing a queue, it goes back to its own set of queues and iterates over them again.457 It will only try to steal again once it has completed two consecutive iterations over its owned queues without finding any work.458 505 The key to the stealing mechanism is that the queues can still be operated on while they are being swapped. 459 This eliminates any contention between thieves and victims. 506 This functionality eliminates any contention among thieves and victims. 507 460 508 The first key to this is that actors and workers maintain two distinct arrays of references to queues. 461 509 Actors will always receive messages via the same queues. … … 606 654 607 655 \subsection{Stealing Guarantees} 608 609 % C_TODO insert graphs for each proof610 656 Given that the stealing operation can potentially fail, it is important to discuss the guarantees provided by the stealing implementation. 611 657 Given a set of $N$ swaps a set of connected directed graphs can be constructed where each vertex is a queue and each edge is a swap directed from a thief queue to a victim queue. … … 749 795 Since the @Finished@ allocation status is unused for messages, it is used internally to detect if a message has been sent. 750 796 Deallocating a message without sending it could indicate to a user that they are touching freed memory later, or it could point out extra allocations that could be removed. 797 \item Detection of messages sent but not received 798 As discussed in Section~\ref{s:executor}, once all actors have terminated shutdown is communicated to executor threads via a status flag. Upon termination the executor threads check their queues to see if any contain messages. If they do, an error is reported. Messages being sent but not received means that their allocation action did not occur and their payload was not delivered. Missing the allocation action can lead to memory leaks and missed payloads can cause unpredictable behaviour. Detecting this can indicate a race or logic error in the user's code. 751 799 \end{itemize} 752 800 -
doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex
r0b0a285 rc84dd61 415 415 \begin{figure} 416 416 \centering 417 \captionsetup[subfloat]{labelfont=footnotesize,textfont=footnotesize} 417 418 \subfloat[AMD]{ 418 419 \resizebox{0.5\textwidth}{!}{\input{figures/nasus_Aggregate_Lock_2.pgf}} … … 421 422 \resizebox{0.5\textwidth}{!}{\input{figures/pyke_Aggregate_Lock_2.pgf}} 422 423 } 424 \bigskip 423 425 424 426 \subfloat[AMD]{ … … 428 430 \resizebox{0.5\textwidth}{!}{\input{figures/pyke_Aggregate_Lock_4.pgf}} 429 431 } 432 \bigskip 430 433 431 434 \subfloat[AMD]{ -
driver/cfa.cc
r0b0a285 rc84dd61 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 30 10:47:52202313 // Update Count : 47 812 // Last Modified On : Fri Jun 9 14:36:41 2023 13 // Update Count : 479 14 14 // 15 15 … … 334 334 #ifdef __ARM_ARCH 335 335 args[nargs++] = "-mno-outline-atomics"; // use ARM LL/SC instructions for atomics 336 // args[nargs++] = "-march=armv8.2-a+lse"; // use atomic instructions 336 337 #endif // __ARM_ARCH 337 338 -
libcfa/prelude/builtins.c
r0b0a285 rc84dd61 149 149 150 150 static inline { 151 longint ?\?( int x, unsigned int y ) { __CFA_EXP__(); }151 int ?\?( int x, unsigned int y ) { __CFA_EXP__(); } 152 152 long int ?\?( long int x, unsigned long int y ) { __CFA_EXP__(); } 153 153 long long int ?\?( long long int x, unsigned long long int y ) { __CFA_EXP__(); } 154 154 // unsigned computation may be faster and larger 155 unsigned longint ?\?( unsigned int x, unsigned int y ) { __CFA_EXP__(); }155 unsigned int ?\?( unsigned int x, unsigned int y ) { __CFA_EXP__(); } 156 156 unsigned long int ?\?( unsigned long int x, unsigned long int y ) { __CFA_EXP__(); } 157 157 unsigned long long int ?\?( unsigned long long int x, unsigned long long int y ) { __CFA_EXP__(); } … … 176 176 177 177 static inline { 178 longint ?\=?( int & x, unsigned int y ) { x = x \ y; return x; }178 int ?\=?( int & x, unsigned int y ) { x = x \ y; return x; } 179 179 long int ?\=?( long int & x, unsigned long int y ) { x = x \ y; return x; } 180 180 long long int ?\=?( long long int & x, unsigned long long int y ) { x = x \ y; return x; } 181 unsigned longint ?\=?( unsigned int & x, unsigned int y ) { x = x \ y; return x; }181 unsigned int ?\=?( unsigned int & x, unsigned int y ) { x = x \ y; return x; } 182 182 unsigned long int ?\=?( unsigned long int & x, unsigned long int y ) { x = x \ y; return x; } 183 183 unsigned long long int ?\=?( unsigned long long int & x, unsigned long long int y ) { x = x \ y; return x; } -
libcfa/prelude/sync-builtins.cf
r0b0a285 rc84dd61 206 206 _Bool __sync_bool_compare_and_swap(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 207 207 #endif 208 // for all pointer types 208 209 forall(T &) _Bool __sync_bool_compare_and_swap(T * volatile *, T *, T*, ...); 209 210 … … 223 224 unsigned __int128 __sync_val_compare_and_swap(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 224 225 #endif 226 // for all pointer types 225 227 forall(T &) T * __sync_val_compare_and_swap(T * volatile *, T *, T*,...); 226 228 … … 326 328 void __atomic_exchange(volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, int); 327 329 #endif 330 // for all pointer types 328 331 forall(T &) T * __atomic_exchange_n(T * volatile *, T *, int); 329 332 forall(T &) void __atomic_exchange(T * volatile *, T **, T **, int); … … 359 362 void __atomic_load(const volatile unsigned __int128 *, unsigned __int128 *, int); 360 363 #endif 364 // for all pointer types 361 365 forall(T &) T * __atomic_load_n(T * const volatile *, int); 362 366 forall(T &) void __atomic_load(T * const volatile *, T **, int); … … 390 394 _Bool __atomic_compare_exchange (volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, _Bool, int, int); 391 395 #endif 396 // for all pointer types 392 397 forall(T &) _Bool __atomic_compare_exchange_n (T * volatile *, T **, T*, _Bool, int, int); 393 398 forall(T &) _Bool __atomic_compare_exchange (T * volatile *, T **, T**, _Bool, int, int); … … 423 428 void __atomic_store(volatile unsigned __int128 *, unsigned __int128 *, int); 424 429 #endif 430 // for all pointer types 425 431 forall(T &) void __atomic_store_n(T * volatile *, T *, int); 426 432 forall(T &) void __atomic_store(T * volatile *, T **, int); -
libcfa/src/common.hfa
r0b0a285 rc84dd61 32 32 } // extern "C" 33 33 static inline __attribute__((always_inline)) { 34 unsigned char abs( signed char v ) { return abs( (int)v ); }34 unsigned char abs( signed char v ) { return (int)abs( (int)v ); } 35 35 // use default C routine for int 36 36 unsigned long int abs( long int v ) { return labs( v ); } … … 70 70 unsigned int min( unsigned int v1, unsigned int v2 ) { return v1 < v2 ? v1 : v2; } 71 71 long int min( long int v1, long int v2 ) { return v1 < v2 ? v1 : v2; } 72 unsigned long int min( unsigned long int v1, unsigned int v2 ) { return v1 < v2 ? v1 : v2; }72 unsigned long int min( unsigned long int v1, unsigned long int v2 ) { return v1 < v2 ? v1 : v2; } 73 73 long long int min( long long int v1, long long int v2 ) { return v1 < v2 ? v1 : v2; } 74 unsigned long long int min( unsigned long long int v1, unsigned int v2 ) { return v1 < v2 ? v1 : v2; }74 unsigned long long int min( unsigned long long int v1, unsigned long long int v2 ) { return v1 < v2 ? v1 : v2; } 75 75 forall( T | { int ?<?( T, T ); } ) // generic 76 76 T min( T v1, T v2 ) { return v1 < v2 ? v1 : v2; } -
libcfa/src/concurrency/actor.hfa
r0b0a285 rc84dd61 30 30 #define __DEFAULT_EXECUTOR_BUFSIZE__ 10 31 31 32 #define __STEAL 0// workstealing toggle. Disjoint from toggles above32 #define __STEAL 1 // workstealing toggle. Disjoint from toggles above 33 33 34 34 // workstealing heuristic selection (only set one to be 1) … … 46 46 enum allocation { Nodelete, Delete, Destroy, Finished }; // allocation status 47 47 48 typedef allocation (*__receive_fn)(actor &, message & );48 typedef allocation (*__receive_fn)(actor &, message &, actor **, message **); 49 49 struct request { 50 50 actor * receiver; 51 51 message * msg; 52 52 __receive_fn fn; 53 bool stop;54 53 }; 55 54 56 static inline void ?{}( request & this ) { this.stop = true; } // default ctor makes a sentinel 55 struct a_msg { 56 int m; 57 }; 58 static inline void ?{}( request & this ) {} 57 59 static inline void ?{}( request & this, actor * receiver, message * msg, __receive_fn fn ) { 58 60 this.receiver = receiver; 59 61 this.msg = msg; 60 62 this.fn = fn; 61 this.stop = false;62 63 } 63 64 static inline void ?{}( request & this, request & copy ) { … … 65 66 this.msg = copy.msg; 66 67 this.fn = copy.fn; 67 this.stop = copy.stop;68 68 } 69 69 … … 83 83 last_size = 0; 84 84 } 85 static inline void ^?{}( copy_queue & this ) with(this) { adelete(buffer); } 85 static inline void ^?{}( copy_queue & this ) with(this) { 86 DEBUG_ABORT( count != 0, "Actor system terminated with messages sent but not received\n" ); 87 adelete(buffer); 88 } 86 89 87 90 static inline void insert( copy_queue & this, request & elem ) with(this) { … … 117 120 } 118 121 119 static inline bool is Empty( copy_queue & this ) with(this) { return count == 0; }122 static inline bool is_empty( copy_queue & this ) with(this) { return count == 0; } 120 123 121 124 struct work_queue { … … 178 181 volatile unsigned long long stamp; 179 182 #ifdef ACTOR_STATS 180 size_t stolen_from, try_steal, stolen, failed_swaps, msgs_stolen;183 size_t stolen_from, try_steal, stolen, empty_stolen, failed_swaps, msgs_stolen; 181 184 unsigned long long processed; 182 185 size_t gulps; … … 191 194 this.gulps = 0; // number of gulps 192 195 this.failed_swaps = 0; // steal swap failures 196 this.empty_stolen = 0; // queues empty after steal 193 197 this.msgs_stolen = 0; // number of messages stolen 194 198 #endif … … 210 214 #ifdef ACTOR_STATS 211 215 // aggregate counters for statistics 212 size_t __total_tries = 0, __total_stolen = 0, __total_workers, __all_gulps = 0, 216 size_t __total_tries = 0, __total_stolen = 0, __total_workers, __all_gulps = 0, __total_empty_stolen = 0, 213 217 __total_failed_swaps = 0, __all_processed = 0, __num_actors_stats = 0, __all_msgs_stolen = 0; 214 218 #endif … … 235 239 unsigned int nprocessors, nworkers, nrqueues; // number of processors/threads/request queues 236 240 bool seperate_clus; // use same or separate cluster for executor 241 volatile bool is_shutdown; // flag to communicate shutdown to worker threads 237 242 }; // executor 238 243 … … 248 253 __atomic_add_fetch(&__total_stolen, executor_->w_infos[id].stolen, __ATOMIC_SEQ_CST); 249 254 __atomic_add_fetch(&__total_failed_swaps, executor_->w_infos[id].failed_swaps, __ATOMIC_SEQ_CST); 255 __atomic_add_fetch(&__total_empty_stolen, executor_->w_infos[id].empty_stolen, __ATOMIC_SEQ_CST); 250 256 251 257 // per worker steal stats (uncomment alongside the lock above this routine to print) … … 274 280 this.nrqueues = nrqueues; 275 281 this.seperate_clus = seperate_clus; 282 this.is_shutdown = false; 276 283 277 284 if ( nworkers == nrqueues ) … … 322 329 323 330 static inline void ^?{}( executor & this ) with(this) { 324 #ifdef __STEAL 325 request sentinels[nrqueues]; 326 for ( unsigned int i = 0; i < nrqueues; i++ ) { 327 insert( request_queues[i], sentinels[i] ); // force eventually termination 328 } // for 329 #else 330 request sentinels[nworkers]; 331 unsigned int reqPerWorker = nrqueues / nworkers, extras = nrqueues % nworkers; 332 for ( unsigned int i = 0, step = 0, range; i < nworkers; i += 1, step += range ) { 333 range = reqPerWorker + ( i < extras ? 1 : 0 ); 334 insert( request_queues[step], sentinels[i] ); // force eventually termination 335 } // for 336 #endif 331 is_shutdown = true; 337 332 338 333 for ( i; nworkers ) … … 365 360 size_t avg_gulps = __all_gulps == 0 ? 0 : __all_processed / __all_gulps; 366 361 printf("\tGulps:\t\t\t\t\t%lu\n\tAverage Gulp Size:\t\t\t%lu\n\tMissed gulps:\t\t\t\t%lu\n", __all_gulps, avg_gulps, misses); 367 printf("\tSteal attempts:\t\t\t\t%lu\n\tSteals:\t\t\t\t\t%lu\n\tSteal failures (no candidates):\t\t%lu\n\tSteal failures (failed swaps):\t\t%lu\ n",368 __total_tries, __total_stolen, __total_tries - __total_stolen - __total_failed_swaps, __total_failed_swaps );362 printf("\tSteal attempts:\t\t\t\t%lu\n\tSteals:\t\t\t\t\t%lu\n\tSteal failures (no candidates):\t\t%lu\n\tSteal failures (failed swaps):\t\t%lu\t Empty steals:\t\t%lu\n", 363 __total_tries, __total_stolen, __total_tries - __total_stolen - __total_failed_swaps, __total_failed_swaps, __total_empty_stolen); 369 364 size_t avg_steal = __total_stolen == 0 ? 0 : __all_msgs_stolen / __total_stolen; 370 365 printf("\tMessages stolen:\t\t\t%lu\n\tAverage steal size:\t\t\t%lu\n", __all_msgs_stolen, avg_steal); … … 449 444 static inline void check_message( message & this ) { 450 445 switch ( this.allocation_ ) { // analyze message status 451 case Nodelete: CFA_DEBUG( this.allocation_ = Finished); break;446 case Nodelete: CFA_DEBUG( this.allocation_ = Finished ); break; 452 447 case Delete: delete( &this ); break; 453 case Destroy: ^?{}( this); break;448 case Destroy: ^?{}( this ); break; 454 449 case Finished: break; 455 450 } // switch … … 461 456 static inline void deliver_request( request & this ) { 462 457 DEBUG_ABORT( this.receiver->ticket == (unsigned long int)MAX, "Attempted to send message to deleted/dead actor\n" ); 463 this.receiver->allocation_ = this.fn( *this.receiver, *this.msg ); 464 check_message( *this.msg ); 465 check_actor( *this.receiver ); 458 actor * base_actor; 459 message * base_msg; 460 allocation temp = this.fn( *this.receiver, *this.msg, &base_actor, &base_msg ); 461 base_actor->allocation_ = temp; 462 check_message( *base_msg ); 463 check_actor( *base_actor ); 466 464 } 467 465 … … 513 511 curr_steal_queue = request_queues[ i + vic_start ]; 514 512 // avoid empty queues and queues that are being operated on 515 if ( curr_steal_queue == 0p || curr_steal_queue->being_processed || is Empty( *curr_steal_queue->c_queue ) )513 if ( curr_steal_queue == 0p || curr_steal_queue->being_processed || is_empty( *curr_steal_queue->c_queue ) ) 516 514 continue; 517 515 … … 521 519 executor_->w_infos[id].msgs_stolen += curr_steal_queue->c_queue->count; 522 520 executor_->w_infos[id].stolen++; 521 if ( is_empty( *curr_steal_queue->c_queue ) ) executor_->w_infos[id].empty_stolen++; 523 522 // __atomic_add_fetch(&executor_->w_infos[victim_id].stolen_from, 1, __ATOMIC_RELAXED); 524 523 // replaced_queue[swap_idx]++; … … 560 559 } 561 560 561 #define CHECK_TERMINATION if ( unlikely( executor_->is_shutdown ) ) break Exit 562 562 void main( worker & this ) with(this) { 563 563 // #ifdef ACTOR_STATS … … 581 581 582 582 // check if queue is empty before trying to gulp it 583 if ( is Empty( *curr_work_queue->c_queue ) ) {583 if ( is_empty( *curr_work_queue->c_queue ) ) { 584 584 #ifdef __STEAL 585 585 empty_count++; … … 594 594 #endif // ACTOR_STATS 595 595 #ifdef __STEAL 596 if ( is Empty( *current_queue ) ) {597 if ( unlikely( no_steal ) ) continue;596 if ( is_empty( *current_queue ) ) { 597 if ( unlikely( no_steal ) ) { CHECK_TERMINATION; continue; } 598 598 empty_count++; 599 599 if ( empty_count < steal_threshold ) continue; 600 600 empty_count = 0; 601 602 CHECK_TERMINATION; // check for termination 601 603 602 604 __atomic_store_n( &executor_->w_infos[id].stamp, rdtscl(), __ATOMIC_RELAXED ); … … 610 612 } 611 613 #endif // __STEAL 612 while ( ! is Empty( *current_queue ) ) {614 while ( ! is_empty( *current_queue ) ) { 613 615 #ifdef ACTOR_STATS 614 616 executor_->w_infos[id].processed++; … … 616 618 &req = &remove( *current_queue ); 617 619 if ( !&req ) continue; 618 if ( req.stop ) break Exit;619 620 deliver_request( req ); 620 621 } … … 623 624 empty_count = 0; // we found work so reset empty counter 624 625 #endif 626 627 CHECK_TERMINATION; 625 628 626 629 // potentially reclaim some of the current queue's vector space if it is unused … … 644 647 __all_gulps = 0; 645 648 __total_failed_swaps = 0; 649 __total_empty_stolen = 0; 646 650 __all_processed = 0; 647 651 __num_actors_stats = 0; … … 657 661 } 658 662 659 // TODO: potentially revisit getting number of processors 660 // ( currently the value stored in active_cluster()->procs.total is often stale 661 // and doesn't reflect how many procs are allocated ) 662 // static inline void start_actor_system() { start_actor_system( active_cluster()->procs.total ); } 663 static inline void start_actor_system() { start_actor_system( 1 ); } 663 static inline void start_actor_system() { start_actor_system( get_proc_count( *active_cluster() ) ); } 664 664 665 665 static inline void start_actor_system( executor & this ) { … … 671 671 672 672 static inline void stop_actor_system() { 673 park( ); // will receive signalwhen actor system is finished673 park( ); // will be unparked when actor system is finished 674 674 675 675 if ( !__actor_executor_passed ) delete( __actor_executor_ ); -
libcfa/src/concurrency/atomic.hfa
r0b0a285 rc84dd61 10 10 // Created On : Thu May 25 15:22:46 2023 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 9 13:36:47 202313 // Update Count : 4612 // Last Modified On : Wed Jun 14 07:48:57 2023 13 // Update Count : 52 14 14 // 15 15 … … 35 35 36 36 // #define CAS( assn, comp, replace ) (CASM( assn, comp, replace, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) 37 // #define CASM( assn, comp, replace, memorder... ) ({ \ 38 // typeof(comp) __temp = (comp); \ 39 // __atomic_compare_exchange_n( &(assn), &(__temp), (replace), false, memorder ); \ 40 // }) 37 // #define CASM( assn, comp, replace, memorder... ) ({ typeof(comp) __temp = (comp); __atomic_compare_exchange_n( &(assn), &(__temp), (replace), false, memorder ); }) 41 38 #define CAS( assn, comp, replace ) (__sync_bool_compare_and_swap( &assn, comp, replace)) 42 39 #define CASM( assn, comp, replace, memorder... ) _Static_assert( false, "memory order unsupported for CAS macro" ); -
libcfa/src/concurrency/kernel.hfa
r0b0a285 rc84dd61 195 195 // Total number of processors 196 196 unsigned total; 197 198 // Number of processors constructed 199 // incremented at construction time, total is incremented once the processor asyncronously registers 200 unsigned constructed; 197 201 198 202 // Total number of idle processors … … 297 301 static inline struct cluster * active_cluster () { return publicTLS_get( this_processor )->cltr; } 298 302 303 // gets the number of constructed processors on the cluster 304 static inline unsigned get_proc_count( cluster & this ) { return this.procs.constructed; } 305 299 306 // set the number of internal processors 300 307 // these processors are in addition to any explicitly declared processors -
libcfa/src/concurrency/kernel/cluster.hfa
r0b0a285 rc84dd61 40 40 41 41 // convert to log2 scale but using double 42 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2( intsc); }42 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2((__readyQ_avg_t)intsc); } 43 43 44 44 #define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'" PRId64 "ms \n", old_avg, program()`ms ) -
libcfa/src/concurrency/kernel/startup.cfa
r0b0a285 rc84dd61 528 528 this.name = name; 529 529 this.cltr = &_cltr; 530 __atomic_add_fetch( &_cltr.procs.constructed, 1u, __ATOMIC_RELAXED ); 530 531 this.rdq.its = 0; 531 532 this.rdq.itr = 0; … … 595 596 __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this); 596 597 598 __atomic_sub_fetch( &this.cltr->procs.constructed, 1u, __ATOMIC_RELAXED ); 599 597 600 __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED); 598 601 __disable_interrupts_checked(); … … 615 618 this.fdw = 0p; 616 619 this.idle = 0; 620 this.constructed = 0; 617 621 this.total = 0; 618 622 } -
libcfa/src/concurrency/locks.hfa
r0b0a285 rc84dd61 35 35 #include <linux/futex.h> /* Definition of FUTEX_* constants */ 36 36 #include <sys/syscall.h> /* Definition of SYS_* constants */ 37 #include <unistd.h> 37 #include <unistd.h> /* Definition of syscall routine */ 38 38 39 39 typedef void (*__cfa_pre_park)( void * ); -
libcfa/src/fstream.cfa
r0b0a285 rc84dd61 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 5 22:00:23202313 // Update Count : 5 1812 // Last Modified On : Sat Jun 17 08:51:12 2023 13 // Update Count : 528 14 14 // 15 15 … … 169 169 if ( cnt == 9 ) abort( "ofstream fmt EINTR spinning exceeded" ); 170 170 } // for 171 if ( len == EOF ) { 172 if ( ferror( (FILE *)(os.file$) ) ) { 173 abort | IO_MSG "invalid write"; 174 } // if 171 if ( len == EOF ) { // error writing ? 172 abort | IO_MSG "invalid write"; 175 173 } // if 176 174 va_end( args ); … … 302 300 if ( len != EOF || errno != EINTR ) break; // timer interrupt ? 303 301 } // for 304 if ( len == EOF ) { 305 if ( ferror( (FILE *)(is.file$) ) ) {302 if ( len == EOF ) { // EOF or matching failure ? 303 if ( ! feof( (FILE *)(is.file$) ) && ferror( (FILE *)(is.file$) ) ) { 306 304 abort | IO_MSG "invalid read"; 307 305 } // if -
libcfa/src/iostream.hfa
r0b0a285 rc84dd61 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 2 11:25:39202313 // Update Count : 41 012 // Last Modified On : Thu Jun 15 22:34:31 2023 13 // Update Count : 411 14 14 // 15 15 … … 51 51 int fmt( ostype &, const char format[], ... ) __attribute__(( format(printf, 2, 3) )); 52 52 }; // basic_ostream 53 53 54 54 forall( ostype & | basic_ostream( ostype ) ) 55 55 trait ostream { … … 68 68 69 69 forall( T, ostype & | ostream( ostype ) ) 70 70 trait writeable { 71 71 ostype & ?|?( ostype &, T ); 72 72 }; // writeable … … 161 161 // *********************************** manipulators *********************************** 162 162 163 struct _Ostream_Flags { 164 unsigned char eng:1; // engineering notation 165 unsigned char neg:1; // val is negative 166 unsigned char pc:1; // precision specified 167 unsigned char left:1; // left justify 168 unsigned char nobsdp:1; // base prefix / decimal point 169 unsigned char sign:1; // plus / minus sign 170 unsigned char pad0:1; // zero pad 171 }; 172 163 173 forall( T ) 164 174 struct _Ostream_Manip { … … 168 178 union { 169 179 unsigned char all; 170 struct { 171 unsigned char eng:1; // engineering notation 172 unsigned char neg:1; // val is negative 173 unsigned char pc:1; // precision specified 174 unsigned char left:1; // left justify 175 unsigned char nobsdp:1; // base prefix / decimal point 176 unsigned char sign:1; // plus / minus sign 177 unsigned char pad0:1; // zero pad 178 } flags; 180 _Ostream_Flags flags; 179 181 }; 180 182 }; // _Ostream_Manip -
libcfa/src/math.hfa
r0b0a285 rc84dd61 10 10 // Created On : Mon Apr 18 23:37:04 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Oct 8 08:40:42 202213 // Update Count : 13612 // Last Modified On : Sun Jun 18 08:13:53 2023 13 // Update Count : 202 14 14 // 15 15 … … 236 236 237 237 return (i << 32) + (sum); 238 } 238 } // log2_u32_32 239 239 240 240 //---------------------- Trigonometric ---------------------- … … 371 371 372 372 inline __attribute__((always_inline)) static { 373 signed char floor( signed char n, signed char align ) { return n / align * align; } 374 unsigned char floor( unsigned char n, unsigned char align ) { return n / align * align; } 375 short int floor( short int n, short int align ) { return n / align * align; } 376 unsigned short int floor( unsigned short int n, unsigned short int align ) { return n / align * align; } 377 int floor( int n, int align ) { return n / align * align; } 378 unsigned int floor( unsigned int n, unsigned int align ) { return n / align * align; } 379 long int floor( long int n, long int align ) { return n / align * align; } 380 unsigned long int floor( unsigned long int n, unsigned long int align ) { return n / align * align; } 381 long long int floor( long long int n, long long int align ) { return n / align * align; } 382 unsigned long long int floor( unsigned long long int n, unsigned long long int align ) { return n / align * align; } 373 // force divide before multiply 374 signed char floor( signed char n, signed char align ) { return (n / align) * align; } 375 unsigned char floor( unsigned char n, unsigned char align ) { return (n / align) * align; } 376 short int floor( short int n, short int align ) { return (n / align) * align; } 377 unsigned short int floor( unsigned short int n, unsigned short int align ) { return (n / align) * align; } 378 int floor( int n, int align ) { return (n / align) * align; } 379 unsigned int floor( unsigned int n, unsigned int align ) { return (n / align) * align; } 380 long int floor( long int n, long int align ) { return (n / align) * align; } 381 unsigned long int floor( unsigned long int n, unsigned long int align ) { return (n / align) * align; } 382 long long int floor( long long int n, long long int align ) { return (n / align) * align; } 383 unsigned long long int floor( unsigned long long int n, unsigned long long int align ) { return (n / align) * align; } 383 384 384 385 // forall( T | { T ?/?( T, T ); T ?*?( T, T ); } ) 385 // T floor( T n, T align ) { return n / align * align; } 386 387 signed char ceiling_div( signed char n, char align ) { return (n + (align - 1)) / align; } 388 unsigned char ceiling_div( unsigned char n, unsigned char align ) { return (n + (align - 1)) / align; } 389 short int ceiling_div( short int n, short int align ) { return (n + (align - 1)) / align; } 390 unsigned short int ceiling_div( unsigned short int n, unsigned short int align ) { return (n + (align - 1)) / align; } 391 int ceiling_div( int n, int align ) { return (n + (align - 1)) / align; } 392 unsigned int ceiling_div( unsigned int n, unsigned int align ) { return (n + (align - 1)) / align; } 393 long int ceiling_div( long int n, long int align ) { return (n + (align - 1)) / align; } 394 unsigned long int ceiling_div( unsigned long int n, unsigned long int align ) { return (n + (align - 1)) / align; } 395 long long int ceiling_div( long long int n, long long int align ) { return (n + (align - 1)) / align; } 396 unsigned long long int ceiling_div( unsigned long long int n, unsigned long long int align ) { return (n + (align - 1)) / align; } 397 398 // forall( T | { T ?+?( T, T ); T ?-?( T, T ); T ?%?( T, T ); } ) 399 // T ceiling_div( T n, T align ) { verify( is_pow2( align ) );return (n + (align - 1)) / align; } 400 401 // gcc notices the div/mod pair and saves both so only one div. 402 signed char ceiling( signed char n, signed char align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 403 unsigned char ceiling( unsigned char n, unsigned char align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 404 short int ceiling( short int n, short int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 405 unsigned short int ceiling( unsigned short int n, unsigned short int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 406 int ceiling( int n, int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 407 unsigned int ceiling( unsigned int n, unsigned int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 408 long int ceiling( long int n, long int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 409 unsigned long int ceiling( unsigned long int n, unsigned long int align ) { return floor( n + (n % align != 0 ? align - 1 : 0) , align); } 410 long long int ceiling( long long int n, long long int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 411 unsigned long long int ceiling( unsigned long long int n, unsigned long long int align ) { return floor( n + (n % align != 0 ? align - 1 : 0), align ); } 412 413 // forall( T | { void ?{}( T &, one_t ); T ?+?( T, T ); T ?-?( T, T ); T ?/?( T, T ); } ) 414 // T ceiling( T n, T align ) { return return floor( n + (n % align != 0 ? align - 1 : 0), align ); *} 386 // T floor( T n, T align ) { return (n / align) * align; } 387 388 signed char ceiling_div( signed char n, char align ) { return (n + (align - 1hh)) / align; } 389 unsigned char ceiling_div( unsigned char n, unsigned char align ) { return (n + (align - 1hhu)) / align; } 390 short int ceiling_div( short int n, short int align ) { return (n + (align - 1h)) / align; } 391 unsigned short int ceiling_div( unsigned short int n, unsigned short int align ) { return (n + (align - 1hu)) / align; } 392 int ceiling_div( int n, int align ) { return (n + (align - 1n)) / align; } 393 unsigned int ceiling_div( unsigned int n, unsigned int align ) { return (n + (align - 1nu)) / align; } 394 long int ceiling_div( long int n, long int align ) { return (n + (align - 1l)) / align; } 395 unsigned long int ceiling_div( unsigned long int n, unsigned long int align ) { return (n + (align - 1lu)) / align; } 396 long long int ceiling_div( long long int n, long long int align ) { return (n + (align - 1ll)) / align; } 397 unsigned long long int ceiling_div( unsigned long long int n, unsigned long long int align ) { return (n + (align - 1llu)) / align; } 398 399 signed char ceiling( signed char n, char align ) { 400 typeof(n) trunc = floor( n, align ); 401 return n < 0 || n == trunc ? trunc : trunc + align; 402 } 403 unsigned char ceiling( unsigned char n, unsigned char align ) { 404 typeof(n) trunc = floor( n, align ); 405 return n == trunc ? trunc : trunc + align; 406 } 407 short int ceiling( short int n, short int align ) { 408 typeof(n) trunc = floor( n, align ); 409 return n < 0 || n == trunc ? trunc : trunc + align; 410 } 411 unsigned short int ceiling( unsigned short int n, unsigned short int align ) { 412 typeof(n) trunc = floor( n, align ); 413 return n == trunc ? trunc : trunc + align; 414 } 415 int ceiling( int n, int align ) { 416 typeof(n) trunc = floor( n, align ); 417 return n < 0 || n == trunc ? trunc : trunc + align; 418 } 419 unsigned int ceiling( unsigned int n, unsigned int align ) { 420 typeof(n) trunc = floor( n, align ); 421 return n == trunc ? trunc : trunc + align; 422 } 423 long int ceiling( long int n, long int align ) { 424 typeof(n) trunc = floor( n, align ); 425 return n < 0 || n == trunc ? trunc : trunc + align; 426 } 427 unsigned long int ceiling( unsigned long int n, unsigned long int align ) { 428 typeof(n) trunc = floor( n, align ); 429 return n == trunc ? trunc : trunc + align; 430 } 431 long long int ceiling( long long int n, signed long long int align ) { 432 typeof(n) trunc = floor( n, align ); 433 return n < 0 || n == trunc ? trunc : trunc + align; 434 } 435 unsigned long long int ceiling( unsigned long long int n, unsigned long long int align ) { 436 typeof(n) trunc = floor( n, align ); 437 return n == trunc ? trunc : trunc + align; 438 } 415 439 416 440 float floor( float x ) { return floorf( x ); } -
libcfa/src/stdlib.hfa
r0b0a285 rc84dd61 367 367 368 368 char random( void ) { return (unsigned long int)random(); } 369 char random( char u ) { return random( (unsigned long int)u ); } // [0,u)369 char random( char u ) { return (unsigned long int)random( (unsigned long int)u ); } // [0,u) 370 370 char random( char l, char u ) { return random( (unsigned long int)l, (unsigned long int)u ); } // [l,u) 371 371 int random( void ) { return (long int)random(); } 372 int random( int u ) { return random( (long int)u ); } // [0,u]372 int random( int u ) { return (long int)random( (long int)u ); } // [0,u] 373 373 int random( int l, int u ) { return random( (long int)l, (long int)u ); } // [l,u) 374 374 unsigned int random( void ) { return (unsigned long int)random(); } 375 unsigned int random( unsigned int u ) { return random( (unsigned long int)u ); } // [0,u]375 unsigned int random( unsigned int u ) { return (unsigned long int)random( (unsigned long int)u ); } // [0,u] 376 376 unsigned int random( unsigned int l, unsigned int u ) { return random( (unsigned long int)l, (unsigned long int)u ); } // [l,u) 377 377 } // distribution -
libcfa/src/virtual_dtor.hfa
r0b0a285 rc84dd61 25 25 __virtual_obj_start = &this; 26 26 } 27 static inline void __CFA_dtor_shutdown( virtual_dtor & this ) with(this) { 27 static inline bool __CFA_dtor_shutdown( virtual_dtor & this ) with(this) { 28 if ( __virtual_dtor_ptr == 1p ) return true; // stop base dtors from being called twice 28 29 if ( __virtual_dtor_ptr ) { 29 30 void (*dtor_ptr)(virtual_dtor &) = __virtual_dtor_ptr; 30 31 __virtual_dtor_ptr = 0p; 31 dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // replace actor with base type 32 return; 32 dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // call most derived dtor 33 __virtual_dtor_ptr = 1p; // stop base dtors from being called twice 34 return true; 33 35 } 36 return false; 34 37 } 35 38 static inline void __CFA_virt_free( virtual_dtor & this ) { free( this.__virtual_obj_start ); } -
src/AST/Convert.cpp
r0b0a285 rc84dd61 2343 2343 old->location, 2344 2344 GET_ACCEPT_1(arg, Expr), 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast, 2346 (ast::CastExpr::CastKind) old->kind 2346 2347 ) 2347 2348 ); -
src/AST/Expr.cpp
r0b0a285 rc84dd61 186 186 // --- CastExpr 187 187 188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g )189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ) {}188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g, CastKind kind ) 189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ), kind( kind ) {} 190 190 191 191 bool CastExpr::get_lvalue() const { -
src/AST/Expr.hpp
r0b0a285 rc84dd61 55 55 const Expr * e ) 56 56 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} 57 58 operator bool() {return declptr;} 57 59 }; 58 60 … … 335 337 GeneratedFlag isGenerated; 336 338 339 enum CastKind { 340 Default, // C 341 Coerce, // reinterpret cast 342 Return // overload selection 343 }; 344 345 CastKind kind = Default; 346 337 347 CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, 338 GeneratedFlag g = GeneratedCast ) : Expr( loc, to ), arg( a ), isGenerated( g) {}348 GeneratedFlag g = GeneratedCast, CastKind kind = Default ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind ) {} 339 349 /// Cast-to-void 340 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast );350 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast, CastKind kind = Default ); 341 351 342 352 /// Wrap a cast expression around an existing expression (always generated) -
src/AST/SymbolTable.cpp
r0b0a285 rc84dd61 19 19 20 20 #include "Copy.hpp" 21 #include <iostream> 22 #include <algorithm> 23 21 24 #include "Decl.hpp" 22 25 #include "Expr.hpp" … … 203 206 out.push_back(decl.second); 204 207 } 208 209 // std::cerr << otypeKey << ' ' << out.size() << std::endl; 205 210 } 206 211 -
src/AST/Type.hpp
r0b0a285 rc84dd61 451 451 bool operator==(const TypeEnvKey & other) const; 452 452 bool operator<(const TypeEnvKey & other) const; 453 }; 453 operator bool() {return base;} 454 }; 455 454 456 455 457 /// tuple type e.g. `[int, char]` -
src/AST/TypeEnvironment.cpp
r0b0a285 rc84dd61 135 135 } 136 136 } 137 sub.normalize();137 // sub.normalize(); 138 138 } 139 139 -
src/AST/TypeEnvironment.hpp
r0b0a285 rc84dd61 63 63 64 64 int cmp = d1->var->name.compare( d2->var->name ); 65 return cmp <0 || ( cmp == 0 && d1->result < d2->result );65 return cmp > 0 || ( cmp == 0 && d1->result < d2->result ); 66 66 } 67 67 }; -
src/Concurrency/Actors.cpp
r0b0a285 rc84dd61 223 223 if ( actorIter != actorStructDecls.end() && messageIter != messageStructDecls.end() ) { 224 224 ////////////////////////////////////////////////////////////////////// 225 // The following generates this wrapper for all receive(derived_actor &, derived_msg &) functions 226 /* base_actor and base_msg are output params 227 static inline allocation __CFA_receive_wrap( derived_actor & receiver, derived_msg & msg, actor ** base_actor, message ** base_msg ) { 228 base_actor = &receiver; 229 base_msg = &msg; 230 return receive( receiver, msg ); 231 } 232 */ 233 CompoundStmt * wrapBody = new CompoundStmt( decl->location ); 234 235 // generates: base_actor = &receiver; 236 wrapBody->push_back( new ExprStmt( decl->location, 237 UntypedExpr::createAssign( decl->location, 238 UntypedExpr::createDeref( decl->location, new NameExpr( decl->location, "base_actor" ) ), 239 new AddressExpr( decl->location, new NameExpr( decl->location, "receiver" ) ) 240 ) 241 )); 242 243 // generates: base_msg = &msg; 244 wrapBody->push_back( new ExprStmt( decl->location, 245 UntypedExpr::createAssign( decl->location, 246 UntypedExpr::createDeref( decl->location, new NameExpr( decl->location, "base_msg" ) ), 247 new AddressExpr( decl->location, new NameExpr( decl->location, "msg" ) ) 248 ) 249 )); 250 251 // generates: return receive( receiver, msg ); 252 wrapBody->push_back( new ReturnStmt( decl->location, 253 new UntypedExpr ( decl->location, 254 new NameExpr( decl->location, "receive" ), 255 { 256 new NameExpr( decl->location, "receiver" ), 257 new NameExpr( decl->location, "msg" ) 258 } 259 ) 260 )); 261 262 // create receive wrapper to extract base message and actor pointer 263 // put it all together into the complete function decl from above 264 FunctionDecl * receiveWrapper = new FunctionDecl( 265 decl->location, 266 "__CFA_receive_wrap", 267 {}, // forall 268 { 269 new ObjectDecl( 270 decl->location, 271 "receiver", 272 ast::deepCopy( derivedActorRef ) 273 ), 274 new ObjectDecl( 275 decl->location, 276 "msg", 277 ast::deepCopy( derivedMsgRef ) 278 ), 279 new ObjectDecl( 280 decl->location, 281 "base_actor", 282 new PointerType( new PointerType( new StructInstType( *actorDecl ) ) ) 283 ), 284 new ObjectDecl( 285 decl->location, 286 "base_msg", 287 new PointerType( new PointerType( new StructInstType( *msgDecl ) ) ) 288 ) 289 }, // params 290 { 291 new ObjectDecl( 292 decl->location, 293 "__CFA_receive_wrap_ret", 294 new EnumInstType( *allocationDecl ) 295 ) 296 }, 297 wrapBody, // body 298 { Storage::Static }, // storage 299 Linkage::Cforall, // linkage 300 {}, // attributes 301 { Function::Inline } 302 ); 303 304 declsToAddAfter.push_back( receiveWrapper ); 305 306 ////////////////////////////////////////////////////////////////////// 225 307 // The following generates this send message operator routine for all receive(derived_actor &, derived_msg &) functions 226 308 /* … … 246 328 )); 247 329 248 // Function type is: allocation (*)( derived_actor &, derived_msg & )330 // Function type is: allocation (*)( derived_actor &, derived_msg &, actor **, message ** ) 249 331 FunctionType * derivedReceive = new FunctionType(); 250 332 derivedReceive->params.push_back( ast::deepCopy( derivedActorRef ) ); 251 333 derivedReceive->params.push_back( ast::deepCopy( derivedMsgRef ) ); 334 derivedReceive->params.push_back( new PointerType( new PointerType( new StructInstType( *actorDecl ) ) ) ); 335 derivedReceive->params.push_back( new PointerType( new PointerType( new StructInstType( *msgDecl ) ) ) ); 252 336 derivedReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 253 337 254 // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;338 // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg &, actor **, message ** ) = receive; 255 339 sendBody->push_back( new DeclStmt( 256 340 decl->location, … … 259 343 "my_work_fn", 260 344 new PointerType( derivedReceive ), 261 new SingleInit( decl->location, new NameExpr( decl->location, " receive" ) )345 new SingleInit( decl->location, new NameExpr( decl->location, "__CFA_receive_wrap" ) ) 262 346 ) 263 347 )); … … 267 351 genericReceive->params.push_back( new ReferenceType( new StructInstType( *actorDecl ) ) ); 268 352 genericReceive->params.push_back( new ReferenceType( new StructInstType( *msgDecl ) ) ); 353 genericReceive->params.push_back( new PointerType( new PointerType( new StructInstType( *actorDecl ) ) ) ); 354 genericReceive->params.push_back( new PointerType( new PointerType( new StructInstType( *msgDecl ) ) ) ); 269 355 genericReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 270 356 … … 285 371 )); 286 372 287 // Generates: new_req{ &receiver,&msg, fn };373 // Generates: new_req{ (actor *)&receiver, (message *)&msg, fn }; 288 374 sendBody->push_back( new ExprStmt( 289 375 decl->location, … … 293 379 { 294 380 new NameExpr( decl->location, "new_req" ), 295 new AddressExpr( new NameExpr( decl->location, "receiver" )),296 new AddressExpr( new NameExpr( decl->location, "msg" )),381 new CastExpr( decl->location, new AddressExpr( new NameExpr( decl->location, "receiver" ) ), new PointerType( new StructInstType( *actorDecl ) ), ExplicitCast ), 382 new CastExpr( decl->location, new AddressExpr( new NameExpr( decl->location, "msg" ) ), new PointerType( new StructInstType( *msgDecl ) ), ExplicitCast ), 297 383 new NameExpr( decl->location, "fn" ) 298 384 } … … 321 407 FunctionDecl * sendOperatorFunction = new FunctionDecl( 322 408 decl->location, 323 "? <<?",409 "?|?", 324 410 {}, // forall 325 411 { -
src/GenPoly/SpecializeNew.cpp
r0b0a285 rc84dd61 113 113 using namespace ResolvExpr; 114 114 ast::OpenVarSet openVars, closedVars; 115 ast::AssertionSet need, have; 116 findOpenVars( formalType, openVars, closedVars, need, have, FirstClosed ); 117 findOpenVars( actualType, openVars, closedVars, need, have, FirstOpen ); 115 ast::AssertionSet need, have; // unused 116 ast::TypeEnvironment env; // unused 117 // findOpenVars( formalType, openVars, closedVars, need, have, FirstClosed ); 118 findOpenVars( actualType, openVars, closedVars, need, have, env, FirstOpen ); 118 119 for ( const ast::OpenVarSet::value_type & openVar : openVars ) { 119 120 const ast::Type * boundType = subs->lookup( openVar.first ); … … 125 126 if ( closedVars.find( *inst ) == closedVars.end() ) { 126 127 return true; 128 } 129 else { 130 assertf(false, "closed: %s", inst->name.c_str()); 127 131 } 128 132 // Otherwise, the variable is bound to a concrete type. -
src/Parser/DeclarationNode.cc
r0b0a285 rc84dd61 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Apr 20 11:46:00202313 // Update Count : 1 39311 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 14:41:48 2023 13 // Update Count : 1405 14 14 // 15 15 … … 459 459 std::vector<ast::ptr<ast::Expr>> exprs; 460 460 buildList( expr, exprs ); 461 newnode->attributes.push_back( 462 new ast::Attribute( *name, std::move( exprs ) ) ); 461 newnode->attributes.push_back( new ast::Attribute( *name, std::move( exprs ) ) ); 463 462 delete name; 464 463 return newnode; … … 633 632 dst->basictype = src->basictype; 634 633 } else if ( src->basictype != DeclarationNode::NoBasicType ) 635 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 634 SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::basicTypeNames[ dst->basictype ] + 635 "\" and \"" + DeclarationNode::basicTypeNames[ src->basictype ] + "\"." ); 636 636 637 637 if ( dst->complextype == DeclarationNode::NoComplexType ) { 638 638 dst->complextype = src->complextype; 639 639 } else if ( src->complextype != DeclarationNode::NoComplexType ) 640 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 640 SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::complexTypeNames[ src->complextype ] + 641 "\" and \"" + DeclarationNode::complexTypeNames[ src->complextype ] + "\"." ); 641 642 642 643 if ( dst->signedness == DeclarationNode::NoSignedness ) { 643 644 dst->signedness = src->signedness; 644 645 } else if ( src->signedness != DeclarationNode::NoSignedness ) 645 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 646 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::signednessNames[ dst->signedness ] + 647 "\" and \"" + DeclarationNode::signednessNames[ src->signedness ] + "\"." ); 646 648 647 649 if ( dst->length == DeclarationNode::NoLength ) { … … 650 652 dst->length = DeclarationNode::LongLong; 651 653 } else if ( src->length != DeclarationNode::NoLength ) 652 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 654 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::lengthNames[ dst->length ] + 655 "\" and \"" + DeclarationNode::lengthNames[ src->length ] + "\"." ); 653 656 } // if 654 657 break; … … 718 721 719 722 DeclarationNode * DeclarationNode::addEnumBase( DeclarationNode * o ) { 720 if ( o && o ->type) {723 if ( o && o->type) { 721 724 type->base= o->type; 722 } 725 } // if 723 726 delete o; 724 727 return this; … … 1003 1006 } 1004 1007 1005 // If a typedef wraps an anonymous declaration, name the inner declaration 1006 // so it has a consistent name acrosstranslation units.1008 // If a typedef wraps an anonymous declaration, name the inner declaration so it has a consistent name across 1009 // translation units. 1007 1010 static void nameTypedefedDecl( 1008 1011 DeclarationNode * innerDecl, … … 1085 1088 } 1086 1089 1087 void buildList( DeclarationNode * firstNode, 1088 std::vector<ast::ptr<ast::Decl>> & outputList ) { 1090 void buildList( DeclarationNode * firstNode, std::vector<ast::ptr<ast::Decl>> & outputList ) { 1089 1091 SemanticErrorException errors; 1090 1092 std::back_insert_iterator<std::vector<ast::ptr<ast::Decl>>> out( outputList ); -
src/Parser/ExpressionNode.cc
r0b0a285 rc84dd61 601 601 ast::Expr * build_cast( const CodeLocation & location, 602 602 DeclarationNode * decl_node, 603 ExpressionNode * expr_node ) { 603 ExpressionNode * expr_node, 604 ast::CastExpr::CastKind kind ) { 604 605 ast::Type * targetType = maybeMoveBuildType( decl_node ); 605 606 if ( dynamic_cast<ast::VoidType *>( targetType ) ) { … … 607 608 return new ast::CastExpr( location, 608 609 maybeMoveBuild( expr_node ), 609 ast::ExplicitCast );610 ast::ExplicitCast, kind ); 610 611 } else { 611 612 return new ast::CastExpr( location, 612 613 maybeMoveBuild( expr_node ), 613 614 targetType, 614 ast::ExplicitCast );615 ast::ExplicitCast, kind ); 615 616 } // if 616 617 } // build_cast -
src/Parser/ExpressionNode.h
r0b0a285 rc84dd61 69 69 ast::DimensionExpr * build_dimensionref( const CodeLocation &, const std::string * name ); 70 70 71 ast::Expr * build_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node );71 ast::Expr * build_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node, ast::CastExpr::CastKind kind = ast::CastExpr::Default ); 72 72 ast::Expr * build_keyword_cast( const CodeLocation &, ast::AggregateDecl::Aggregate target, ExpressionNode * expr_node ); 73 73 ast::Expr * build_virtual_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node ); -
src/Parser/parser.yy
r0b0a285 rc84dd61 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 7 14:32:28202313 // Update Count : 634 112 // Last Modified On : Sat Jun 17 18:53:24 2023 13 // Update Count : 6347 14 14 // 15 15 … … 931 931 { $$ = new ExpressionNode( new ast::VirtualCastExpr( yylloc, maybeMoveBuild( $5 ), maybeMoveBuildType( $3 ) ) ); } 932 932 | '(' RETURN type_no_function ')' cast_expression // CFA 933 { SemanticError( yylloc, "Return cast is currently unimplemented." ); $$ = nullptr; }933 { $$ = new ExpressionNode( build_cast( yylloc, $3, $5, ast::CastExpr::Return ) ); } 934 934 | '(' COERCE type_no_function ')' cast_expression // CFA 935 935 { SemanticError( yylloc, "Coerce cast is currently unimplemented." ); $$ = nullptr; } … … 1040 1040 // FIX ME: computes $1 twice 1041 1041 | logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand 1042 { $$ = new ExpressionNode( build_cond( yylloc, $1, $1 , $4 ) ); }1042 { $$ = new ExpressionNode( build_cond( yylloc, $1, $1->clone(), $4 ) ); } 1043 1043 ; 1044 1044 -
src/ResolvExpr/Candidate.hpp
r0b0a285 rc84dd61 91 91 92 92 /// Holdover behaviour from old `findMinCost` -- xxx -- can maybe be eliminated? 93 /* 93 94 static inline void promoteCvtCost( CandidateList & candidates ) { 94 95 for ( CandidateRef & r : candidates ) { … … 96 97 } 97 98 } 99 */ 98 100 99 101 void print( std::ostream & os, const Candidate & cand, Indenter indent = {} ); -
src/ResolvExpr/CandidateFinder.cpp
r0b0a285 rc84dd61 38 38 #include "typeops.h" // for combos 39 39 #include "Unify.h" 40 #include "WidenMode.h" 40 41 #include "AST/Expr.hpp" 41 42 #include "AST/Node.hpp" … … 749 750 // attempt to narrow based on expected target type 750 751 const ast::Type * returnType = funcType->returns.front(); 751 if ( ! unify( 752 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen ) 753 ) { 754 // unification failed, do not pursue this candidate 755 return; 752 if ( selfFinder.strictMode ) { 753 if ( ! unifyExact( 754 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen, noWiden() ) // xxx - is no widening correct? 755 ) { 756 // unification failed, do not pursue this candidate 757 return; 758 } 759 } 760 else { 761 if ( ! unify( 762 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen ) 763 ) { 764 // unification failed, do not pursue this candidate 765 return; 766 } 756 767 } 757 768 } … … 771 782 for (size_t i=0; i<nParams; ++i) { 772 783 auto obj = funcDecl->params[i].strict_as<ast::ObjectDecl>(); 773 if ( !instantiateArgument( location,784 if ( !instantiateArgument( location, 774 785 funcType->params[i], obj->init, args, results, genStart, symtab)) return; 775 786 } … … 781 792 // matches 782 793 // no default args for indirect calls 783 if ( ! 794 if ( !instantiateArgument( location, 784 795 param, nullptr, args, results, genStart, symtab ) ) return; 785 796 } … … 874 885 875 886 if ( auto structInst = aggrExpr->result.as< ast::StructInstType >() ) { 876 addAggMembers( structInst, aggrExpr, *cand, Cost:: safe, "" );887 addAggMembers( structInst, aggrExpr, *cand, Cost::unsafe, "" ); 877 888 } else if ( auto unionInst = aggrExpr->result.as< ast::UnionInstType >() ) { 878 addAggMembers( unionInst, aggrExpr, *cand, Cost:: safe, "" );889 addAggMembers( unionInst, aggrExpr, *cand, Cost::unsafe, "" ); 879 890 } 880 891 } … … 1007 1018 if ( auto pointer = dynamic_cast< const ast::PointerType * >( funcResult ) ) { 1008 1019 if ( auto function = pointer->base.as< ast::FunctionType >() ) { 1020 // if (!selfFinder.allowVoid && function->returns.empty()) continue; 1009 1021 CandidateRef newFunc{ new Candidate{ *func } }; 1010 1022 newFunc->expr = … … 1018 1030 if ( const ast::EqvClass * clz = func->env.lookup( *inst ) ) { 1019 1031 if ( auto function = clz->bound.as< ast::FunctionType >() ) { 1020 CandidateRef newFunc { new Candidate{ *func } };1032 CandidateRef newFunc( new Candidate( *func ) ); 1021 1033 newFunc->expr = 1022 1034 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); … … 1060 1072 if ( found.empty() && ! errors.isEmpty() ) { throw errors; } 1061 1073 1074 // only keep the best matching intrinsic result to match C semantics (no unexpected narrowing/widening) 1075 // TODO: keep one for each set of argument candidates? 1076 Cost intrinsicCost = Cost::infinity; 1077 CandidateList intrinsicResult; 1078 1062 1079 // Compute conversion costs 1063 1080 for ( CandidateRef & withFunc : found ) { … … 1082 1099 if ( cvtCost != Cost::infinity ) { 1083 1100 withFunc->cvtCost = cvtCost; 1084 candidates.emplace_back( std::move( withFunc ) ); 1085 } 1086 } 1101 withFunc->cost += cvtCost; 1102 auto func = withFunc->expr.strict_as<ast::ApplicationExpr>()->func.as<ast::VariableExpr>(); 1103 if (func && func->var->linkage == ast::Linkage::Intrinsic) { 1104 if (withFunc->cost < intrinsicCost) { 1105 intrinsicResult.clear(); 1106 intrinsicCost = withFunc->cost; 1107 } 1108 if (withFunc->cost == intrinsicCost) { 1109 intrinsicResult.emplace_back(std::move(withFunc)); 1110 } 1111 } 1112 else { 1113 candidates.emplace_back( std::move( withFunc ) ); 1114 } 1115 } 1116 } 1117 spliceBegin( candidates, intrinsicResult ); 1087 1118 found = std::move( candidates ); 1088 1119 1089 1120 // use a new list so that candidates are not examined by addAnonConversions twice 1090 CandidateList winners = findMinCost( found );1091 promoteCvtCost( winners );1121 // CandidateList winners = findMinCost( found ); 1122 // promoteCvtCost( winners ); 1092 1123 1093 1124 // function may return a struct/union value, in which case we need to add candidates 1094 1125 // for implicit conversions to each of the anonymous members, which must happen after 1095 1126 // `findMinCost`, since anon conversions are never the cheapest 1096 for ( const CandidateRef & c : winners) {1127 for ( const CandidateRef & c : found ) { 1097 1128 addAnonConversions( c ); 1098 1129 } 1099 spliceBegin( candidates, winners ); 1100 1101 if ( candidates.empty() && targetType && ! targetType->isVoid() ) { 1130 // would this be too slow when we don't check cost anymore? 1131 spliceBegin( candidates, found ); 1132 1133 if ( candidates.empty() && targetType && ! targetType->isVoid() && !selfFinder.strictMode ) { 1102 1134 // If resolution is unsuccessful with a target type, try again without, since it 1103 1135 // will sometimes succeed when it wouldn't with a target type binding. … … 1140 1172 1141 1173 CandidateFinder finder( context, tenv, toType ); 1174 if (toType->isVoid()) { 1175 finder.allowVoid = true; 1176 } 1177 if ( castExpr->kind == ast::CastExpr::Return ) { 1178 finder.strictMode = true; 1179 finder.find( castExpr->arg, ResolvMode::withAdjustment() ); 1180 1181 // return casts are eliminated (merely selecting an overload, no actual operation) 1182 candidates = std::move(finder.candidates); 1183 } 1142 1184 finder.find( castExpr->arg, ResolvMode::withAdjustment() ); 1143 1185 … … 1145 1187 1146 1188 CandidateList matches; 1189 Cost minExprCost = Cost::infinity; 1190 Cost minCastCost = Cost::infinity; 1147 1191 for ( CandidateRef & cand : finder.candidates ) { 1148 1192 ast::AssertionSet need( cand->need.begin(), cand->need.end() ), have; … … 1176 1220 // count one safe conversion for each value that is thrown away 1177 1221 thisCost.incSafe( discardedValues ); 1178 CandidateRef newCand = std::make_shared<Candidate>( 1179 restructureCast( cand->expr, toType, castExpr->isGenerated ), 1180 copy( cand->env ), std::move( open ), std::move( need ), cand->cost, 1181 cand->cost + thisCost ); 1182 inferParameters( newCand, matches ); 1183 } 1184 } 1185 1186 // select first on argument cost, then conversion cost 1187 CandidateList minArgCost = findMinCost( matches ); 1188 promoteCvtCost( minArgCost ); 1189 candidates = findMinCost( minArgCost ); 1222 // select first on argument cost, then conversion cost 1223 if ( cand->cost < minExprCost || ( cand->cost == minExprCost && thisCost < minCastCost ) ) { 1224 minExprCost = cand->cost; 1225 minCastCost = thisCost; 1226 matches.clear(); 1227 1228 1229 } 1230 // ambiguous case, still output candidates to print in error message 1231 if ( cand->cost == minExprCost && thisCost == minCastCost ) { 1232 CandidateRef newCand = std::make_shared<Candidate>( 1233 restructureCast( cand->expr, toType, castExpr->isGenerated ), 1234 copy( cand->env ), std::move( open ), std::move( need ), cand->cost + thisCost); 1235 // currently assertions are always resolved immediately so this should have no effect. 1236 // if this somehow changes in the future (e.g. delayed by indeterminate return type) 1237 // we may need to revisit the logic. 1238 inferParameters( newCand, matches ); 1239 } 1240 // else skip, better alternatives found 1241 1242 } 1243 } 1244 candidates = std::move(matches); 1245 1246 //CandidateList minArgCost = findMinCost( matches ); 1247 //promoteCvtCost( minArgCost ); 1248 //candidates = findMinCost( minArgCost ); 1190 1249 } 1191 1250 … … 1453 1512 // candidates for true result 1454 1513 CandidateFinder finder2( context, tenv ); 1514 finder2.allowVoid = true; 1455 1515 finder2.find( conditionalExpr->arg2, ResolvMode::withAdjustment() ); 1456 1516 if ( finder2.candidates.empty() ) return; … … 1458 1518 // candidates for false result 1459 1519 CandidateFinder finder3( context, tenv ); 1520 finder3.allowVoid = true; 1460 1521 finder3.find( conditionalExpr->arg3, ResolvMode::withAdjustment() ); 1461 1522 if ( finder3.candidates.empty() ) return; … … 1524 1585 void Finder::postvisit( const ast::ConstructorExpr * ctorExpr ) { 1525 1586 CandidateFinder finder( context, tenv ); 1587 finder.allowVoid = true; 1526 1588 finder.find( ctorExpr->callExpr, ResolvMode::withoutPrune() ); 1527 1589 for ( CandidateRef & r : finder.candidates ) { … … 1640 1702 CandidateFinder finder( context, tenv, toType ); 1641 1703 finder.find( initExpr->expr, ResolvMode::withAdjustment() ); 1704 1705 Cost minExprCost = Cost::infinity; 1706 Cost minCastCost = Cost::infinity; 1642 1707 for ( CandidateRef & cand : finder.candidates ) { 1643 1708 if (reason.code == NotFound) reason.code = NoMatch; … … 1677 1742 // count one safe conversion for each value that is thrown away 1678 1743 thisCost.incSafe( discardedValues ); 1679 CandidateRef newCand = std::make_shared<Candidate>( 1680 new ast::InitExpr{ 1681 initExpr->location, restructureCast( cand->expr, toType ), 1682 initAlt.designation }, 1683 std::move(env), std::move( open ), std::move( need ), cand->cost, thisCost ); 1684 inferParameters( newCand, matches ); 1744 if ( cand->cost < minExprCost || ( cand->cost == minExprCost && thisCost < minCastCost ) ) { 1745 minExprCost = cand->cost; 1746 minCastCost = thisCost; 1747 matches.clear(); 1748 } 1749 // ambiguous case, still output candidates to print in error message 1750 if ( cand->cost == minExprCost && thisCost == minCastCost ) { 1751 CandidateRef newCand = std::make_shared<Candidate>( 1752 new ast::InitExpr{ 1753 initExpr->location, 1754 restructureCast( cand->expr, toType ), 1755 initAlt.designation }, 1756 std::move(env), std::move( open ), std::move( need ), cand->cost + thisCost ); 1757 // currently assertions are always resolved immediately so this should have no effect. 1758 // if this somehow changes in the future (e.g. delayed by indeterminate return type) 1759 // we may need to revisit the logic. 1760 inferParameters( newCand, matches ); 1761 } 1685 1762 } 1686 1763 } … … 1688 1765 1689 1766 // select first on argument cost, then conversion cost 1690 CandidateList minArgCost = findMinCost( matches ); 1691 promoteCvtCost( minArgCost ); 1692 candidates = findMinCost( minArgCost ); 1767 // CandidateList minArgCost = findMinCost( matches ); 1768 // promoteCvtCost( minArgCost ); 1769 // candidates = findMinCost( minArgCost ); 1770 candidates = std::move(matches); 1693 1771 } 1694 1772 … … 1756 1834 auto found = selected.find( mangleName ); 1757 1835 if ( found != selected.end() ) { 1758 if ( newCand->cost < found->second.candidate->cost ) { 1836 // tiebreaking by picking the lower cost on CURRENT expression 1837 // NOTE: this behavior is different from C semantics. 1838 // Specific remediations are performed for C operators at postvisit(UntypedExpr). 1839 // Further investigations may take place. 1840 if ( newCand->cost < found->second.candidate->cost 1841 || (newCand->cost == found->second.candidate->cost && newCand->cvtCost < found->second.candidate->cvtCost) ) { 1759 1842 PRINT( 1760 1843 std::cerr << "cost " << newCand->cost << " beats " … … 1763 1846 1764 1847 found->second = PruneStruct{ newCand }; 1765 } else if ( newCand->cost == found->second.candidate->cost ) {1848 } else if ( newCand->cost == found->second.candidate->cost && newCand->cvtCost == found->second.candidate->cvtCost ) { 1766 1849 // if one of the candidates contains a deleted identifier, can pick the other, 1767 1850 // since deleted expressions should not be ambiguous if there is another option … … 1854 1937 */ 1855 1938 1856 if ( mode.prune ) { 1939 // optimization: don't prune for NameExpr since it never has cost 1940 if ( mode.prune && !dynamic_cast<const ast::NameExpr *>(expr) ) { 1857 1941 // trim candidates to single best one 1858 1942 PRINT( -
src/ResolvExpr/CandidateFinder.hpp
r0b0a285 rc84dd61 33 33 const ast::TypeEnvironment & env; ///< Substitutions performed in this resolution 34 34 ast::ptr< ast::Type > targetType; ///< Target type for resolution 35 bool strictMode = false; ///< If set to true, requires targetType to be exact match (inside return cast) 36 bool allowVoid = false; ///< If set to true, allow void-returning function calls (only top level, cast to void and first in comma) 35 37 std::set< std::string > otypeKeys; /// different type may map to same key 36 38 -
src/ResolvExpr/CastCost.cc
r0b0a285 rc84dd61 234 234 if ( typesCompatibleIgnoreQualifiers( src, dst, env ) ) { 235 235 PRINT( std::cerr << "compatible!" << std::endl; ) 236 if (dynamic_cast<const ast::ZeroType *>(dst) || dynamic_cast<const ast::OneType *>(dst)) { 237 return Cost::spec; 238 } 236 239 return Cost::zero; 237 240 } else if ( dynamic_cast< const ast::VoidType * >( dst ) ) { -
src/ResolvExpr/CommonType.cc
r0b0a285 rc84dd61 697 697 if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) { 698 698 #warning remove casts when `commonTypes` moved to new AST 699 700 /* 699 701 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ]; 700 702 if ( … … 706 708 result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers }; 707 709 } 710 */ 711 ast::BasicType::Kind kind; 712 if (basic->kind != basic2->kind && !widen.first && !widen.second) return; 713 else if (!widen.first) kind = basic->kind; // widen.second 714 else if (!widen.second) kind = basic2->kind; 715 else kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ]; 716 // xxx - what does qualifiers even do here?? 717 if ( (basic->qualifiers >= basic2->qualifiers || widen.first) 718 && (basic->qualifiers <= basic2->qualifiers || widen.second) ) { 719 result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers }; 720 } 721 708 722 } else if ( 709 723 dynamic_cast< const ast::ZeroType * >( type2 ) … … 712 726 #warning remove casts when `commonTypes` moved to new AST 713 727 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ]; 714 if ( 715 ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) 728 /* 729 if ( // xxx - what does qualifier even do here?? 730 ( ( basic->qualifiers >= type2->qualifiers ) 716 731 || widen.first ) 717 && ( (kind != basic->kind && basic->qualifiers <= type2->qualifiers )732 && ( ( /* kind != basic->kind && basic->qualifiers <= type2->qualifiers ) 718 733 || widen.second ) 719 ) { 720 result = new ast::BasicType{ kind, basic->qualifiers | type2->qualifiers }; 734 ) 735 */ 736 if (widen.second) { 737 result = new ast::BasicType{ basic->kind, basic->qualifiers | type2->qualifiers }; 721 738 } 722 739 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) { … … 746 763 auto entry = open.find( *var ); 747 764 if ( entry != open.end() ) { 765 // if (tenv.lookup(*var)) { 748 766 ast::AssertionSet need, have; 749 767 if ( ! tenv.bindVar( -
src/ResolvExpr/ConversionCost.cc
r0b0a285 rc84dd61 702 702 703 703 cost = costCalc( refType->base, dst, srcIsLvalue, symtab, env ); 704 705 // xxx - should qualifiers be considered in pass-by-value? 706 /* 704 707 if ( refType->base->qualifiers == dst->qualifiers ) { 705 708 cost.incReference(); … … 709 712 cost.incUnsafe(); 710 713 } 714 */ 715 cost.incReference(); 711 716 } 712 717 … … 792 797 cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] ); 793 798 } 799 // this has the effect of letting any expr such as x+0, x+1 to be typed 800 // the same as x, instead of at least int. are we willing to sacrifice this little 801 // bit of coherence with C? 802 // TODO: currently this does not work when no zero/one overloads exist. Find a fix for it. 803 // cost = Cost::zero; 794 804 } else if ( dynamic_cast< const ast::PointerType * >( dst ) ) { 795 805 cost = Cost::zero; 796 806 // +1 for zero_t ->, +1 for disambiguation 797 807 cost.incSafe( maxIntCost + 2 ); 808 // assuming 0p is supposed to be used for pointers? 798 809 } 799 810 } … … 804 815 cost = Cost::zero; 805 816 } else if ( const ast::BasicType * dstAsBasic = 806 dynamic_cast< const ast::BasicType * >( dst ) ) { 817 dynamic_cast< const ast::BasicType * >( dst ) ) { 807 818 int tableResult = costMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ]; 808 819 if ( -1 == tableResult ) { … … 813 824 cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] ); 814 825 } 826 827 // cost = Cost::zero; 815 828 } 816 829 } -
src/ResolvExpr/FindOpenVars.cc
r0b0a285 rc84dd61 21 21 #include "AST/Pass.hpp" 22 22 #include "AST/Type.hpp" 23 #include "AST/TypeEnvironment.hpp" 23 24 #include "Common/PassVisitor.h" 24 25 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType (ptr ... 25 26 #include "SynTree/Type.h" // for Type, Type::ForallList, ArrayType 27 28 #include <iostream> 26 29 27 30 namespace ResolvExpr { … … 102 105 ast::AssertionSet & need; 103 106 ast::AssertionSet & have; 107 ast::TypeEnvironment & env; 104 108 bool nextIsOpen; 105 109 106 110 FindOpenVars_new( 107 111 ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n, 108 ast::AssertionSet & h, FirstMode firstIsOpen )109 : open( o ), closed( c ), need( n ), have( h ), nextIsOpen( firstIsOpen ) {}112 ast::AssertionSet & h, ast::TypeEnvironment & env, FirstMode firstIsOpen ) 113 : open( o ), closed( c ), need( n ), have( h ), env (env), nextIsOpen( firstIsOpen ) {} 110 114 111 115 void previsit( const ast::FunctionType * type ) { 112 116 // mark open/closed variables 113 117 if ( nextIsOpen ) { 118 // trying to remove this from resolver. 119 // occasionally used in other parts so not deleting right now. 120 121 // insert open variables unbound to environment. 122 env.add(type->forall); 123 114 124 for ( auto & decl : type->forall ) { 115 125 open[ *decl ] = ast::TypeData{ decl->base }; … … 137 147 void findOpenVars( 138 148 const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 139 ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen ) {140 ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, firstIsOpen };149 ast::AssertionSet & need, ast::AssertionSet & have, ast::TypeEnvironment & env, FirstMode firstIsOpen ) { 150 ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, env, firstIsOpen }; 141 151 type->accept( finder ); 152 153 if (!closed.empty()) { 154 std::cerr << "closed: "; 155 for (auto& i : closed) { 156 std::cerr << i.first.base->location << ":" << i.first.base->name << ' '; 157 } 158 std::cerr << std::endl; 159 } 142 160 } 143 161 } // namespace ResolvExpr -
src/ResolvExpr/FindOpenVars.h
r0b0a285 rc84dd61 33 33 void findOpenVars( 34 34 const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 35 ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen );35 ast::AssertionSet & need, ast::AssertionSet & have, ast::TypeEnvironment & env, FirstMode firstIsOpen ); 36 36 } // namespace ResolvExpr 37 37 -
src/ResolvExpr/Resolver.cc
r0b0a285 rc84dd61 1011 1011 ast::TypeEnvironment env; 1012 1012 CandidateFinder finder( context, env ); 1013 finder.allowVoid = true; 1013 1014 finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode ); 1014 1015 --recursion_level; … … 1054 1055 1055 1056 // promote candidate.cvtCost to .cost 1056 promoteCvtCost( winners );1057 // promoteCvtCost( winners ); 1057 1058 1058 1059 // produce ambiguous errors, if applicable -
src/ResolvExpr/SatisfyAssertions.cpp
r0b0a285 rc84dd61 16 16 #include "SatisfyAssertions.hpp" 17 17 18 #include <iostream> 18 19 #include <algorithm> 19 20 #include <cassert> … … 45 46 #include "SymTab/Mangler.h" 46 47 48 49 47 50 namespace ResolvExpr { 48 51 … … 65 68 ast::AssertionSet && h, ast::AssertionSet && n, ast::OpenVarSet && o, ast::UniqueId rs ) 66 69 : cdata( c ), adjType( at ), env( std::move( e ) ), have( std::move( h ) ), 67 need( std::move( n ) ), open( std::move( o ) ), resnSlot( rs ) {} 70 need( std::move( n ) ), open( std::move( o ) ), resnSlot( rs ) { 71 if (!have.empty()) { 72 // std::cerr << c.id->location << ':' << c.id->name << std::endl; // I think this was debugging code so I commented it 73 } 74 } 68 75 }; 69 76 … … 139 146 }; 140 147 141 /// Adds a captured assertion to the symbol table 142 void addToSymbolTable( const ast::AssertionSet & have, ast::SymbolTable & symtab ) { 143 for ( auto & i : have ) { 144 if ( i.second.isUsed ) { symtab.addId( i.first->var ); } 145 } 146 } 148 enum AssertionResult {Fail, Skip, Success} ; 147 149 148 150 /// Binds a single assertion, updating satisfaction state … … 155 157 "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() ); 156 158 157 ast::Expr * varExpr = match.cdata.combine( cand->expr->location, cand->c vtCost );159 ast::Expr * varExpr = match.cdata.combine( cand->expr->location, cand->cost ); 158 160 varExpr->result = match.adjType; 159 161 if ( match.resnSlot ) { varExpr->inferred.resnSlots().emplace_back( match.resnSlot ); } … … 165 167 166 168 /// Satisfy a single assertion 167 bool satisfyAssertion( ast::AssertionList::value_type & assn, SatState & sat, bool allowConversion = false, bool skipUnbound = false) {169 AssertionResult satisfyAssertion( ast::AssertionList::value_type & assn, SatState & sat, bool skipUnbound = false) { 168 170 // skip unused assertions 169 if ( ! assn.second.isUsed ) return true; 171 // static unsigned int cnt = 0; // I think this was debugging code so I commented it 172 if ( ! assn.second.isUsed ) return AssertionResult::Success; 173 174 // if (assn.first->var->name[1] == '|') std::cerr << ++cnt << std::endl; // I think this was debugging code so I commented it 170 175 171 176 // find candidates that unify with the desired type 172 AssnCandidateList matches ;177 AssnCandidateList matches, inexactMatches; 173 178 174 179 std::vector<ast::SymbolTable::IdData> candidates; … … 179 184 .strict_as<ast::FunctionType>()->params[0] 180 185 .strict_as<ast::ReferenceType>()->base; 181 sat.cand->env.apply(thisArgType); 186 // sat.cand->env.apply(thisArgType); 187 188 if (auto inst = thisArgType.as<ast::TypeInstType>()) { 189 auto cls = sat.cand->env.lookup(*inst); 190 if (cls && cls->bound) thisArgType = cls->bound; 191 } 182 192 183 193 std::string otypeKey = ""; 184 194 if (thisArgType.as<ast::PointerType>()) otypeKey = Mangle::Encoding::pointer; 185 195 else if (!isUnboundType(thisArgType)) otypeKey = Mangle::mangle(thisArgType, Mangle::Type | Mangle::NoGenericParams); 186 else if (skipUnbound) return false;196 else if (skipUnbound) return AssertionResult::Skip; 187 197 188 198 candidates = sat.symtab.specialLookupId(kind, otypeKey); … … 212 222 213 223 ast::OpenVarSet closed; 214 findOpenVars( toType, newOpen, closed, newNeed, have, FirstClosed ); 215 findOpenVars( adjType, newOpen, closed, newNeed, have, FirstOpen ); 216 if ( allowConversion ) { 224 // findOpenVars( toType, newOpen, closed, newNeed, have, FirstClosed ); 225 findOpenVars( adjType, newOpen, closed, newNeed, have, newEnv, FirstOpen ); 226 ast::TypeEnvironment tempNewEnv {newEnv}; 227 228 if ( unifyExact( toType, adjType, tempNewEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) { 229 // set up binding slot for recursive assertions 230 ast::UniqueId crntResnSlot = 0; 231 if ( ! newNeed.empty() ) { 232 crntResnSlot = ++globalResnSlot; 233 for ( auto & a : newNeed ) { a.second.resnSlot = crntResnSlot; } 234 } 235 236 matches.emplace_back( 237 cdata, adjType, std::move( tempNewEnv ), std::move( have ), std::move( newNeed ), 238 std::move( newOpen ), crntResnSlot ); 239 } 240 else if ( matches.empty() ) { 241 // restore invalidated env 242 // newEnv = sat.cand->env; 243 // newNeed.clear(); 217 244 if ( auto c = commonType( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) { 218 245 // set up binding slot for recursive assertions … … 223 250 } 224 251 225 matches.emplace_back(252 inexactMatches.emplace_back( 226 253 cdata, adjType, std::move( newEnv ), std::move( have ), std::move( newNeed ), 227 254 std::move( newOpen ), crntResnSlot ); 228 255 } 229 256 } 230 else {231 if ( unifyExact( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) {232 // set up binding slot for recursive assertions233 ast::UniqueId crntResnSlot = 0;234 if ( ! newNeed.empty() ) {235 crntResnSlot = ++globalResnSlot;236 for ( auto & a : newNeed ) { a.second.resnSlot = crntResnSlot; }237 }238 239 matches.emplace_back(240 cdata, adjType, std::move( newEnv ), std::move( have ), std::move( newNeed ),241 std::move( newOpen ), crntResnSlot );242 }243 }244 257 } 245 258 246 259 // break if no satisfying match 247 if ( matches.empty() ) return false; 260 if ( matches.empty() ) matches = std::move(inexactMatches); 261 if ( matches.empty() ) return AssertionResult::Fail; 248 262 249 263 // defer if too many satisfying matches 250 264 if ( matches.size() > 1 ) { 251 265 sat.deferred.emplace_back( assn.first, assn.second, std::move( matches ) ); 252 return true;266 return AssertionResult::Success; 253 267 } 254 268 255 269 // otherwise bind unique match in ongoing scope 256 270 AssnCandidate & match = matches.front(); 257 addToSymbolTable( match.have, sat.symtab );271 // addToSymbolTable( match.have, sat.symtab ); 258 272 sat.newNeed.insert( match.need.begin(), match.need.end() ); 259 273 sat.cand->env = std::move( match.env ); … … 261 275 262 276 bindAssertion( assn.first, assn.second, sat.cand, match, sat.inferred ); 263 return true;277 return AssertionResult::Success; 264 278 } 265 279 … … 438 452 // for each current mutually-compatible set of assertions 439 453 for ( SatState & sat : sats ) { 440 bool allowConversion = false;441 454 // stop this branch if a better option is already found 442 455 auto it = thresholds.find( pruneKey( *sat.cand ) ); … … 447 460 for (unsigned resetCount = 0; ; ++resetCount) { 448 461 ast::AssertionList next; 449 resetTyVarRenaming();450 462 // make initial pass at matching assertions 451 463 for ( auto & assn : sat.need ) { 464 resetTyVarRenaming(); 452 465 // fail early if any assertion is not satisfiable 453 if ( ! satisfyAssertion( assn, sat, allowConversion, !next.empty() ) ) { 454 next.emplace_back(assn); 455 // goto nextSat; 456 } 457 } 458 // success 459 if (next.empty()) break; 460 // fail if nothing resolves 461 else if (next.size() == sat.need.size()) { 462 if (allowConversion) { 466 auto result = satisfyAssertion( assn, sat, !next.empty() ); 467 if ( result == AssertionResult::Fail ) { 463 468 Indenter tabs{ 3 }; 464 469 std::ostringstream ss; … … 466 471 print( ss, *sat.cand, ++tabs ); 467 472 ss << (tabs-1) << "Could not satisfy assertion:\n"; 468 ast::print( ss, next[0].first, tabs );473 ast::print( ss, assn.first, tabs ); 469 474 470 475 errors.emplace_back( ss.str() ); 471 476 goto nextSat; 472 477 } 473 474 else { 475 allowConversion = true; 476 continue; 477 } 478 } 479 allowConversion = false; 478 else if ( result == AssertionResult::Skip ) { 479 next.emplace_back(assn); 480 // goto nextSat; 481 } 482 } 483 // success 484 if (next.empty()) break; 485 480 486 sat.need = std::move(next); 481 487 } … … 531 537 sat.cand->expr, std::move( compat.env ), std::move( compat.open ), 532 538 ast::AssertionSet{} /* need moved into satisfaction state */, 533 sat.cand->cost , sat.cand->cvtCost);539 sat.cand->cost ); 534 540 535 541 ast::AssertionSet nextNewNeed{ sat.newNeed }; … … 544 550 for ( DeferRef r : compat.assns ) { 545 551 AssnCandidate match = r.match; 546 addToSymbolTable( match.have, nextSymtab );552 // addToSymbolTable( match.have, nextSymtab ); 547 553 nextNewNeed.insert( match.need.begin(), match.need.end() ); 548 554 -
src/ResolvExpr/Unify.cc
r0b0a285 rc84dd61 160 160 env.apply( newSecond ); 161 161 162 findOpenVars( newFirst, open, closed, need, have, FirstClosed );163 findOpenVars( newSecond, open, closed, need, have, FirstOpen );162 // findOpenVars( newFirst, open, closed, need, have, FirstClosed ); 163 findOpenVars( newSecond, open, closed, need, have, newEnv, FirstOpen ); 164 164 165 165 return unifyExact(newFirst, newSecond, newEnv, need, have, open, noWiden() ); … … 964 964 // check that the other type is compatible and named the same 965 965 auto otherInst = dynamic_cast< const XInstType * >( other ); 966 if (otherInst && inst->name == otherInst->name) this->result = otherInst; 966 if (otherInst && inst->name == otherInst->name) 967 this->result = otherInst; 967 968 return otherInst; 968 969 } … … 1049 1050 1050 1051 void postvisit( const ast::TypeInstType * typeInst ) { 1051 assert( open.find( *typeInst ) == open.end() ); 1052 handleRefType( typeInst, type2 ); 1052 // assert( open.find( *typeInst ) == open.end() ); 1053 auto otherInst = dynamic_cast< const ast::TypeInstType * >( type2 ); 1054 if (otherInst && typeInst->name == otherInst->name) 1055 this->result = otherInst; 1056 // return otherInst; 1053 1057 } 1054 1058 … … 1161 1165 ) { 1162 1166 ast::OpenVarSet closed; 1163 findOpenVars( type1, open, closed, need, have, FirstClosed );1164 findOpenVars( type2, open, closed, need, have, FirstOpen );1167 // findOpenVars( type1, open, closed, need, have, FirstClosed ); 1168 findOpenVars( type2, open, closed, need, have, env, FirstOpen ); 1165 1169 return unifyInexact( 1166 1170 type1, type2, env, need, have, open, WidenMode{ true, true }, common ); … … 1179 1183 entry1 = var1 ? open.find( *var1 ) : open.end(), 1180 1184 entry2 = var2 ? open.find( *var2 ) : open.end(); 1181 bool isopen1 = entry1 != open.end(); 1182 bool isopen2 = entry2 != open.end(); 1183 1185 // bool isopen1 = entry1 != open.end(); 1186 // bool isopen2 = entry2 != open.end(); 1187 bool isopen1 = var1 && env.lookup(*var1); 1188 bool isopen2 = var2 && env.lookup(*var2); 1189 1190 /* 1184 1191 if ( isopen1 && isopen2 ) { 1185 1192 if ( entry1->second.kind != entry2->second.kind ) return false; … … 1190 1197 return env.bindVar( var1, type2, entry1->second, need, have, open, widen ); 1191 1198 } else if ( isopen2 ) { 1192 return env.bindVar( var2, type1, entry2->second, need, have, open, widen ); 1193 } else { 1199 return env.bindVar( var2, type1, entry2->second, need, have, open, widen, symtab ); 1200 } */ 1201 if ( isopen1 && isopen2 ) { 1202 if ( var1->base->kind != var2->base->kind ) return false; 1203 return env.bindVarToVar( 1204 var1, var2, ast::TypeData{ var1->base->kind, var1->base->sized||var2->base->sized }, need, have, 1205 open, widen ); 1206 } else if ( isopen1 ) { 1207 return env.bindVar( var1, type2, ast::TypeData{var1->base}, need, have, open, widen ); 1208 } else if ( isopen2 ) { 1209 return env.bindVar( var2, type1, ast::TypeData{var2->base}, need, have, open, widen ); 1210 }else { 1194 1211 return ast::Pass<Unify_new>::read( 1195 1212 type1, type2, env, need, have, open, widen ); 1196 1213 } 1214 1197 1215 } 1198 1216 -
src/SynTree/Expression.cc
r0b0a285 rc84dd61 267 267 } 268 268 269 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated ) : arg(arg), isGenerated( isGenerated ) {269 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated, CastKind kind ) : arg(arg), isGenerated( isGenerated ), kind( kind ) { 270 270 set_result(toType); 271 271 } 272 272 273 CastExpr::CastExpr( Expression * arg, bool isGenerated ) : arg(arg), isGenerated( isGenerated ) {273 CastExpr::CastExpr( Expression * arg, bool isGenerated, CastKind kind ) : arg(arg), isGenerated( isGenerated ), kind( kind ) { 274 274 set_result( new VoidType( Type::Qualifiers() ) ); 275 275 } 276 276 277 CastExpr::CastExpr( const CastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) {277 CastExpr::CastExpr( const CastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ), kind( other.kind ) { 278 278 } 279 279 -
src/SynTree/Expression.h
r0b0a285 rc84dd61 271 271 bool isGenerated = true; 272 272 273 CastExpr( Expression * arg, bool isGenerated = true ); 274 CastExpr( Expression * arg, Type * toType, bool isGenerated = true ); 273 enum CastKind { 274 Default, // C 275 Coerce, // reinterpret cast 276 Return // overload selection 277 }; 278 279 CastKind kind = Default; 280 281 CastExpr( Expression * arg, bool isGenerated = true, CastKind kind = Default ); 282 CastExpr( Expression * arg, Type * toType, bool isGenerated = true, CastKind kind = Default ); 275 283 CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor 276 284 CastExpr( const CastExpr & other ); -
src/Tuples/TupleAssignment.cc
r0b0a285 rc84dd61 679 679 680 680 ResolvExpr::CandidateFinder finder( crntFinder.context, matcher->env ); 681 finder.allowVoid = true; 681 682 682 683 try { -
src/Validate/Autogen.cpp
r0b0a285 rc84dd61 321 321 void FuncGenerator::produceDecl( const ast::FunctionDecl * decl ) { 322 322 assert( nullptr != decl->stmts ); 323 assert( decl->type_params.size() == getGenericParams( type ).size() ); 323 324 324 325 definitions.push_back( decl ); … … 356 357 decl->init = nullptr; 357 358 splice( assertions, decl->assertions ); 358 oldToNew.emplace( std::make_pair( old_param, decl ));359 oldToNew.emplace( old_param, decl ); 359 360 type_params.push_back( decl ); 360 361 } … … 522 523 InitTweak::InitExpander_new srcParam( src ); 523 524 // Assign to destination. 524 ast:: Expr * dstSelect = new ast::MemberExpr(525 ast::MemberExpr * dstSelect = new ast::MemberExpr( 525 526 location, 526 527 field, … … 574 575 } 575 576 576 ast:: Expr * srcSelect = (srcParam) ? new ast::MemberExpr(577 ast::MemberExpr * srcSelect = (srcParam) ? new ast::MemberExpr( 577 578 location, field, new ast::VariableExpr( location, srcParam ) 578 579 ) : nullptr; -
src/Validate/GenericParameter.cpp
r0b0a285 rc84dd61 120 120 } 121 121 122 struct ValidateGenericParamsCore : public ast::WithCodeLocation { 122 bool isSizedPolymorphic( const ast::AggregateDecl * decl ) { 123 for ( const auto & param : decl->params ) { 124 if ( param->sized ) return true; 125 } 126 return false; 127 } 128 129 struct ValidateGenericParamsCore : 130 public ast::WithCodeLocation, public ast::WithGuards { 131 // Generic parameter filling and checks: 123 132 const ast::StructInstType * previsit( const ast::StructInstType * type ) { 124 133 assert( location ); … … 129 138 assert( location ); 130 139 return validateGeneric( *location, type ); 140 } 141 142 // Check parameter and bitfield combinations: 143 bool insideSized = false; 144 void previsit( const ast::StructDecl * decl ) { 145 if ( isSizedPolymorphic( decl ) && !insideSized ) { 146 GuardValue( insideSized ) = true; 147 } 148 } 149 150 void previsit( const ast::UnionDecl * decl ) { 151 if ( isSizedPolymorphic( decl ) && !insideSized ) { 152 GuardValue( insideSized ) = true; 153 } 154 } 155 156 void previsit( const ast::ObjectDecl * decl ) { 157 if ( insideSized && decl->bitfieldWidth ) { 158 SemanticError( decl->location, decl, 159 "Cannot have bitfields inside a sized polymorphic structure." ); 160 } 131 161 } 132 162 }; -
src/Validate/LinkReferenceToTypes.cpp
r0b0a285 rc84dd61 84 84 // Just linking in the node. 85 85 auto mut = ast::mutate( type ); 86 mut->base = const_cast<ast::EnumDecl *>( decl );86 mut->base = decl; 87 87 type = mut; 88 88 } … … 101 101 // Just linking in the node. 102 102 auto mut = ast::mutate( type ); 103 mut->base = const_cast<ast::StructDecl *>( decl );103 mut->base = decl; 104 104 type = mut; 105 105 } … … 118 118 // Just linking in the node. 119 119 auto mut = ast::mutate( type ); 120 mut->base = const_cast<ast::UnionDecl *>( decl );120 mut->base = decl; 121 121 type = mut; 122 122 } … … 141 141 142 142 // Just linking in the node. 143 mut->base = const_cast<ast::TraitDecl *>( decl );143 mut->base = decl; 144 144 145 145 // Need to carry over the 'sized' status of each decl in the instance. … … 203 203 } 204 204 205 // The following section206 207 205 ForwardEnumsType::iterator fwds = forwardEnums.find( decl->name ); 208 206 if ( fwds != forwardEnums.end() ) { -
src/Virtual/VirtualDtor.cpp
r0b0a285 rc84dd61 146 146 147 147 CompoundStmt * dtorBody = mutate( decl->stmts.get() ); 148 // Adds the following to the endof any actor/message dtor:148 // Adds the following to the start of any actor/message dtor: 149 149 // __CFA_dtor_shutdown( this ); 150 dtorBody->push_front( new ExprStmt( 151 decl->location, 152 new UntypedExpr ( 153 decl->location, 154 new NameExpr( decl->location, "__CFA_dtor_shutdown" ), 155 { 156 new NameExpr( decl->location, decl->params.at(0)->name ) 157 } 158 ) 159 )); 150 dtorBody->push_front( 151 new IfStmt( decl->location, 152 new UntypedExpr ( 153 decl->location, 154 new NameExpr( decl->location, "__CFA_dtor_shutdown" ), 155 { 156 new NameExpr( decl->location, decl->params.at(0)->name ) 157 } 158 ), 159 new ReturnStmt( decl->location, nullptr ) 160 ) 161 ); 160 162 return; 161 163 } -
src/main.cc
r0b0a285 rc84dd61 28 28 #include <list> // for list 29 29 #include <string> // for char_traits, operator<< 30 31 using namespace std;32 30 33 31 #include "AST/Convert.hpp" … … 88 86 #include "Virtual/VirtualDtor.hpp" // for implementVirtDtors 89 87 88 using namespace std; 89 90 90 static void NewPass( const char * const name ) { 91 91 Stats::Heap::newPass( name ); … … 335 335 336 336 PASS( "Fix Qualified Types", Validate::fixQualifiedTypes, transUnit ); 337 PASS( "Eliminate Typedef", Validate::eliminateTypedef, transUnit ); 337 338 PASS( "Hoist Struct", Validate::hoistStruct, transUnit ); 338 PASS( "Eliminate Typedef", Validate::eliminateTypedef, transUnit );339 339 PASS( "Validate Generic Parameters", Validate::fillGenericParameters, transUnit ); 340 340 PASS( "Translate Dimensions", Validate::translateDimensionParameters, transUnit ); -
tests/.expect/mathX.arm64.txt
r0b0a285 rc84dd61 787 787 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 788 788 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0794 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64 794 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128 795 795 796 796 unsigned char … … 807 807 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 808 808 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384 822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768 823 823 824 824 unsigned short int … … 843 843 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 844 844 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 1073741824, ceiling(-1073741826, 1073741824) = 0874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -2147483648, ceiling(-1073741826, 1073741824) = -1073741824 874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648 875 875 876 876 unsigned int … … 911 911 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 912 912 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824 942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648 943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296 944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592 945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184 946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368 947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736 948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472 949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944 950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888 951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776 952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552 953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104 954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208 955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416 956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832 957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664 958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328 959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656 960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312 961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624 962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248 963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496 964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992 965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984 966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968 967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936 968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872 969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744 970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488 971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976 972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952 973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904 974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808 975 975 976 976 unsigned long int … … 1043 1043 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 1044 1044 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 1045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 01046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 01047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 01048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 01049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 01050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 01051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 01052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 01053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 01054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 01055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 01056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 01057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 01058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 01059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 01060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 01061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 01062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 01063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 01064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 01065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 01066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 01067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 01068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 01069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 01070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 01071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 01072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 01073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 01074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 01075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 01076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 01077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 01078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 01079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 01080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 01081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 01082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 01083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 01084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 01085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 01086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 01087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 01088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 01089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 01090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 01091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 01092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 01093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 01094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 01095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 01096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 01097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 01098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 01099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 01100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 01101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 01102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 01103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 01104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 01105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 01106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 01045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 1046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 1047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 1048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 1049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 1050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 1051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 1052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 1053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 1054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 1055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 1056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 1057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 1058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 1059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 1060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 1061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 1062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 1063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 1064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 1065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 1066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 1067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 1068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 1069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 1070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 1071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 1072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 1073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824 1074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648 1075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296 1076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592 1077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184 1078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368 1079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736 1080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472 1081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944 1082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888 1083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776 1084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552 1085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104 1086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208 1087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416 1088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832 1089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664 1090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328 1091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656 1092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312 1093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624 1094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248 1095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496 1096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992 1097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984 1098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968 1099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936 1100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872 1101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744 1102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488 1103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976 1104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952 1105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904 1106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808 1107 1107 1108 1108 unsigned long long int -
tests/.expect/mathX.x64.txt
r0b0a285 rc84dd61 787 787 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 788 788 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0794 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64 794 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128 795 795 796 796 unsigned char … … 807 807 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 808 808 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384 822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768 823 823 824 824 unsigned short int … … 843 843 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 844 844 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 1073741824, ceiling(-1073741826, 1073741824) = 0874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -2147483648, ceiling(-1073741826, 1073741824) = -1073741824 874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648 875 875 876 876 unsigned int … … 911 911 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 912 912 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824 942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648 943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296 944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592 945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184 946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368 947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736 948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472 949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944 950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888 951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776 952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552 953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104 954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208 955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416 956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832 957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664 958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328 959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656 960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312 961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624 962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248 963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496 964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992 965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984 966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968 967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936 968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872 969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744 970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488 971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976 972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952 973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904 974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808 975 975 976 976 unsigned long int … … 1043 1043 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 1044 1044 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 1045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 01046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 01047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 01048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 01049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 01050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 01051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 01052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 01053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 01054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 01055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 01056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 01057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 01058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 01059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 01060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 01061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 01062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 01063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 01064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 01065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 01066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 01067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 01068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 01069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 01070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 01071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 01072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 01073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 01074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 01075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 01076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 01077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 01078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 01079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 01080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 01081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 01082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 01083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 01084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 01085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 01086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 01087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 01088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 01089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 01090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 01091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 01092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 01093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 01094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 01095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 01096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 01097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 01098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 01099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 01100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 01101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 01102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 01103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 01104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 01105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 01106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 01045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 1046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 1047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 1048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 1049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 1050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 1051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 1052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 1053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 1054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 1055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 1056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 1057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 1058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 1059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 1060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 1061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 1062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 1063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 1064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 1065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 1066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 1067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 1068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 1069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 1070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 1071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 1072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 1073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824 1074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648 1075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296 1076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592 1077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184 1078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368 1079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736 1080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472 1081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944 1082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888 1083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776 1084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552 1085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104 1086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208 1087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416 1088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832 1089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664 1090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328 1091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656 1092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312 1093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624 1094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248 1095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496 1096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992 1097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984 1098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968 1099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936 1100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872 1101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744 1102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488 1103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976 1104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952 1105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904 1106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808 1107 1107 1108 1108 unsigned long long int -
tests/.expect/mathX.x86.txt
r0b0a285 rc84dd61 659 659 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 660 660 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 661 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0662 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0663 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0664 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0665 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0666 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0661 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 662 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 663 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 664 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 665 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64 666 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128 667 667 668 668 unsigned char … … 679 679 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 680 680 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 681 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0682 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0683 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0684 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0685 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0686 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0687 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0688 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0689 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0690 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0691 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0692 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0693 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0694 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0681 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 682 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 683 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 684 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 685 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 686 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 687 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 688 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 689 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 690 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 691 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 692 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 693 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384 694 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768 695 695 696 696 unsigned short int … … 715 715 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 716 716 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 717 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0718 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0719 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0720 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0721 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0722 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0723 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0724 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0725 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0726 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0727 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0728 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0729 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0730 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0731 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0732 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0733 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0734 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0735 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0736 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0737 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0738 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0739 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0740 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0741 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0742 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0743 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0744 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0745 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 1073741824, ceiling(-1073741826, 1073741824) = 0746 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0717 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 718 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 719 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 720 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 721 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 722 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 723 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 724 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 725 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 726 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 727 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 728 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 729 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 730 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 731 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 732 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 733 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 734 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 735 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 736 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 737 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 738 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 739 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 740 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 741 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 742 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 743 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 744 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 745 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -2147483648, ceiling(-1073741826, 1073741824) = -1073741824 746 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648 747 747 748 748 unsigned int … … 783 783 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 784 784 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 785 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0786 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0787 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0788 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0789 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0790 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0791 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0792 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0793 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0794 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0795 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0796 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0797 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0798 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0799 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0800 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0801 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0802 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0803 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0804 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0805 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0806 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0807 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0808 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0809 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0810 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0811 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0812 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0813 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 1073741824, ceiling(-1073741826, 1073741824) = 0814 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0785 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 786 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 787 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 788 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 789 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 790 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 791 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 792 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 793 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 794 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 795 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 796 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 797 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 798 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 799 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 800 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 801 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 802 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 803 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 804 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 805 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 806 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 807 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 808 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 809 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 810 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 811 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 812 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 813 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -2147483648, ceiling(-1073741826, 1073741824) = -1073741824 814 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648 815 815 816 816 unsigned long int … … 851 851 ceiling(1, 1) = 1, ceiling(3, 1) = 3, ceiling(-3, 1) = -3 852 852 ceiling(2, 2) = 2, ceiling(4, 2) = 4, ceiling(-4, 2) = -4 853 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0854 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0855 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0856 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0857 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0858 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0859 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0860 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0861 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0862 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0863 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0864 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0865 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0866 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0867 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0868 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0869 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0870 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0871 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0872 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0873 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0874 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0875 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0876 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0877 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0878 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0879 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0880 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0881 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0882 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0883 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0884 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0885 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0886 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0887 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0888 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0889 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0890 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0891 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0892 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0893 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0894 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0895 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0896 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0897 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0898 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0899 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0900 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0901 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0902 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0903 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0904 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0905 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0906 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0907 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0908 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0909 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0910 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0911 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0912 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0913 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0914 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0853 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = -4 854 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8 855 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16 856 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32 857 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64 858 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128 859 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256 860 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512 861 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024 862 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048 863 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096 864 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192 865 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384 866 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768 867 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536 868 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072 869 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144 870 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288 871 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576 872 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152 873 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304 874 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608 875 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216 876 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432 877 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864 878 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728 879 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456 880 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912 881 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824 882 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648 883 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296 884 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592 885 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184 886 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368 887 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736 888 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472 889 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944 890 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888 891 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776 892 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552 893 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104 894 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208 895 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416 896 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832 897 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664 898 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328 899 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656 900 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312 901 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624 902 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248 903 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496 904 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992 905 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984 906 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968 907 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936 908 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872 909 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744 910 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488 911 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976 912 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952 913 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904 914 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808 915 915 916 916 unsigned long long int -
tests/Makefile.am
r0b0a285 rc84dd61 90 90 concurrency/clib.c \ 91 91 concurrency/unified_locking/mutex_test.hfa \ 92 concurrency/channels/parallel_harness.hfa 92 concurrency/channels/parallel_harness.hfa \ 93 array-container/dimexpr-match.hfa \ 94 array-container/dimexpr-match-detail.sh 93 95 94 96 dist-hook: … … 111 113 # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 112 114 all-local : # This name is important to automake and implies the default build target. 113 @+${TEST_PY} --debug=${debug} --install=${installed} --invariant${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all115 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all 114 116 115 117 tests : all-local # synonym … … 225 227 -cp ${test} ${abspath ${@}} 226 228 229 array-container/dimexpr-match-c-ERRS : array-container/dimexpr-match-c.cfa 230 ${CFACOMPILE_SYNTAX} -DERRS 231 -cp ${test} ${abspath ${@}} 232 233 array-container/dimexpr-match-cfa-ERRS : array-container/dimexpr-match-cfa.cfa 234 ${CFACOMPILE_SYNTAX} -DERRS 235 -cp ${test} ${abspath ${@}} 236 227 237 alloc-ERROR : alloc.cfa ${CFACCBIN} 228 238 ${CFACOMPILE_SYNTAX} -DERR1 -
tests/collections/vector-demo.cfa
r0b0a285 rc84dd61 143 143 assert( v`capacity > 5 && v`length == 5 ); 144 144 145 v[2] = -0.1 ; // v is [0.0, 98.6, -0.1, 0.2, 0.3]; iter at -0.1, where only the new memory had that change145 v[2] = -0.1f; // v is [0.0, 98.6, -0.1, 0.2, 0.3]; iter at -0.1, where only the new memory had that change 146 146 147 147 float val3 = iter`val; -
tests/concurrency/actors/.expect/inherit.txt
r0b0a285 rc84dd61 4 4 A 5 5 A 6 A 7 A 6 8 Finished -
tests/concurrency/actors/dynamic.cfa
r0b0a285 rc84dd61 28 28 derived_actor * d_actor = alloc(); 29 29 (*d_actor){}; 30 *d_actor <<*d_msg;30 *d_actor | *d_msg; 31 31 return Delete; 32 32 } … … 58 58 derived_actor * d_actor = alloc(); 59 59 (*d_actor){}; 60 *d_actor <<*d_msg;60 *d_actor | *d_msg; 61 61 62 62 printf("stopping\n"); -
tests/concurrency/actors/executor.cfa
r0b0a285 rc84dd61 28 28 if ( recs % Batch == 0 ) { 29 29 for ( i; Batch ) { 30 gstart[sends % Set] <<shared_msg;30 gstart[sends % Set] | shared_msg; 31 31 sends += 1; 32 32 } … … 94 94 95 95 for ( i; Actors ) { 96 actors[i] <<shared_msg;96 actors[i] | shared_msg; 97 97 } // for 98 98 -
tests/concurrency/actors/inherit.cfa
r0b0a285 rc84dd61 7 7 8 8 struct Server { inline actor; }; 9 9 10 struct Server2 { inline Server; int b; }; 11 void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; } 12 10 13 struct D_msg { int a; inline message; }; 11 struct D_msg2 { inline D_msg; };12 13 void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; }14 14 void ?{}( D_msg & this ) { set_allocation( this, Delete ); } 15 15 void ^?{}( D_msg & this ) { mutex(sout) sout | 'A'; } 16 17 struct D_msg2 { inline D_msg; }; 16 18 17 19 allocation handle() { … … 30 32 D_msg * dm = alloc(); 31 33 (*dm){}; 32 D_msg2 dm2; 34 D_msg2 * dm2 = alloc(); 35 (*dm2){}; 33 36 Server2 * s = alloc(); 34 37 (*s){}; 35 38 Server2 * s2 = alloc(); 36 39 (*s2){}; 37 *s <<*dm;38 *s2 <<dm2;40 *s | *dm; 41 *s2 | *dm2; 39 42 stop_actor_system(); 40 43 } … … 44 47 D_msg * dm = alloc(); 45 48 (*dm){}; 46 D_msg2 dm2; 47 s[0] << *dm; 48 s[1] << dm2; 49 D_msg2 * dm2 = alloc(); 50 (*dm2){}; 51 s[0] | *dm; 52 s[1] | *dm2; 49 53 stop_actor_system(); 50 54 } -
tests/concurrency/actors/matrix.cfa
r0b0a285 rc84dd61 105 105 106 106 for ( unsigned int r = 0; r < xr; r += 1 ) { 107 actors[r] <<messages[r];107 actors[r] | messages[r]; 108 108 } // for 109 109 -
tests/concurrency/actors/pingpong.cfa
r0b0a285 rc84dd61 25 25 allocation retval = Nodelete; 26 26 if ( msg.count == times ) retval = Finished; 27 *po <<msg;27 *po | msg; 28 28 return retval; 29 29 } … … 35 35 allocation retval = Nodelete; 36 36 if ( msg.count == times ) retval = Finished; 37 *pi <<msg;37 *pi | msg; 38 38 return retval; 39 39 } … … 53 53 pi = &pi_actor; 54 54 p_msg m; 55 pi_actor <<m;55 pi_actor | m; 56 56 stop_actor_system(); 57 57 -
tests/concurrency/actors/poison.cfa
r0b0a285 rc84dd61 18 18 Server s[10]; 19 19 for ( i; 10 ) { 20 s[i] <<finished_msg;20 s[i] | finished_msg; 21 21 } 22 22 stop_actor_system(); … … 29 29 Server * s = alloc(); 30 30 (*s){}; 31 (*s) <<delete_msg;31 (*s) | delete_msg; 32 32 } 33 33 stop_actor_system(); … … 39 39 Server s[10]; 40 40 for ( i; 10 ) 41 s[i] <<destroy_msg;41 s[i] | destroy_msg; 42 42 stop_actor_system(); 43 43 for ( i; 10 ) -
tests/concurrency/actors/static.cfa
r0b0a285 rc84dd61 25 25 } 26 26 msg.cnt++; 27 receiver <<msg;27 receiver | msg; 28 28 return Nodelete; 29 29 } … … 55 55 derived_actor actor; 56 56 57 actor <<msg;57 actor | msg; 58 58 59 59 printf("stopping\n"); -
tests/concurrency/actors/types.cfa
r0b0a285 rc84dd61 72 72 b.num = 1; 73 73 c.num = 2; 74 a << b <<c;74 a | b | c; 75 75 stop_actor_system(); 76 76 … … 80 80 d_msg d_ac2_msg; 81 81 d_ac2_msg.num = 3; 82 d_ac2_0 <<d_ac2_msg;83 d_ac2_1 <<d_ac2_msg;82 d_ac2_0 | d_ac2_msg; 83 d_ac2_1 | d_ac2_msg; 84 84 stop_actor_system(); 85 85 … … 93 93 d_msg d_ac23_msg; 94 94 d_ac23_msg.num = 4; 95 d_ac3_0 <<d_ac23_msg;96 d_ac2_2 <<d_ac23_msg;95 d_ac3_0 | d_ac23_msg; 96 d_ac2_2 | d_ac23_msg; 97 97 stop_actor_system(); 98 98 } // RAII to clean up executor … … 107 107 b1.num = -1; 108 108 c2.num = 5; 109 a3 << b1 <<c2;109 a3 | b1 | c2; 110 110 stop_actor_system(); 111 111 } // RAII to clean up executor … … 120 120 b1.num = -1; 121 121 c2.num = 5; 122 a4 << b1 <<c2;122 a4 | b1 | c2; 123 123 stop_actor_system(); 124 124 } // RAII to clean up executor -
tests/coroutine/devicedriver.cfa
r0b0a285 rc84dd61 10 10 // Created On : Sat Mar 16 15:30:34 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Apr 20 09:07:19 201913 // Update Count : 9 012 // Last Modified On : Sat Jun 17 09:11:56 2023 13 // Update Count : 94 14 14 // 15 15 … … 18 18 19 19 enum Status { CONT, MSG, ESTX, ELNTH, ECRC }; 20 20 21 coroutine Driver { 21 22 Status status; … … 23 24 }; // Driver 24 25 25 void ?{}( Driver & d, char * m ) { d.msg = m; } 26 Status next( Driver & d, char b ) with( d ) { 27 byte = b; resume( d ); return status; 26 void ?{}( Driver & d, char * m ) { d.msg = m; } // constructor 27 28 Status next( Driver & d, char b ) with( d ) { // called by interrupt handler 29 byte = b; resume( d ); return status; // resume coroutine at last suspend 28 30 } // next 29 31 … … 73 75 if ( eof( sin ) ) break eof; // eof ? 74 76 choose( next( driver, byte ) ) { // analyse character 75 case MSG: 76 sout | "msg:" | msg; 77 case ESTX: 78 sout | "STX in message"; 79 case ELNTH: 80 sout | "message too long"; 81 case ECRC: 82 sout | "CRC failure"; 83 default: ; 77 case CONT: ; 78 case MSG: sout | "msg:" | msg; 79 case ESTX: sout | "STX in message"; 80 case ELNTH: sout | "message too long"; 81 case ECRC: sout | "CRC failure"; 84 82 } // choose 85 83 } // for … … 87 85 88 86 // Local Variables: // 89 // tab-width: 4 //90 87 // compile-command: "cfa -g -Wall -Wextra devicedriver.cfa" // 91 88 // End: // -
tests/io/manipulatorsInput.cfa
r0b0a285 rc84dd61 7 7 // Created On : Sat Jun 8 17:58:54 2019 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Wed Jul 15 15:56:03 202010 // Update Count : 4 79 // Last Modified On : Sat Jun 17 07:56:02 2023 10 // Update Count : 48 11 11 // 12 12 … … 152 152 sin | ignore( wdi( 8, ldc ) ); sout | ldc; 153 153 } 154 #if defined( __SIZEOF_INT128__ )154 #if defined( __SIZEOF_INT128__ ) 155 155 { 156 156 int128 val; … … 160 160 } 161 161 } 162 #endif // __SIZEOF_INT128__162 #endif // __SIZEOF_INT128__ 163 163 } // main 164 164 -
tests/pybin/settings.py
r0b0a285 rc84dd61 141 141 all_install = [Install(o) for o in list(dict.fromkeys(options.install))] 142 142 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None 143 invariant = options. invariant143 invariant = options.no_invariant 144 144 continue_ = options.continue_ 145 145 dry_run = options.dry_run # must be called before tools.config_hash() -
tests/test.py
r0b0a285 rc84dd61 114 114 parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no') 115 115 parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_') 116 parser.add_argument('--invariant', help='Tell the compiler to check invariants while running.', action='store_true') 116 parser.add_argument('--invariant', help='Tell the compiler to check invariants.', action='store_true') 117 parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false') 117 118 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180) 118 119 parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
Note: See TracChangeset
for help on using the changeset viewer.