Changes in / [c84dd61:0b0a285]
- Files:
-
- 30 deleted
- 80 edited
-
doc/theses/colby_parsons_MMAth/Makefile (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/balance.cfa (modified) (3 diffs)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/dynamic.cfa (modified) (2 diffs)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/executor.cfa (modified) (2 diffs)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/matrix.cfa (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/repeat.cfa (modified) (4 diffs)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/static.cfa (modified) (2 diffs)
-
doc/theses/colby_parsons_MMAth/benchmarks/actors/plotData.py (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/benchmarks/channels/plotData.py (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt/plotData.py (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Contend_2.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Contend_4.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Contend_8.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Future.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Spin_2.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Spin_4.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/nasus_Spin_8.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Contend_2.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Contend_4.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Contend_8.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Future.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Spin_2.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Spin_4.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/figures/pyke_Spin_8.pgf (deleted)
-
doc/theses/colby_parsons_MMAth/glossary.tex (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/local.bib (modified) (1 diff)
-
doc/theses/colby_parsons_MMAth/text/actors.tex (modified) (13 diffs)
-
doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex (modified) (3 diffs)
-
driver/cfa.cc (modified) (2 diffs)
-
libcfa/prelude/builtins.c (modified) (2 diffs)
-
libcfa/prelude/sync-builtins.cf (modified) (6 diffs)
-
libcfa/src/common.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/actor.hfa (modified) (26 diffs)
-
libcfa/src/concurrency/atomic.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/kernel.hfa (modified) (2 diffs)
-
libcfa/src/concurrency/kernel/cluster.hfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/locks.hfa (modified) (1 diff)
-
libcfa/src/fstream.cfa (modified) (3 diffs)
-
libcfa/src/iostream.hfa (modified) (5 diffs)
-
libcfa/src/math.hfa (modified) (3 diffs)
-
libcfa/src/stdlib.hfa (modified) (1 diff)
-
libcfa/src/virtual_dtor.hfa (modified) (1 diff)
-
src/AST/Convert.cpp (modified) (1 diff)
-
src/AST/Expr.cpp (modified) (1 diff)
-
src/AST/Expr.hpp (modified) (2 diffs)
-
src/AST/SymbolTable.cpp (modified) (2 diffs)
-
src/AST/Type.hpp (modified) (1 diff)
-
src/AST/TypeEnvironment.cpp (modified) (1 diff)
-
src/AST/TypeEnvironment.hpp (modified) (1 diff)
-
src/Concurrency/Actors.cpp (modified) (7 diffs)
-
src/GenPoly/SpecializeNew.cpp (modified) (2 diffs)
-
src/Parser/DeclarationNode.cc (modified) (7 diffs)
-
src/Parser/ExpressionNode.cc (modified) (2 diffs)
-
src/Parser/ExpressionNode.h (modified) (1 diff)
-
src/Parser/parser.yy (modified) (3 diffs)
-
src/ResolvExpr/Candidate.hpp (modified) (2 diffs)
-
src/ResolvExpr/CandidateFinder.cpp (modified) (21 diffs)
-
src/ResolvExpr/CandidateFinder.hpp (modified) (1 diff)
-
src/ResolvExpr/CastCost.cc (modified) (1 diff)
-
src/ResolvExpr/CommonType.cc (modified) (4 diffs)
-
src/ResolvExpr/ConversionCost.cc (modified) (5 diffs)
-
src/ResolvExpr/FindOpenVars.cc (modified) (3 diffs)
-
src/ResolvExpr/FindOpenVars.h (modified) (1 diff)
-
src/ResolvExpr/Resolver.cc (modified) (2 diffs)
-
src/ResolvExpr/SatisfyAssertions.cpp (modified) (15 diffs)
-
src/ResolvExpr/Unify.cc (modified) (6 diffs)
-
src/SynTree/Expression.cc (modified) (1 diff)
-
src/SynTree/Expression.h (modified) (1 diff)
-
src/Tuples/TupleAssignment.cc (modified) (1 diff)
-
src/Validate/Autogen.cpp (modified) (4 diffs)
-
src/Validate/GenericParameter.cpp (modified) (2 diffs)
-
src/Validate/LinkReferenceToTypes.cpp (modified) (5 diffs)
-
src/Virtual/VirtualDtor.cpp (modified) (1 diff)
-
src/main.cc (modified) (3 diffs)
-
tests/.expect/mathX.arm64.txt (modified) (5 diffs)
-
tests/.expect/mathX.x64.txt (modified) (5 diffs)
-
tests/.expect/mathX.x86.txt (modified) (5 diffs)
-
tests/.expect/polybits.txt (deleted)
-
tests/Makefile.am (modified) (3 diffs)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.arm64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.x64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c-ERRS.x86.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-c.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.arm64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.x64.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa-ERRS.x86.txt (deleted)
-
tests/array-container/.expect/dimexpr-match-cfa.txt (deleted)
-
tests/array-container/dimexpr-match-c.cfa (deleted)
-
tests/array-container/dimexpr-match-cfa.cfa (deleted)
-
tests/array-container/dimexpr-match-detail.sh (deleted)
-
tests/array-container/dimexpr-match.hfa (deleted)
-
tests/collections/vector-demo.cfa (modified) (1 diff)
-
tests/concurrency/actors/.expect/inherit.txt (modified) (1 diff)
-
tests/concurrency/actors/.expect/inline.txt (deleted)
-
tests/concurrency/actors/dynamic.cfa (modified) (2 diffs)
-
tests/concurrency/actors/executor.cfa (modified) (2 diffs)
-
tests/concurrency/actors/inherit.cfa (modified) (3 diffs)
-
tests/concurrency/actors/inline.cfa (deleted)
-
tests/concurrency/actors/matrix.cfa (modified) (1 diff)
-
tests/concurrency/actors/pingpong.cfa (modified) (3 diffs)
-
tests/concurrency/actors/poison.cfa (modified) (3 diffs)
-
tests/concurrency/actors/static.cfa (modified) (2 diffs)
-
tests/concurrency/actors/types.cfa (modified) (5 diffs)
-
tests/coroutine/.in/devicedriver.txt (modified) ( previous)
-
tests/coroutine/devicedriver.cfa (modified) (5 diffs)
-
tests/io/manipulatorsInput.cfa (modified) (3 diffs)
-
tests/polybits.cfa (deleted)
-
tests/pybin/settings.py (modified) (1 diff)
-
tests/test.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/Makefile
rc84dd61 r0b0a285 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 \66 52 } 67 53 -
doc/theses/colby_parsons_MMAth/benchmarks/actors/cfa/balance.cfa
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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' ))169 168 if currBench == Bench.Executor or currBench == Bench.Matrix or currBench == Bench.Balance_One or currBench == Bench.Repeat: 170 169 plt.yscale("log") -
doc/theses/colby_parsons_MMAth/benchmarks/channels/plotData.py
rc84dd61 r0b0a285 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 marker = itertools.cycle(('o', 's', 'D', 'x', 'p', '^', 'h', '*', 'v' ))132 133 133 plt.yscale("log") 134 134 # plt.ylim(1, None) -
doc/theses/colby_parsons_MMAth/benchmarks/mutex_stmt/plotData.py
rc84dd61 r0b0a285 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' ))106 105 plt.yscale("log") 107 106 plt.xticks(procs) -
doc/theses/colby_parsons_MMAth/glossary.tex
rc84dd61 r0b0a285 37 37 \newabbreviation{toctou}{TOCTOU}{\Newterm{time-of-check to time-of-use}} 38 38 39 \newglossaryentry{actor}{ 39 \newglossaryentry{actor} 40 { 40 41 name=actor, 41 42 description={A basic unit of an actor system that can store local state and send messages to other actors.} 42 43 } 43 44 44 \newglossaryentry{gulp} {45 name={gulp}, 46 first={\Newterm{gulp}},45 \newglossaryentry{gulp} 46 { 47 name=gulp, 47 48 description={Move the contents of message queue to a local queue of the executor thread using a single atomic instruction.} 48 49 } 49 50 50 \newglossaryentry{impl_concurrency}{ 51 \newglossaryentry{impl_concurrency} 52 { 51 53 name=implicit concurrency, 52 first={\Newterm{implicit concurrency}},53 54 description={A class of concurrency features that abstract away explicit thread synchronization and mutual exclusion.} 54 55 } 55 56 56 \newglossaryentry{actor_model}{ 57 \newglossaryentry{actor_model} 58 { 57 59 name=actor model, 58 first={\Newterm{actor model}},59 60 description={A concurrent computation model, where tasks are broken into units of work that are distributed to actors in the form of messages.} 60 61 } 61 62 62 \newglossaryentry{actor_system}{ 63 \newglossaryentry{actor_system} 64 { 63 65 name=actor system, 64 first={\Newterm{actor system}},65 66 description={An implementation of the actor model.} 66 67 } 67 68 68 \newglossaryentry{synch_multiplex}{ 69 \newglossaryentry{synch_multiplex} 70 { 69 71 name=synchronous multiplexing, 70 first={\Newterm{synchronous multiplexing}},71 72 description={synchronization on some subset of a set of resources.} 72 73 } -
doc/theses/colby_parsons_MMAth/local.bib
rc84dd61 r0b0a285 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 109 102 @misc{go:selectref, 110 103 author = "The Go Programming Language Specification", -
doc/theses/colby_parsons_MMAth/text/actors.tex
rc84dd61 r0b0a285 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 ionor 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 create 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 }}.24 25 \s ubsection{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:CFAActorSyntax}}. 24 25 \section{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 ubsection{\CFA Actor System}47 \section{\CFA Actors} 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 }\label{s:CFAActor}94 \section{\CFA Actor Syntax}\label{s:CFAActorSyntax} 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}$ 148 149 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}$ 153 154 int i; 154 @inline message;@ $\C{// Plan-9 C inheritance}$155 155 }; 156 void ?{}( int_msg & this, int i ) { this.i = i; } $\C{// constructor}$ 156 157 // behaviours 157 allocation receive( my_actor &, @str_msg & msg@ ) with(msg){158 sout | "string message \"" | str | "\"";158 allocation receive( my_actor &, @str_msg & msg@ ) { 159 sout | "string message \"" | msg.str | "\""; 159 160 return Nodelete; $\C{// actor not finished}$ 160 161 } 161 allocation receive( my_actor &, @int_msg & msg@ ) with(msg){162 sout | "integer message" | i;162 allocation receive( my_actor &, @int_msg & msg@ ) { 163 sout | "integer message" | msg.i; 163 164 return Nodelete; $\C{// actor not finished}$ 164 165 } 165 166 int main() { 167 start_actor_system(); $\C{// sets up executor}$ 168 my_actor actor; $\C{// default constructor call}$ 166 169 str_msg str_msg{ "Hello World" }; $\C{// constructor call}$ 167 170 int_msg int_msg{ 42 }; $\C{// constructor call}$ 168 start_actor_system(); $\C{// sets up executor}$ 169 my_actor actor; $\C{// default constructor call}$ 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)}$ 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)}$ 173 174 stop_actor_system(); $\C{// waits until actors finish}\CRT$ 174 175 } // deallocate int_msg, str_msg, actor 175 176 \end{cfa} 176 177 \caption{\CFA Actor Syntax} 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}.178 \label{f:CFAActorSyntax} 179 \end{figure} 180 181 Figure~\ref{f:CFAActorSyntax} 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 nominal inheritance discussed in Section~\ref{s:Inheritance}. 182 183 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. 183 Only @str_msg@ needs a constructor to copy the C string; 184 @int_msg@ is initialized using its \CFA auto-generated constructors. 184 Both message types have constructors to set the message value. 185 185 There are two matching @receive@ (behaviour) routines that process the corresponding typed messages. 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. 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. 194 191 The output for the program is: 195 192 \begin{cfa} … … 240 237 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. 241 238 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 262 239 \subsection{Actor System}\label{s:ActorSystem} 263 240 The calls to @start_actor_system@, and @stop_actor_system@ mark the start and end of a \CFA actor system. … … 281 258 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. 282 259 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 283 269 \subsection{Actor Send}\label{s:ActorSend} 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 270 All message sends are done using the left-shift operator, @<<@, similar to the syntax of \CC's stream output. 291 271 As stated, \CFA does not have named inheritance with RTTI. 292 272 \CFA does have a preliminary form of virtual routines, but it is not mature enough for use in this work. 293 Virtuals would provide a mechanism to write a single generic @?|?@ routine taking a base actor and message type, that would dynamically selectthe @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 correctactor/message type-signature.297 Th is approach requires no annotation or additional code to be written by users, thus it resolves the maintenance problem.273 Therefore, there is no mechanism to write a generic @<<@ routine taking a base actor and message type, and then dynamically selecting the @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 an actor/message type-signature. 277 Then, \CFA uses the type from the left-hand side of an assignment to select the matching receive routine. 298 278 (When the \CFA virtual routines mature, it should be possible to seamlessly transition to it from the template approach.) 299 279 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@. 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. 305 290 306 291 \begin{figure} 307 292 \begin{cfa} 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$ 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 ) } ); 319 306 return receiver; 320 307 } 321 308 \end{cfa} 322 309 \caption{Generated Send Operator} 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} 310 \label{f:actor_gen} 377 311 \end{figure} 378 312 … … 385 319 The goal is to achieve better performance and scalability for certain kinds of actor applications by reducing executor locking. 386 320 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}}. 387 322 388 323 \begin{figure} … … 395 330 396 331 Each executor thread iterates over its own message queues until it finds one with messages. 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. 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. 398 337 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. 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. 338 339 Processing a local queue involves removing a unit of work from the queue and executing it. 406 340 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. 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. 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}. 411 369 412 370 \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}.415 371 The copy queue is a thin layer over a dynamically sized array that is designed with the envelope use case in mind. 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)$.372 A copy queue supports the typical queue operations of push/pop but in a different way than a typical array based 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)$. 419 375 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. 420 376 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. … … 428 384 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. 429 385 One downside of this approach that more storage is allocated than needed, \ie each copy queue is only partially full. 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.386 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. 431 387 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. 432 388 … … 434 390 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. 435 391 However, this approach has a problem. 436 The high memory watermark nearly doubled!437 The issue ishighlighted with an example.392 The high memory usage watermark nearly doubled! 393 The issue can easily be highlighted with an example. 438 394 Assume a fixed throughput workload, where a queue never has more than 19 messages at a time. 439 395 If the copy queue starts with a size of 10, it ends up doubling at some point to size 20 to accommodate 19 messages. 440 396 However, after 2 gulps and subsequent reclamations the array size is 18. 441 397 The next time 19 messages are enqueued, the array size is doubled to 36! 442 To avoid this issue, a second check is added. 398 To avoid this issue a second check is added. 399 Each copy queue started tracking the utilization of its array size. 443 400 Reclamation only occurs if less than half of the array is utilized. 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}}. 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}. 446 404 447 405 \section{Work Stealing}\label{s:steal} 448 Work stealing is a scheduling strategy t o 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 406 Work stealing is a scheduling strategy that attempts to load balance, and increase resource utilization by having idle threads steal work. 407 There 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 452 410 \subsection{Stealing Mechanism} 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).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 actor system. 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 ended queues (dequeues). 415 Whenever an actor is moved to a ready queue, it is inserted into a worker's dequeue. 458 416 Workers then consume actors from the dequeue and execute their behaviours. 459 417 To steal work, thieves take one or more actors from a victim's dequeue. 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}}. 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. 465 421 466 422 % C_TODO: maybe insert stealing diagram 467 423 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: 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: 483 436 \begin{enumerate}[topsep=5pt,itemsep=3pt,parsep=0pt] 484 437 \item 485 The thief chooses a victim , which is trivial because all workers are stored in a shared array.438 The thief chooses a victim. 486 439 487 440 \item 488 441 The thief starts at a random index in the array of the victim's queues and searches for a candidate 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. 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. 503 454 \end{enumerate} 504 455 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. 505 458 The key to the stealing mechanism is that the queues can still be operated on while they are being swapped. 506 This functionality eliminates any contention among thieves and victims. 507 459 This eliminates any contention between thieves and victims. 508 460 The first key to this is that actors and workers maintain two distinct arrays of references to queues. 509 461 Actors will always receive messages via the same queues. … … 654 606 655 607 \subsection{Stealing Guarantees} 608 609 % C_TODO insert graphs for each proof 656 610 Given that the stealing operation can potentially fail, it is important to discuss the guarantees provided by the stealing implementation. 657 611 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. … … 795 749 Since the @Finished@ allocation status is unused for messages, it is used internally to detect if a message has been sent. 796 750 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 received798 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.799 751 \end{itemize} 800 752 -
doc/theses/colby_parsons_MMAth/text/mutex_stmt.tex
rc84dd61 r0b0a285 415 415 \begin{figure} 416 416 \centering 417 \captionsetup[subfloat]{labelfont=footnotesize,textfont=footnotesize}418 417 \subfloat[AMD]{ 419 418 \resizebox{0.5\textwidth}{!}{\input{figures/nasus_Aggregate_Lock_2.pgf}} … … 422 421 \resizebox{0.5\textwidth}{!}{\input{figures/pyke_Aggregate_Lock_2.pgf}} 423 422 } 424 \bigskip425 423 426 424 \subfloat[AMD]{ … … 430 428 \resizebox{0.5\textwidth}{!}{\input{figures/pyke_Aggregate_Lock_4.pgf}} 431 429 } 432 \bigskip433 430 434 431 \subfloat[AMD]{ -
driver/cfa.cc
rc84dd61 r0b0a285 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 9 14:36:41202313 // Update Count : 47 912 // Last Modified On : Tue May 30 10:47:52 2023 13 // Update Count : 478 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 instructions337 336 #endif // __ARM_ARCH 338 337 -
libcfa/prelude/builtins.c
rc84dd61 r0b0a285 149 149 150 150 static inline { 151 int ?\?( int x, unsigned int y ) { __CFA_EXP__(); }151 long 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 int ?\?( unsigned int x, unsigned int y ) { __CFA_EXP__(); }155 unsigned long 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 int ?\=?( int & x, unsigned int y ) { x = x \ y; return x; }178 long 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 int ?\=?( unsigned int & x, unsigned int y ) { x = x \ y; return x; }181 unsigned long 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
rc84dd61 r0b0a285 206 206 _Bool __sync_bool_compare_and_swap(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 207 207 #endif 208 // for all pointer types209 208 forall(T &) _Bool __sync_bool_compare_and_swap(T * volatile *, T *, T*, ...); 210 209 … … 224 223 unsigned __int128 __sync_val_compare_and_swap(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 225 224 #endif 226 // for all pointer types227 225 forall(T &) T * __sync_val_compare_and_swap(T * volatile *, T *, T*,...); 228 226 … … 328 326 void __atomic_exchange(volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, int); 329 327 #endif 330 // for all pointer types331 328 forall(T &) T * __atomic_exchange_n(T * volatile *, T *, int); 332 329 forall(T &) void __atomic_exchange(T * volatile *, T **, T **, int); … … 362 359 void __atomic_load(const volatile unsigned __int128 *, unsigned __int128 *, int); 363 360 #endif 364 // for all pointer types365 361 forall(T &) T * __atomic_load_n(T * const volatile *, int); 366 362 forall(T &) void __atomic_load(T * const volatile *, T **, int); … … 394 390 _Bool __atomic_compare_exchange (volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, _Bool, int, int); 395 391 #endif 396 // for all pointer types397 392 forall(T &) _Bool __atomic_compare_exchange_n (T * volatile *, T **, T*, _Bool, int, int); 398 393 forall(T &) _Bool __atomic_compare_exchange (T * volatile *, T **, T**, _Bool, int, int); … … 428 423 void __atomic_store(volatile unsigned __int128 *, unsigned __int128 *, int); 429 424 #endif 430 // for all pointer types431 425 forall(T &) void __atomic_store_n(T * volatile *, T *, int); 432 426 forall(T &) void __atomic_store(T * volatile *, T **, int); -
libcfa/src/common.hfa
rc84dd61 r0b0a285 32 32 } // extern "C" 33 33 static inline __attribute__((always_inline)) { 34 unsigned char abs( signed char v ) { return (int)abs( (int)v ); }34 unsigned char abs( signed char v ) { return 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 longint v2 ) { return v1 < v2 ? v1 : v2; }72 unsigned long int min( unsigned long int v1, unsigned 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 long longint 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; } 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
rc84dd61 r0b0a285 30 30 #define __DEFAULT_EXECUTOR_BUFSIZE__ 10 31 31 32 #define __STEAL 1// workstealing toggle. Disjoint from toggles above32 #define __STEAL 0 // 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 & , actor **, message **);48 typedef allocation (*__receive_fn)(actor &, message &); 49 49 struct request { 50 50 actor * receiver; 51 51 message * msg; 52 52 __receive_fn fn; 53 bool stop; 53 54 }; 54 55 55 struct a_msg { 56 int m; 57 }; 58 static inline void ?{}( request & this ) {} 56 static inline void ?{}( request & this ) { this.stop = true; } // default ctor makes a sentinel 59 57 static inline void ?{}( request & this, actor * receiver, message * msg, __receive_fn fn ) { 60 58 this.receiver = receiver; 61 59 this.msg = msg; 62 60 this.fn = fn; 61 this.stop = false; 63 62 } 64 63 static inline void ?{}( request & this, request & copy ) { … … 66 65 this.msg = copy.msg; 67 66 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) { 86 DEBUG_ABORT( count != 0, "Actor system terminated with messages sent but not received\n" ); 87 adelete(buffer); 88 } 85 static inline void ^?{}( copy_queue & this ) with(this) { adelete(buffer); } 89 86 90 87 static inline void insert( copy_queue & this, request & elem ) with(this) { … … 120 117 } 121 118 122 static inline bool is _empty( copy_queue & this ) with(this) { return count == 0; }119 static inline bool isEmpty( copy_queue & this ) with(this) { return count == 0; } 123 120 124 121 struct work_queue { … … 181 178 volatile unsigned long long stamp; 182 179 #ifdef ACTOR_STATS 183 size_t stolen_from, try_steal, stolen, empty_stolen,failed_swaps, msgs_stolen;180 size_t stolen_from, try_steal, stolen, failed_swaps, msgs_stolen; 184 181 unsigned long long processed; 185 182 size_t gulps; … … 194 191 this.gulps = 0; // number of gulps 195 192 this.failed_swaps = 0; // steal swap failures 196 this.empty_stolen = 0; // queues empty after steal197 193 this.msgs_stolen = 0; // number of messages stolen 198 194 #endif … … 214 210 #ifdef ACTOR_STATS 215 211 // aggregate counters for statistics 216 size_t __total_tries = 0, __total_stolen = 0, __total_workers, __all_gulps = 0, __total_empty_stolen = 0,212 size_t __total_tries = 0, __total_stolen = 0, __total_workers, __all_gulps = 0, 217 213 __total_failed_swaps = 0, __all_processed = 0, __num_actors_stats = 0, __all_msgs_stolen = 0; 218 214 #endif … … 239 235 unsigned int nprocessors, nworkers, nrqueues; // number of processors/threads/request queues 240 236 bool seperate_clus; // use same or separate cluster for executor 241 volatile bool is_shutdown; // flag to communicate shutdown to worker threads242 237 }; // executor 243 238 … … 253 248 __atomic_add_fetch(&__total_stolen, executor_->w_infos[id].stolen, __ATOMIC_SEQ_CST); 254 249 __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);256 250 257 251 // per worker steal stats (uncomment alongside the lock above this routine to print) … … 280 274 this.nrqueues = nrqueues; 281 275 this.seperate_clus = seperate_clus; 282 this.is_shutdown = false;283 276 284 277 if ( nworkers == nrqueues ) … … 329 322 330 323 static inline void ^?{}( executor & this ) with(this) { 331 is_shutdown = true; 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 332 337 333 338 for ( i; nworkers ) … … 360 365 size_t avg_gulps = __all_gulps == 0 ? 0 : __all_processed / __all_gulps; 361 366 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); 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);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); 364 369 size_t avg_steal = __total_stolen == 0 ? 0 : __all_msgs_stolen / __total_stolen; 365 370 printf("\tMessages stolen:\t\t\t%lu\n\tAverage steal size:\t\t\t%lu\n", __all_msgs_stolen, avg_steal); … … 444 449 static inline void check_message( message & this ) { 445 450 switch ( this.allocation_ ) { // analyze message status 446 case Nodelete: CFA_DEBUG( this.allocation_ = Finished); break;451 case Nodelete: CFA_DEBUG(this.allocation_ = Finished); break; 447 452 case Delete: delete( &this ); break; 448 case Destroy: ^?{}( this); break;453 case Destroy: ^?{}(this); break; 449 454 case Finished: break; 450 455 } // switch … … 456 461 static inline void deliver_request( request & this ) { 457 462 DEBUG_ABORT( this.receiver->ticket == (unsigned long int)MAX, "Attempted to send message to deleted/dead actor\n" ); 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 ); 463 this.receiver->allocation_ = this.fn( *this.receiver, *this.msg ); 464 check_message( *this.msg ); 465 check_actor( *this.receiver ); 464 466 } 465 467 … … 511 513 curr_steal_queue = request_queues[ i + vic_start ]; 512 514 // avoid empty queues and queues that are being operated on 513 if ( curr_steal_queue == 0p || curr_steal_queue->being_processed || is _empty( *curr_steal_queue->c_queue ) )515 if ( curr_steal_queue == 0p || curr_steal_queue->being_processed || isEmpty( *curr_steal_queue->c_queue ) ) 514 516 continue; 515 517 … … 519 521 executor_->w_infos[id].msgs_stolen += curr_steal_queue->c_queue->count; 520 522 executor_->w_infos[id].stolen++; 521 if ( is_empty( *curr_steal_queue->c_queue ) ) executor_->w_infos[id].empty_stolen++;522 523 // __atomic_add_fetch(&executor_->w_infos[victim_id].stolen_from, 1, __ATOMIC_RELAXED); 523 524 // replaced_queue[swap_idx]++; … … 559 560 } 560 561 561 #define CHECK_TERMINATION if ( unlikely( executor_->is_shutdown ) ) break Exit562 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 ( isEmpty( *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 ) ) { CHECK_TERMINATION; continue; }596 if ( isEmpty( *current_queue ) ) { 597 if ( unlikely( no_steal ) ) continue; 598 598 empty_count++; 599 599 if ( empty_count < steal_threshold ) continue; 600 600 empty_count = 0; 601 602 CHECK_TERMINATION; // check for termination603 601 604 602 __atomic_store_n( &executor_->w_infos[id].stamp, rdtscl(), __ATOMIC_RELAXED ); … … 612 610 } 613 611 #endif // __STEAL 614 while ( ! is _empty( *current_queue ) ) {612 while ( ! isEmpty( *current_queue ) ) { 615 613 #ifdef ACTOR_STATS 616 614 executor_->w_infos[id].processed++; … … 618 616 &req = &remove( *current_queue ); 619 617 if ( !&req ) continue; 618 if ( req.stop ) break Exit; 620 619 deliver_request( req ); 621 620 } … … 624 623 empty_count = 0; // we found work so reset empty counter 625 624 #endif 626 627 CHECK_TERMINATION;628 625 629 626 // potentially reclaim some of the current queue's vector space if it is unused … … 647 644 __all_gulps = 0; 648 645 __total_failed_swaps = 0; 649 __total_empty_stolen = 0;650 646 __all_processed = 0; 651 647 __num_actors_stats = 0; … … 661 657 } 662 658 663 static inline void start_actor_system() { start_actor_system( get_proc_count( *active_cluster() ) ); } 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 ); } 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 be unparkedwhen actor system is finished673 park( ); // will receive signal when actor system is finished 674 674 675 675 if ( !__actor_executor_passed ) delete( __actor_executor_ ); -
libcfa/src/concurrency/atomic.hfa
rc84dd61 r0b0a285 10 10 // Created On : Thu May 25 15:22:46 2023 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 14 07:48:57 202313 // Update Count : 5212 // Last Modified On : Fri Jun 9 13:36:47 2023 13 // Update Count : 46 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... ) ({ typeof(comp) __temp = (comp); __atomic_compare_exchange_n( &(assn), &(__temp), (replace), false, memorder ); }) 37 // #define CASM( assn, comp, replace, memorder... ) ({ \ 38 // typeof(comp) __temp = (comp); \ 39 // __atomic_compare_exchange_n( &(assn), &(__temp), (replace), false, memorder ); \ 40 // }) 38 41 #define CAS( assn, comp, replace ) (__sync_bool_compare_and_swap( &assn, comp, replace)) 39 42 #define CASM( assn, comp, replace, memorder... ) _Static_assert( false, "memory order unsupported for CAS macro" ); -
libcfa/src/concurrency/kernel.hfa
rc84dd61 r0b0a285 195 195 // Total number of processors 196 196 unsigned total; 197 198 // Number of processors constructed199 // incremented at construction time, total is incremented once the processor asyncronously registers200 unsigned constructed;201 197 202 198 // Total number of idle processors … … 301 297 static inline struct cluster * active_cluster () { return publicTLS_get( this_processor )->cltr; } 302 298 303 // gets the number of constructed processors on the cluster304 static inline unsigned get_proc_count( cluster & this ) { return this.procs.constructed; }305 306 299 // set the number of internal processors 307 300 // these processors are in addition to any explicitly declared processors -
libcfa/src/concurrency/kernel/cluster.hfa
rc84dd61 r0b0a285 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( (__readyQ_avg_t)intsc); }42 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2(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
rc84dd61 r0b0a285 528 528 this.name = name; 529 529 this.cltr = &_cltr; 530 __atomic_add_fetch( &_cltr.procs.constructed, 1u, __ATOMIC_RELAXED );531 530 this.rdq.its = 0; 532 531 this.rdq.itr = 0; … … 596 595 __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this); 597 596 598 __atomic_sub_fetch( &this.cltr->procs.constructed, 1u, __ATOMIC_RELAXED );599 600 597 __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED); 601 598 __disable_interrupts_checked(); … … 618 615 this.fdw = 0p; 619 616 this.idle = 0; 620 this.constructed = 0;621 617 this.total = 0; 622 618 } -
libcfa/src/concurrency/locks.hfa
rc84dd61 r0b0a285 35 35 #include <linux/futex.h> /* Definition of FUTEX_* constants */ 36 36 #include <sys/syscall.h> /* Definition of SYS_* constants */ 37 #include <unistd.h> /* Definition of syscall routine */37 #include <unistd.h> 38 38 39 39 typedef void (*__cfa_pre_park)( void * ); -
libcfa/src/fstream.cfa
rc84dd61 r0b0a285 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 08:51:12202313 // Update Count : 5 2812 // Last Modified On : Mon Jun 5 22:00:23 2023 13 // Update Count : 518 14 14 // 15 15 … … 169 169 if ( cnt == 9 ) abort( "ofstream fmt EINTR spinning exceeded" ); 170 170 } // for 171 if ( len == EOF ) { // error writing ? 172 abort | IO_MSG "invalid write"; 171 if ( len == EOF ) { 172 if ( ferror( (FILE *)(os.file$) ) ) { 173 abort | IO_MSG "invalid write"; 174 } // if 173 175 } // if 174 176 va_end( args ); … … 300 302 if ( len != EOF || errno != EINTR ) break; // timer interrupt ? 301 303 } // for 302 if ( len == EOF ) { // EOF or matching failure ?303 if ( ! feof( (FILE *)(is.file$) ) &&ferror( (FILE *)(is.file$) ) ) {304 if ( len == EOF ) { 305 if ( ferror( (FILE *)(is.file$) ) ) { 304 306 abort | IO_MSG "invalid read"; 305 307 } // if -
libcfa/src/iostream.hfa
rc84dd61 r0b0a285 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 15 22:34:31202313 // Update Count : 41 112 // Last Modified On : Thu Feb 2 11:25:39 2023 13 // Update Count : 410 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 trait writeable {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 notation165 unsigned char neg:1; // val is negative166 unsigned char pc:1; // precision specified167 unsigned char left:1; // left justify168 unsigned char nobsdp:1; // base prefix / decimal point169 unsigned char sign:1; // plus / minus sign170 unsigned char pad0:1; // zero pad171 };172 173 163 forall( T ) 174 164 struct _Ostream_Manip { … … 178 168 union { 179 169 unsigned char all; 180 _Ostream_Flags flags; 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; 181 179 }; 182 180 }; // _Ostream_Manip -
libcfa/src/math.hfa
rc84dd61 r0b0a285 10 10 // Created On : Mon Apr 18 23:37:04 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Jun 18 08:13:53 202313 // Update Count : 20212 // Last Modified On : Sat Oct 8 08:40:42 2022 13 // Update Count : 136 14 14 // 15 15 … … 236 236 237 237 return (i << 32) + (sum); 238 } // log2_u32_32238 } 239 239 240 240 //---------------------- Trigonometric ---------------------- … … 371 371 372 372 inline __attribute__((always_inline)) static { 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; } 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; } 384 383 385 384 // forall( T | { T ?/?( T, T ); T ?*?( T, T ); } ) 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 } 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 ); *} 439 415 440 416 float floor( float x ) { return floorf( x ); } -
libcfa/src/stdlib.hfa
rc84dd61 r0b0a285 367 367 368 368 char random( void ) { return (unsigned long int)random(); } 369 char random( char u ) { return (unsigned long int)random( (unsigned long int)u ); } // [0,u)369 char random( char u ) { return 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 (long int)random( (long int)u ); } // [0,u]372 int random( int u ) { return 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 (unsigned long int)random( (unsigned long int)u ); } // [0,u]375 unsigned int random( unsigned int u ) { return 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
rc84dd61 r0b0a285 25 25 __virtual_obj_start = &this; 26 26 } 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 27 static inline void __CFA_dtor_shutdown( virtual_dtor & this ) with(this) { 29 28 if ( __virtual_dtor_ptr ) { 30 29 void (*dtor_ptr)(virtual_dtor &) = __virtual_dtor_ptr; 31 30 __virtual_dtor_ptr = 0p; 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; 31 dtor_ptr(*((virtual_dtor *)__virtual_obj_start)); // replace actor with base type 32 return; 35 33 } 36 return false;37 34 } 38 35 static inline void __CFA_virt_free( virtual_dtor & this ) { free( this.__virtual_obj_start ); } -
src/AST/Convert.cpp
rc84dd61 r0b0a285 2343 2343 old->location, 2344 2344 GET_ACCEPT_1(arg, Expr), 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast, 2346 (ast::CastExpr::CastKind) old->kind 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast 2347 2346 ) 2348 2347 ); -
src/AST/Expr.cpp
rc84dd61 r0b0a285 186 186 // --- CastExpr 187 187 188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g , CastKind kind)189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ) , kind( kind ){}188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g ) 189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ) {} 190 190 191 191 bool CastExpr::get_lvalue() const { -
src/AST/Expr.hpp
rc84dd61 r0b0a285 55 55 const Expr * e ) 56 56 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} 57 58 operator bool() {return declptr;}59 57 }; 60 58 … … 337 335 GeneratedFlag isGenerated; 338 336 339 enum CastKind {340 Default, // C341 Coerce, // reinterpret cast342 Return // overload selection343 };344 345 CastKind kind = Default;346 347 337 CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, 348 GeneratedFlag g = GeneratedCast , CastKind kind = Default ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind) {}338 GeneratedFlag g = GeneratedCast ) : Expr( loc, to ), arg( a ), isGenerated( g ) {} 349 339 /// Cast-to-void 350 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast , CastKind kind = Default);340 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast ); 351 341 352 342 /// Wrap a cast expression around an existing expression (always generated) -
src/AST/SymbolTable.cpp
rc84dd61 r0b0a285 19 19 20 20 #include "Copy.hpp" 21 #include <iostream>22 #include <algorithm>23 24 21 #include "Decl.hpp" 25 22 #include "Expr.hpp" … … 206 203 out.push_back(decl.second); 207 204 } 208 209 // std::cerr << otypeKey << ' ' << out.size() << std::endl;210 205 } 211 206 -
src/AST/Type.hpp
rc84dd61 r0b0a285 451 451 bool operator==(const TypeEnvKey & other) const; 452 452 bool operator<(const TypeEnvKey & other) const; 453 operator bool() {return base;} 454 }; 455 453 }; 456 454 457 455 /// tuple type e.g. `[int, char]` -
src/AST/TypeEnvironment.cpp
rc84dd61 r0b0a285 135 135 } 136 136 } 137 //sub.normalize();137 sub.normalize(); 138 138 } 139 139 -
src/AST/TypeEnvironment.hpp
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 223 223 if ( actorIter != actorStructDecls.end() && messageIter != messageStructDecls.end() ) { 224 224 ////////////////////////////////////////////////////////////////////// 225 // The following generates this wrapper for all receive(derived_actor &, derived_msg &) functions226 /* base_actor and base_msg are output params227 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 pointer263 // put it all together into the complete function decl from above264 FunctionDecl * receiveWrapper = new FunctionDecl(265 decl->location,266 "__CFA_receive_wrap",267 {}, // forall268 {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 }, // params290 {291 new ObjectDecl(292 decl->location,293 "__CFA_receive_wrap_ret",294 new EnumInstType( *allocationDecl )295 )296 },297 wrapBody, // body298 { Storage::Static }, // storage299 Linkage::Cforall, // linkage300 {}, // attributes301 { Function::Inline }302 );303 304 declsToAddAfter.push_back( receiveWrapper );305 306 //////////////////////////////////////////////////////////////////////307 225 // The following generates this send message operator routine for all receive(derived_actor &, derived_msg &) functions 308 226 /* … … 328 246 )); 329 247 330 // Function type is: allocation (*)( derived_actor &, derived_msg & , actor **, message **)248 // Function type is: allocation (*)( derived_actor &, derived_msg & ) 331 249 FunctionType * derivedReceive = new FunctionType(); 332 250 derivedReceive->params.push_back( ast::deepCopy( derivedActorRef ) ); 333 251 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 ) ) ) );336 252 derivedReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 337 253 338 // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg & , actor **, message **) = receive;254 // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive; 339 255 sendBody->push_back( new DeclStmt( 340 256 decl->location, … … 343 259 "my_work_fn", 344 260 new PointerType( derivedReceive ), 345 new SingleInit( decl->location, new NameExpr( decl->location, " __CFA_receive_wrap" ) )261 new SingleInit( decl->location, new NameExpr( decl->location, "receive" ) ) 346 262 ) 347 263 )); … … 351 267 genericReceive->params.push_back( new ReferenceType( new StructInstType( *actorDecl ) ) ); 352 268 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 ) ) ) );355 269 genericReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 356 270 … … 371 285 )); 372 286 373 // Generates: new_req{ (actor *)&receiver, (message *)&msg, fn };287 // Generates: new_req{ &receiver, &msg, fn }; 374 288 sendBody->push_back( new ExprStmt( 375 289 decl->location, … … 379 293 { 380 294 new NameExpr( decl->location, "new_req" ), 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),295 new AddressExpr( new NameExpr( decl->location, "receiver" ) ), 296 new AddressExpr( new NameExpr( decl->location, "msg" ) ), 383 297 new NameExpr( decl->location, "fn" ) 384 298 } … … 407 321 FunctionDecl * sendOperatorFunction = new FunctionDecl( 408 322 decl->location, 409 "? |?",323 "?<<?", 410 324 {}, // forall 411 325 { -
src/GenPoly/SpecializeNew.cpp
rc84dd61 r0b0a285 113 113 using namespace ResolvExpr; 114 114 ast::OpenVarSet openVars, closedVars; 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 ); 115 ast::AssertionSet need, have; 116 findOpenVars( formalType, openVars, closedVars, need, have, FirstClosed ); 117 findOpenVars( actualType, openVars, closedVars, need, have, FirstOpen ); 119 118 for ( const ast::OpenVarSet::value_type & openVar : openVars ) { 120 119 const ast::Type * boundType = subs->lookup( openVar.first ); … … 126 125 if ( closedVars.find( *inst ) == closedVars.end() ) { 127 126 return true; 128 }129 else {130 assertf(false, "closed: %s", inst->name.c_str());131 127 } 132 128 // Otherwise, the variable is bound to a concrete type. -
src/Parser/DeclarationNode.cc
rc84dd61 r0b0a285 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Jun 17 14:41:48202313 // Update Count : 1 40511 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Apr 20 11:46:00 2023 13 // Update Count : 1393 14 14 // 15 15 … … 459 459 std::vector<ast::ptr<ast::Expr>> exprs; 460 460 buildList( expr, exprs ); 461 newnode->attributes.push_back( new ast::Attribute( *name, std::move( exprs ) ) ); 461 newnode->attributes.push_back( 462 new ast::Attribute( *name, std::move( exprs ) ) ); 462 463 delete name; 463 464 return newnode; … … 632 633 dst->basictype = src->basictype; 633 634 } else if ( src->basictype != DeclarationNode::NoBasicType ) 634 SemanticError( yylloc, string( "multiple declaration types \"" ) + DeclarationNode::basicTypeNames[ dst->basictype ] + 635 "\" and \"" + DeclarationNode::basicTypeNames[ src->basictype ] + "\"." ); 635 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::basicTypeNames[ src->basictype ] + " in type: " ); 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, string( "multiple declaration types \"" ) + DeclarationNode::complexTypeNames[ src->complextype ] + 641 "\" and \"" + DeclarationNode::complexTypeNames[ src->complextype ] + "\"." ); 640 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::complexTypeNames[ src->complextype ] + " in type: " ); 642 641 643 642 if ( dst->signedness == DeclarationNode::NoSignedness ) { 644 643 dst->signedness = src->signedness; 645 644 } else if ( src->signedness != DeclarationNode::NoSignedness ) 646 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::signednessNames[ dst->signedness ] + 647 "\" and \"" + DeclarationNode::signednessNames[ src->signedness ] + "\"." ); 645 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::signednessNames[ src->signedness ] + " in type: " ); 648 646 649 647 if ( dst->length == DeclarationNode::NoLength ) { … … 652 650 dst->length = DeclarationNode::LongLong; 653 651 } else if ( src->length != DeclarationNode::NoLength ) 654 SemanticError( yylloc, string( "conflicting type specifier \"" ) + DeclarationNode::lengthNames[ dst->length ] + 655 "\" and \"" + DeclarationNode::lengthNames[ src->length ] + "\"." ); 652 SemanticError( yylloc, src, string( "conflicting type specifier " ) + DeclarationNode::lengthNames[ src->length ] + " in type: " ); 656 653 } // if 657 654 break; … … 721 718 722 719 DeclarationNode * DeclarationNode::addEnumBase( DeclarationNode * o ) { 723 if ( o && o ->type) {720 if ( o && o -> type) { 724 721 type->base= o->type; 725 } // if722 } 726 723 delete o; 727 724 return this; … … 1006 1003 } 1007 1004 1008 // If a typedef wraps an anonymous declaration, name the inner declaration so it has a consistent name across1009 // translation units.1005 // If a typedef wraps an anonymous declaration, name the inner declaration 1006 // so it has a consistent name across translation units. 1010 1007 static void nameTypedefedDecl( 1011 1008 DeclarationNode * innerDecl, … … 1088 1085 } 1089 1086 1090 void buildList( DeclarationNode * firstNode, std::vector<ast::ptr<ast::Decl>> & outputList ) { 1087 void buildList( DeclarationNode * firstNode, 1088 std::vector<ast::ptr<ast::Decl>> & outputList ) { 1091 1089 SemanticErrorException errors; 1092 1090 std::back_insert_iterator<std::vector<ast::ptr<ast::Decl>>> out( outputList ); -
src/Parser/ExpressionNode.cc
rc84dd61 r0b0a285 601 601 ast::Expr * build_cast( const CodeLocation & location, 602 602 DeclarationNode * decl_node, 603 ExpressionNode * expr_node, 604 ast::CastExpr::CastKind kind ) { 603 ExpressionNode * expr_node ) { 605 604 ast::Type * targetType = maybeMoveBuildType( decl_node ); 606 605 if ( dynamic_cast<ast::VoidType *>( targetType ) ) { … … 608 607 return new ast::CastExpr( location, 609 608 maybeMoveBuild( expr_node ), 610 ast::ExplicitCast , kind);609 ast::ExplicitCast ); 611 610 } else { 612 611 return new ast::CastExpr( location, 613 612 maybeMoveBuild( expr_node ), 614 613 targetType, 615 ast::ExplicitCast , kind);614 ast::ExplicitCast ); 616 615 } // if 617 616 } // build_cast -
src/Parser/ExpressionNode.h
rc84dd61 r0b0a285 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 , ast::CastExpr::CastKind kind = ast::CastExpr::Default);71 ast::Expr * build_cast( const CodeLocation &, DeclarationNode * decl_node, ExpressionNode * expr_node ); 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
rc84dd61 r0b0a285 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 18:53:24202313 // Update Count : 634 712 // Last Modified On : Wed Jun 7 14:32:28 2023 13 // Update Count : 6341 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 { $$ = new ExpressionNode( build_cast( yylloc, $3, $5, ast::CastExpr::Return ) ); }933 { SemanticError( yylloc, "Return cast is currently unimplemented." ); $$ = nullptr; } 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 ->clone(), $4 ) ); }1042 { $$ = new ExpressionNode( build_cond( yylloc, $1, $1, $4 ) ); } 1043 1043 ; 1044 1044 -
src/ResolvExpr/Candidate.hpp
rc84dd61 r0b0a285 91 91 92 92 /// Holdover behaviour from old `findMinCost` -- xxx -- can maybe be eliminated? 93 /*94 93 static inline void promoteCvtCost( CandidateList & candidates ) { 95 94 for ( CandidateRef & r : candidates ) { … … 97 96 } 98 97 } 99 */100 98 101 99 void print( std::ostream & os, const Candidate & cand, Indenter indent = {} ); -
src/ResolvExpr/CandidateFinder.cpp
rc84dd61 r0b0a285 38 38 #include "typeops.h" // for combos 39 39 #include "Unify.h" 40 #include "WidenMode.h"41 40 #include "AST/Expr.hpp" 42 41 #include "AST/Node.hpp" … … 750 749 // attempt to narrow based on expected target type 751 750 const ast::Type * returnType = funcType->returns.front(); 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 } 751 if ( ! unify( 752 returnType, targetType, funcEnv, funcNeed, funcHave, funcOpen ) 753 ) { 754 // unification failed, do not pursue this candidate 755 return; 767 756 } 768 757 } … … 782 771 for (size_t i=0; i<nParams; ++i) { 783 772 auto obj = funcDecl->params[i].strict_as<ast::ObjectDecl>(); 784 if ( !instantiateArgument( location,773 if (!instantiateArgument( location, 785 774 funcType->params[i], obj->init, args, results, genStart, symtab)) return; 786 775 } … … 792 781 // matches 793 782 // no default args for indirect calls 794 if ( ! instantiateArgument( location,783 if ( ! instantiateArgument( location, 795 784 param, nullptr, args, results, genStart, symtab ) ) return; 796 785 } … … 885 874 886 875 if ( auto structInst = aggrExpr->result.as< ast::StructInstType >() ) { 887 addAggMembers( structInst, aggrExpr, *cand, Cost:: unsafe, "" );876 addAggMembers( structInst, aggrExpr, *cand, Cost::safe, "" ); 888 877 } else if ( auto unionInst = aggrExpr->result.as< ast::UnionInstType >() ) { 889 addAggMembers( unionInst, aggrExpr, *cand, Cost:: unsafe, "" );878 addAggMembers( unionInst, aggrExpr, *cand, Cost::safe, "" ); 890 879 } 891 880 } … … 1018 1007 if ( auto pointer = dynamic_cast< const ast::PointerType * >( funcResult ) ) { 1019 1008 if ( auto function = pointer->base.as< ast::FunctionType >() ) { 1020 // if (!selfFinder.allowVoid && function->returns.empty()) continue;1021 1009 CandidateRef newFunc{ new Candidate{ *func } }; 1022 1010 newFunc->expr = … … 1030 1018 if ( const ast::EqvClass * clz = func->env.lookup( *inst ) ) { 1031 1019 if ( auto function = clz->bound.as< ast::FunctionType >() ) { 1032 CandidateRef newFunc ( new Candidate( *func ) );1020 CandidateRef newFunc{ new Candidate{ *func } }; 1033 1021 newFunc->expr = 1034 1022 referenceToRvalueConversion( newFunc->expr, newFunc->cost ); … … 1072 1060 if ( found.empty() && ! errors.isEmpty() ) { throw errors; } 1073 1061 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 1079 1062 // Compute conversion costs 1080 1063 for ( CandidateRef & withFunc : found ) { … … 1099 1082 if ( cvtCost != Cost::infinity ) { 1100 1083 withFunc->cvtCost = cvtCost; 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 ); 1084 candidates.emplace_back( std::move( withFunc ) ); 1085 } 1086 } 1118 1087 found = std::move( candidates ); 1119 1088 1120 1089 // use a new list so that candidates are not examined by addAnonConversions twice 1121 //CandidateList winners = findMinCost( found );1122 //promoteCvtCost( winners );1090 CandidateList winners = findMinCost( found ); 1091 promoteCvtCost( winners ); 1123 1092 1124 1093 // function may return a struct/union value, in which case we need to add candidates 1125 1094 // for implicit conversions to each of the anonymous members, which must happen after 1126 1095 // `findMinCost`, since anon conversions are never the cheapest 1127 for ( const CandidateRef & c : found) {1096 for ( const CandidateRef & c : winners ) { 1128 1097 addAnonConversions( c ); 1129 1098 } 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 ) { 1099 spliceBegin( candidates, winners ); 1100 1101 if ( candidates.empty() && targetType && ! targetType->isVoid() ) { 1134 1102 // If resolution is unsuccessful with a target type, try again without, since it 1135 1103 // will sometimes succeed when it wouldn't with a target type binding. … … 1172 1140 1173 1141 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 }1184 1142 finder.find( castExpr->arg, ResolvMode::withAdjustment() ); 1185 1143 … … 1187 1145 1188 1146 CandidateList matches; 1189 Cost minExprCost = Cost::infinity;1190 Cost minCastCost = Cost::infinity;1191 1147 for ( CandidateRef & cand : finder.candidates ) { 1192 1148 ast::AssertionSet need( cand->need.begin(), cand->need.end() ), have; … … 1220 1176 // count one safe conversion for each value that is thrown away 1221 1177 thisCost.incSafe( discardedValues ); 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 ); 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 ); 1249 1190 } 1250 1191 … … 1512 1453 // candidates for true result 1513 1454 CandidateFinder finder2( context, tenv ); 1514 finder2.allowVoid = true;1515 1455 finder2.find( conditionalExpr->arg2, ResolvMode::withAdjustment() ); 1516 1456 if ( finder2.candidates.empty() ) return; … … 1518 1458 // candidates for false result 1519 1459 CandidateFinder finder3( context, tenv ); 1520 finder3.allowVoid = true;1521 1460 finder3.find( conditionalExpr->arg3, ResolvMode::withAdjustment() ); 1522 1461 if ( finder3.candidates.empty() ) return; … … 1585 1524 void Finder::postvisit( const ast::ConstructorExpr * ctorExpr ) { 1586 1525 CandidateFinder finder( context, tenv ); 1587 finder.allowVoid = true;1588 1526 finder.find( ctorExpr->callExpr, ResolvMode::withoutPrune() ); 1589 1527 for ( CandidateRef & r : finder.candidates ) { … … 1702 1640 CandidateFinder finder( context, tenv, toType ); 1703 1641 finder.find( initExpr->expr, ResolvMode::withAdjustment() ); 1704 1705 Cost minExprCost = Cost::infinity;1706 Cost minCastCost = Cost::infinity;1707 1642 for ( CandidateRef & cand : finder.candidates ) { 1708 1643 if (reason.code == NotFound) reason.code = NoMatch; … … 1742 1677 // count one safe conversion for each value that is thrown away 1743 1678 thisCost.incSafe( discardedValues ); 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 } 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 ); 1762 1685 } 1763 1686 } … … 1765 1688 1766 1689 // select first on argument cost, then conversion cost 1767 // CandidateList minArgCost = findMinCost( matches ); 1768 // promoteCvtCost( minArgCost ); 1769 // candidates = findMinCost( minArgCost ); 1770 candidates = std::move(matches); 1690 CandidateList minArgCost = findMinCost( matches ); 1691 promoteCvtCost( minArgCost ); 1692 candidates = findMinCost( minArgCost ); 1771 1693 } 1772 1694 … … 1834 1756 auto found = selected.find( mangleName ); 1835 1757 if ( found != selected.end() ) { 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) ) { 1758 if ( newCand->cost < found->second.candidate->cost ) { 1842 1759 PRINT( 1843 1760 std::cerr << "cost " << newCand->cost << " beats " … … 1846 1763 1847 1764 found->second = PruneStruct{ newCand }; 1848 } else if ( newCand->cost == found->second.candidate->cost && newCand->cvtCost == found->second.candidate->cvtCost) {1765 } else if ( newCand->cost == found->second.candidate->cost ) { 1849 1766 // if one of the candidates contains a deleted identifier, can pick the other, 1850 1767 // since deleted expressions should not be ambiguous if there is another option … … 1937 1854 */ 1938 1855 1939 // optimization: don't prune for NameExpr since it never has cost 1940 if ( mode.prune && !dynamic_cast<const ast::NameExpr *>(expr) ) { 1856 if ( mode.prune ) { 1941 1857 // trim candidates to single best one 1942 1858 PRINT( -
src/ResolvExpr/CandidateFinder.hpp
rc84dd61 r0b0a285 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)37 35 std::set< std::string > otypeKeys; /// different type may map to same key 38 36 -
src/ResolvExpr/CastCost.cc
rc84dd61 r0b0a285 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 }239 236 return Cost::zero; 240 237 } else if ( dynamic_cast< const ast::VoidType * >( dst ) ) { -
src/ResolvExpr/CommonType.cc
rc84dd61 r0b0a285 697 697 if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) { 698 698 #warning remove casts when `commonTypes` moved to new AST 699 700 /*701 699 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ]; 702 700 if ( … … 708 706 result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers }; 709 707 } 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.second714 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 722 708 } else if ( 723 709 dynamic_cast< const ast::ZeroType * >( type2 ) … … 726 712 #warning remove casts when `commonTypes` moved to new AST 727 713 ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ]; 728 /* 729 if ( // xxx - what does qualifier even do here?? 730 ( ( basic->qualifiers >= type2->qualifiers ) 714 if ( 715 ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) 731 716 || widen.first ) 732 && ( ( /*kind != basic->kind && basic->qualifiers <= type2->qualifiers )717 && ( ( kind != basic->kind && basic->qualifiers <= type2->qualifiers ) 733 718 || widen.second ) 734 ) 735 */ 736 if (widen.second) { 737 result = new ast::BasicType{ basic->kind, basic->qualifiers | type2->qualifiers }; 719 ) { 720 result = new ast::BasicType{ kind, basic->qualifiers | type2->qualifiers }; 738 721 } 739 722 } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) { … … 763 746 auto entry = open.find( *var ); 764 747 if ( entry != open.end() ) { 765 // if (tenv.lookup(*var)) {766 748 ast::AssertionSet need, have; 767 749 if ( ! tenv.bindVar( -
src/ResolvExpr/ConversionCost.cc
rc84dd61 r0b0a285 702 702 703 703 cost = costCalc( refType->base, dst, srcIsLvalue, symtab, env ); 704 705 // xxx - should qualifiers be considered in pass-by-value?706 /*707 704 if ( refType->base->qualifiers == dst->qualifiers ) { 708 705 cost.incReference(); … … 712 709 cost.incUnsafe(); 713 710 } 714 */715 cost.incReference();716 711 } 717 712 … … 797 792 cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] ); 798 793 } 799 // this has the effect of letting any expr such as x+0, x+1 to be typed800 // the same as x, instead of at least int. are we willing to sacrifice this little801 // 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;804 794 } else if ( dynamic_cast< const ast::PointerType * >( dst ) ) { 805 795 cost = Cost::zero; 806 796 // +1 for zero_t ->, +1 for disambiguation 807 797 cost.incSafe( maxIntCost + 2 ); 808 // assuming 0p is supposed to be used for pointers?809 798 } 810 799 } … … 815 804 cost = Cost::zero; 816 805 } else if ( const ast::BasicType * dstAsBasic = 817 dynamic_cast< const ast::BasicType * >( dst ) ) { 806 dynamic_cast< const ast::BasicType * >( dst ) ) { 818 807 int tableResult = costMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ]; 819 808 if ( -1 == tableResult ) { … … 824 813 cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] ); 825 814 } 826 827 // cost = Cost::zero;828 815 } 829 816 } -
src/ResolvExpr/FindOpenVars.cc
rc84dd61 r0b0a285 21 21 #include "AST/Pass.hpp" 22 22 #include "AST/Type.hpp" 23 #include "AST/TypeEnvironment.hpp"24 23 #include "Common/PassVisitor.h" 25 24 #include "SynTree/Declaration.h" // for TypeDecl, DeclarationWithType (ptr ... 26 25 #include "SynTree/Type.h" // for Type, Type::ForallList, ArrayType 27 28 #include <iostream>29 26 30 27 namespace ResolvExpr { … … 105 102 ast::AssertionSet & need; 106 103 ast::AssertionSet & have; 107 ast::TypeEnvironment & env;108 104 bool nextIsOpen; 109 105 110 106 FindOpenVars_new( 111 107 ast::OpenVarSet & o, ast::OpenVarSet & c, ast::AssertionSet & n, 112 ast::AssertionSet & h, ast::TypeEnvironment & env,FirstMode firstIsOpen )113 : open( o ), closed( c ), need( n ), have( h ), env (env),nextIsOpen( firstIsOpen ) {}108 ast::AssertionSet & h, FirstMode firstIsOpen ) 109 : open( o ), closed( c ), need( n ), have( h ), nextIsOpen( firstIsOpen ) {} 114 110 115 111 void previsit( const ast::FunctionType * type ) { 116 112 // mark open/closed variables 117 113 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 124 114 for ( auto & decl : type->forall ) { 125 115 open[ *decl ] = ast::TypeData{ decl->base }; … … 147 137 void findOpenVars( 148 138 const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 149 ast::AssertionSet & need, ast::AssertionSet & have, ast::TypeEnvironment & env,FirstMode firstIsOpen ) {150 ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, env,firstIsOpen };139 ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen ) { 140 ast::Pass< FindOpenVars_new > finder{ open, closed, need, have, firstIsOpen }; 151 141 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 }160 142 } 161 143 } // namespace ResolvExpr -
src/ResolvExpr/FindOpenVars.h
rc84dd61 r0b0a285 33 33 void findOpenVars( 34 34 const ast::Type * type, ast::OpenVarSet & open, ast::OpenVarSet & closed, 35 ast::AssertionSet & need, ast::AssertionSet & have, ast::TypeEnvironment & env,FirstMode firstIsOpen );35 ast::AssertionSet & need, ast::AssertionSet & have, FirstMode firstIsOpen ); 36 36 } // namespace ResolvExpr 37 37 -
src/ResolvExpr/Resolver.cc
rc84dd61 r0b0a285 1011 1011 ast::TypeEnvironment env; 1012 1012 CandidateFinder finder( context, env ); 1013 finder.allowVoid = true;1014 1013 finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode ); 1015 1014 --recursion_level; … … 1055 1054 1056 1055 // promote candidate.cvtCost to .cost 1057 //promoteCvtCost( winners );1056 promoteCvtCost( winners ); 1058 1057 1059 1058 // produce ambiguous errors, if applicable -
src/ResolvExpr/SatisfyAssertions.cpp
rc84dd61 r0b0a285 16 16 #include "SatisfyAssertions.hpp" 17 17 18 #include <iostream>19 18 #include <algorithm> 20 19 #include <cassert> … … 46 45 #include "SymTab/Mangler.h" 47 46 48 49 50 47 namespace ResolvExpr { 51 48 … … 68 65 ast::AssertionSet && h, ast::AssertionSet && n, ast::OpenVarSet && o, ast::UniqueId rs ) 69 66 : cdata( c ), adjType( at ), env( std::move( e ) ), have( std::move( h ) ), 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 } 67 need( std::move( n ) ), open( std::move( o ) ), resnSlot( rs ) {} 75 68 }; 76 69 … … 146 139 }; 147 140 148 enum AssertionResult {Fail, Skip, Success} ; 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 } 149 147 150 148 /// Binds a single assertion, updating satisfaction state … … 157 155 "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() ); 158 156 159 ast::Expr * varExpr = match.cdata.combine( cand->expr->location, cand->c ost );157 ast::Expr * varExpr = match.cdata.combine( cand->expr->location, cand->cvtCost ); 160 158 varExpr->result = match.adjType; 161 159 if ( match.resnSlot ) { varExpr->inferred.resnSlots().emplace_back( match.resnSlot ); } … … 167 165 168 166 /// Satisfy a single assertion 169 AssertionResult satisfyAssertion( ast::AssertionList::value_type & assn, SatState & sat, bool skipUnbound = false) {167 bool satisfyAssertion( ast::AssertionList::value_type & assn, SatState & sat, bool allowConversion = false, bool skipUnbound = false) { 170 168 // skip unused assertions 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 169 if ( ! assn.second.isUsed ) return true; 175 170 176 171 // find candidates that unify with the desired type 177 AssnCandidateList matches , inexactMatches;172 AssnCandidateList matches; 178 173 179 174 std::vector<ast::SymbolTable::IdData> candidates; … … 184 179 .strict_as<ast::FunctionType>()->params[0] 185 180 .strict_as<ast::ReferenceType>()->base; 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 } 181 sat.cand->env.apply(thisArgType); 192 182 193 183 std::string otypeKey = ""; 194 184 if (thisArgType.as<ast::PointerType>()) otypeKey = Mangle::Encoding::pointer; 195 185 else if (!isUnboundType(thisArgType)) otypeKey = Mangle::mangle(thisArgType, Mangle::Type | Mangle::NoGenericParams); 196 else if (skipUnbound) return AssertionResult::Skip;186 else if (skipUnbound) return false; 197 187 198 188 candidates = sat.symtab.specialLookupId(kind, otypeKey); … … 222 212 223 213 ast::OpenVarSet closed; 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(); 214 findOpenVars( toType, newOpen, closed, newNeed, have, FirstClosed ); 215 findOpenVars( adjType, newOpen, closed, newNeed, have, FirstOpen ); 216 if ( allowConversion ) { 244 217 if ( auto c = commonType( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) { 245 218 // set up binding slot for recursive assertions … … 250 223 } 251 224 252 inexactMatches.emplace_back(225 matches.emplace_back( 253 226 cdata, adjType, std::move( newEnv ), std::move( have ), std::move( newNeed ), 254 227 std::move( newOpen ), crntResnSlot ); 255 228 } 256 229 } 230 else { 231 if ( unifyExact( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) { 232 // set up binding slot for recursive assertions 233 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 } 257 244 } 258 245 259 246 // break if no satisfying match 260 if ( matches.empty() ) matches = std::move(inexactMatches); 261 if ( matches.empty() ) return AssertionResult::Fail; 247 if ( matches.empty() ) return false; 262 248 263 249 // defer if too many satisfying matches 264 250 if ( matches.size() > 1 ) { 265 251 sat.deferred.emplace_back( assn.first, assn.second, std::move( matches ) ); 266 return AssertionResult::Success;252 return true; 267 253 } 268 254 269 255 // otherwise bind unique match in ongoing scope 270 256 AssnCandidate & match = matches.front(); 271 //addToSymbolTable( match.have, sat.symtab );257 addToSymbolTable( match.have, sat.symtab ); 272 258 sat.newNeed.insert( match.need.begin(), match.need.end() ); 273 259 sat.cand->env = std::move( match.env ); … … 275 261 276 262 bindAssertion( assn.first, assn.second, sat.cand, match, sat.inferred ); 277 return AssertionResult::Success;263 return true; 278 264 } 279 265 … … 452 438 // for each current mutually-compatible set of assertions 453 439 for ( SatState & sat : sats ) { 440 bool allowConversion = false; 454 441 // stop this branch if a better option is already found 455 442 auto it = thresholds.find( pruneKey( *sat.cand ) ); … … 460 447 for (unsigned resetCount = 0; ; ++resetCount) { 461 448 ast::AssertionList next; 449 resetTyVarRenaming(); 462 450 // make initial pass at matching assertions 463 451 for ( auto & assn : sat.need ) { 464 resetTyVarRenaming();465 452 // fail early if any assertion is not satisfiable 466 auto result = satisfyAssertion( assn, sat, !next.empty() ); 467 if ( result == AssertionResult::Fail ) { 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) { 468 463 Indenter tabs{ 3 }; 469 464 std::ostringstream ss; … … 471 466 print( ss, *sat.cand, ++tabs ); 472 467 ss << (tabs-1) << "Could not satisfy assertion:\n"; 473 ast::print( ss, assn.first, tabs );468 ast::print( ss, next[0].first, tabs ); 474 469 475 470 errors.emplace_back( ss.str() ); 476 471 goto nextSat; 477 472 } 478 else if ( result == AssertionResult::Skip ) { 479 next.emplace_back(assn); 480 // goto nextSat; 481 } 482 } 483 // success 484 if (next.empty()) break; 485 473 474 else { 475 allowConversion = true; 476 continue; 477 } 478 } 479 allowConversion = false; 486 480 sat.need = std::move(next); 487 481 } … … 537 531 sat.cand->expr, std::move( compat.env ), std::move( compat.open ), 538 532 ast::AssertionSet{} /* need moved into satisfaction state */, 539 sat.cand->cost );533 sat.cand->cost, sat.cand->cvtCost ); 540 534 541 535 ast::AssertionSet nextNewNeed{ sat.newNeed }; … … 550 544 for ( DeferRef r : compat.assns ) { 551 545 AssnCandidate match = r.match; 552 //addToSymbolTable( match.have, nextSymtab );546 addToSymbolTable( match.have, nextSymtab ); 553 547 nextNewNeed.insert( match.need.begin(), match.need.end() ); 554 548 -
src/ResolvExpr/Unify.cc
rc84dd61 r0b0a285 160 160 env.apply( newSecond ); 161 161 162 //findOpenVars( newFirst, open, closed, need, have, FirstClosed );163 findOpenVars( newSecond, open, closed, need, have, newEnv,FirstOpen );162 findOpenVars( newFirst, open, closed, need, have, FirstClosed ); 163 findOpenVars( newSecond, open, closed, need, have, 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) 967 this->result = otherInst; 966 if (otherInst && inst->name == otherInst->name) this->result = otherInst; 968 967 return otherInst; 969 968 } … … 1050 1049 1051 1050 void postvisit( const ast::TypeInstType * typeInst ) { 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; 1051 assert( open.find( *typeInst ) == open.end() ); 1052 handleRefType( typeInst, type2 ); 1057 1053 } 1058 1054 … … 1165 1161 ) { 1166 1162 ast::OpenVarSet closed; 1167 //findOpenVars( type1, open, closed, need, have, FirstClosed );1168 findOpenVars( type2, open, closed, need, have, env,FirstOpen );1163 findOpenVars( type1, open, closed, need, have, FirstClosed ); 1164 findOpenVars( type2, open, closed, need, have, FirstOpen ); 1169 1165 return unifyInexact( 1170 1166 type1, type2, env, need, have, open, WidenMode{ true, true }, common ); … … 1183 1179 entry1 = var1 ? open.find( *var1 ) : open.end(), 1184 1180 entry2 = var2 ? open.find( *var2 ) : open.end(); 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 /* 1181 bool isopen1 = entry1 != open.end(); 1182 bool isopen2 = entry2 != open.end(); 1183 1191 1184 if ( isopen1 && isopen2 ) { 1192 1185 if ( entry1->second.kind != entry2->second.kind ) return false; … … 1197 1190 return env.bindVar( var1, type2, entry1->second, need, have, open, widen ); 1198 1191 } else if ( isopen2 ) { 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 { 1192 return env.bindVar( var2, type1, entry2->second, need, have, open, widen ); 1193 } else { 1211 1194 return ast::Pass<Unify_new>::read( 1212 1195 type1, type2, env, need, have, open, widen ); 1213 1196 } 1214 1215 1197 } 1216 1198 -
src/SynTree/Expression.cc
rc84dd61 r0b0a285 267 267 } 268 268 269 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated , CastKind kind ) : arg(arg), isGenerated( isGenerated ), kind( kind ) {269 CastExpr::CastExpr( Expression * arg, Type * toType, bool isGenerated ) : arg(arg), isGenerated( isGenerated ) { 270 270 set_result(toType); 271 271 } 272 272 273 CastExpr::CastExpr( Expression * arg, bool isGenerated , CastKind kind ) : arg(arg), isGenerated( isGenerated ), kind( kind ) {273 CastExpr::CastExpr( Expression * arg, bool isGenerated ) : arg(arg), isGenerated( isGenerated ) { 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 ) , kind( other.kind ){277 CastExpr::CastExpr( const CastExpr & other ) : Expression( other ), arg( maybeClone( other.arg ) ), isGenerated( other.isGenerated ) { 278 278 } 279 279 -
src/SynTree/Expression.h
rc84dd61 r0b0a285 271 271 bool isGenerated = true; 272 272 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 ); 273 CastExpr( Expression * arg, bool isGenerated = true ); 274 CastExpr( Expression * arg, Type * toType, bool isGenerated = true ); 283 275 CastExpr( Expression * arg, void * ) = delete; // prevent accidentally passing pointers for isGenerated in the first constructor 284 276 CastExpr( const CastExpr & other ); -
src/Tuples/TupleAssignment.cc
rc84dd61 r0b0a285 679 679 680 680 ResolvExpr::CandidateFinder finder( crntFinder.context, matcher->env ); 681 finder.allowVoid = true;682 681 683 682 try { -
src/Validate/Autogen.cpp
rc84dd61 r0b0a285 321 321 void FuncGenerator::produceDecl( const ast::FunctionDecl * decl ) { 322 322 assert( nullptr != decl->stmts ); 323 assert( decl->type_params.size() == getGenericParams( type ).size() );324 323 325 324 definitions.push_back( decl ); … … 357 356 decl->init = nullptr; 358 357 splice( assertions, decl->assertions ); 359 oldToNew.emplace( old_param, decl);358 oldToNew.emplace( std::make_pair( old_param, decl ) ); 360 359 type_params.push_back( decl ); 361 360 } … … 523 522 InitTweak::InitExpander_new srcParam( src ); 524 523 // Assign to destination. 525 ast:: MemberExpr * dstSelect = new ast::MemberExpr(524 ast::Expr * dstSelect = new ast::MemberExpr( 526 525 location, 527 526 field, … … 575 574 } 576 575 577 ast:: MemberExpr * srcSelect = (srcParam) ? new ast::MemberExpr(576 ast::Expr * srcSelect = (srcParam) ? new ast::MemberExpr( 578 577 location, field, new ast::VariableExpr( location, srcParam ) 579 578 ) : nullptr; -
src/Validate/GenericParameter.cpp
rc84dd61 r0b0a285 120 120 } 121 121 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: 122 struct ValidateGenericParamsCore : public ast::WithCodeLocation { 132 123 const ast::StructInstType * previsit( const ast::StructInstType * type ) { 133 124 assert( location ); … … 138 129 assert( location ); 139 130 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 }161 131 } 162 132 }; -
src/Validate/LinkReferenceToTypes.cpp
rc84dd61 r0b0a285 84 84 // Just linking in the node. 85 85 auto mut = ast::mutate( type ); 86 mut->base = decl;86 mut->base = const_cast<ast::EnumDecl *>( decl ); 87 87 type = mut; 88 88 } … … 101 101 // Just linking in the node. 102 102 auto mut = ast::mutate( type ); 103 mut->base = decl;103 mut->base = const_cast<ast::StructDecl *>( decl ); 104 104 type = mut; 105 105 } … … 118 118 // Just linking in the node. 119 119 auto mut = ast::mutate( type ); 120 mut->base = decl;120 mut->base = const_cast<ast::UnionDecl *>( decl ); 121 121 type = mut; 122 122 } … … 141 141 142 142 // Just linking in the node. 143 mut->base = decl;143 mut->base = const_cast<ast::TraitDecl *>( 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 section 206 205 207 ForwardEnumsType::iterator fwds = forwardEnums.find( decl->name ); 206 208 if ( fwds != forwardEnums.end() ) { -
src/Virtual/VirtualDtor.cpp
rc84dd61 r0b0a285 146 146 147 147 CompoundStmt * dtorBody = mutate( decl->stmts.get() ); 148 // Adds the following to the startof any actor/message dtor:148 // Adds the following to the end of any actor/message dtor: 149 149 // __CFA_dtor_shutdown( this ); 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 ); 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 )); 162 160 return; 163 161 } -
src/main.cc
rc84dd61 r0b0a285 28 28 #include <list> // for list 29 29 #include <string> // for char_traits, operator<< 30 31 using namespace std; 30 32 31 33 #include "AST/Convert.hpp" … … 86 88 #include "Virtual/VirtualDtor.hpp" // for implementVirtDtors 87 89 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( "Hoist Struct", Validate::hoistStruct, transUnit ); 337 338 PASS( "Eliminate Typedef", Validate::eliminateTypedef, transUnit ); 338 PASS( "Hoist Struct", Validate::hoistStruct, transUnit );339 339 PASS( "Validate Generic Parameters", Validate::fillGenericParameters, transUnit ); 340 340 PASS( "Translate Dimensions", Validate::translateDimensionParameters, transUnit ); -
tests/.expect/mathX.arm64.txt
rc84dd61 r0b0a285 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) = -4790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64794 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0 794 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0 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) = -4810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0 822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0 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) = -4846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 2147483648, ceiling(-1073741826, 1073741824) = -1073741824874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -1073741824, ceiling(-1073741826, 1073741824) = 0 874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0 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) = -4914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0 942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0 943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0 944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0 945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0 946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0 947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0 948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0 949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0 950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0 951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0 952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0 953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0 954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0 955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0 956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0 957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0 958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0 959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0 960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0 961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0 962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0 963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0 964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0 965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0 966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0 967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0 968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0 969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0 970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0 971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0 972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0 973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0 974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0 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) = -41046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -81047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -161048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -321049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -641050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -1281051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -2561052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -5121053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -10241054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -20481055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -40961056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -81921057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -163841058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -327681059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -655361060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -1310721061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -2621441062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -5242881063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -10485761064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -20971521065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -41943041066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -83886081067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -167772161068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -335544321069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -671088641070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -1342177281071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -2684354561072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -5368709121073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -10737418241074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -21474836481075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -42949672961076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -85899345921077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -171798691841078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -343597383681079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -687194767361080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -1374389534721081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -2748779069441082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -5497558138881083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -10995116277761084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -21990232555521085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -43980465111041086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -87960930222081087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -175921860444161088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -351843720888321089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -703687441776641090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -1407374883553281091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -2814749767106561092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -5629499534213121093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -11258999068426241094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -22517998136852481095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -45035996273704961096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -90071992547409921097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -180143985094819841098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -360287970189639681099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -720575940379279361100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -1441151880758558721101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -2882303761517117441102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -5764607523034234881103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -11529215046068469761104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -23058430092136939521105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -46116860184273879041106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -92233720368547758081045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 1046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 1047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 1048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 1049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 1050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 1051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 1052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 1053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 1054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 1055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 1056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 1057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 1058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 1059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 1060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 1061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 1062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 1063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 1064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 1065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 1066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 1067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 1068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 1069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 1070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 1071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 1072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 1073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0 1074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0 1075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0 1076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0 1077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0 1078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0 1079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0 1080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0 1081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0 1082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0 1083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0 1084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0 1085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0 1086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0 1087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0 1088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0 1089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0 1090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0 1091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0 1092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0 1093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0 1094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0 1095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0 1096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0 1097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0 1098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0 1099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0 1100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0 1101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0 1102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0 1103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0 1104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0 1105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0 1106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0 1107 1107 1108 1108 unsigned long long int -
tests/.expect/mathX.x64.txt
rc84dd61 r0b0a285 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) = -4790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64794 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128789 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 790 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 791 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 792 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 793 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0 794 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0 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) = -4810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768809 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 810 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 811 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 812 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 813 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 814 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 815 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 816 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 817 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 818 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 819 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 820 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 821 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0 822 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0 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) = -4846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 2147483648, ceiling(-1073741826, 1073741824) = -1073741824874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648845 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 846 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 847 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 848 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 849 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 850 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 851 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 852 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 853 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 854 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 855 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 856 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 857 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 858 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 859 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 860 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 861 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 862 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 863 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 864 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 865 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 866 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 867 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 868 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 869 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 870 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 871 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 872 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 873 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -1073741824, ceiling(-1073741826, 1073741824) = 0 874 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0 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) = -4914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808913 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 914 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 915 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 916 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 917 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 918 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 919 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 920 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 921 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 922 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 923 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 924 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 925 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 926 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 927 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 928 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 929 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 930 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 931 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 932 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 933 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 934 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 935 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 936 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 937 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 938 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 939 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 940 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 941 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0 942 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0 943 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0 944 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0 945 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0 946 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0 947 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0 948 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0 949 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0 950 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0 951 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0 952 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0 953 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0 954 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0 955 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0 956 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0 957 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0 958 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0 959 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0 960 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0 961 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0 962 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0 963 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0 964 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0 965 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0 966 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0 967 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0 968 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0 969 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0 970 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0 971 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0 972 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0 973 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0 974 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0 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) = -41046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -81047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -161048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -321049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -641050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -1281051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -2561052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -5121053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -10241054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -20481055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -40961056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -81921057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -163841058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -327681059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -655361060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -1310721061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -2621441062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -5242881063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -10485761064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -20971521065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -41943041066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -83886081067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -167772161068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -335544321069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -671088641070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -1342177281071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -2684354561072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -5368709121073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -10737418241074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -21474836481075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -42949672961076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -85899345921077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -171798691841078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -343597383681079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -687194767361080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -1374389534721081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -2748779069441082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -5497558138881083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -10995116277761084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -21990232555521085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -43980465111041086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -87960930222081087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -175921860444161088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -351843720888321089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -703687441776641090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -1407374883553281091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -2814749767106561092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -5629499534213121093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -11258999068426241094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -22517998136852481095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -45035996273704961096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -90071992547409921097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -180143985094819841098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -360287970189639681099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -720575940379279361100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -1441151880758558721101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -2882303761517117441102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -5764607523034234881103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -11529215046068469761104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -23058430092136939521105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -46116860184273879041106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -92233720368547758081045 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 1046 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 1047 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 1048 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 1049 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 1050 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 1051 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 1052 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 1053 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 1054 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 1055 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 1056 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 1057 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 1058 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 1059 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 1060 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 1061 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 1062 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 1063 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 1064 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 1065 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 1066 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 1067 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 1068 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 1069 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 1070 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 1071 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 1072 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 1073 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0 1074 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0 1075 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0 1076 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0 1077 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0 1078 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0 1079 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0 1080 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0 1081 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0 1082 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0 1083 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0 1084 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0 1085 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0 1086 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0 1087 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0 1088 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0 1089 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0 1090 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0 1091 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0 1092 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0 1093 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0 1094 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0 1095 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0 1096 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0 1097 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0 1098 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0 1099 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0 1100 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0 1101 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0 1102 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0 1103 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0 1104 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0 1105 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0 1106 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0 1107 1107 1108 1108 unsigned long long int -
tests/.expect/mathX.x86.txt
rc84dd61 r0b0a285 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) = -4662 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8663 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16664 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32665 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = -64666 ceiling(-128, -128) = -128, ceiling(-126, -128) = 0, ceiling(126, -128) = -128661 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 662 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 663 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 664 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 665 ceiling(64, 64) = 64, ceiling(66, 64) = -128, ceiling(-66, 64) = 0 666 ceiling(-128, -128) = -128, ceiling(-126, -128) = -128, ceiling(126, -128) = 0 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) = -4682 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8683 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16684 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32685 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64686 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128687 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256688 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512689 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024690 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048691 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096692 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192693 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = -16384694 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = 0, ceiling(32766, -32768) = -32768681 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 682 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 683 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 684 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 685 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 686 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 687 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 688 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 689 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 690 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 691 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 692 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 693 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = -32768, ceiling(-16386, 16384) = 0 694 ceiling(-32768, -32768) = -32768, ceiling(-32766, -32768) = -32768, ceiling(32766, -32768) = 0 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) = -4718 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8719 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16720 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32721 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64722 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128723 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256724 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512725 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024726 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048727 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096728 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192729 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384730 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768731 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536732 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072733 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144734 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288735 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576736 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152737 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304738 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608739 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216740 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432741 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864742 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728743 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456744 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912745 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 2147483648, ceiling(-1073741826, 1073741824) = -1073741824746 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648717 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 718 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 719 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 720 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 721 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 722 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 723 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 724 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 725 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 726 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 727 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 728 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 729 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 730 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 731 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 732 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 733 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 734 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 735 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 736 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 737 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 738 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 739 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 740 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 741 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 742 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 743 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 744 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 745 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -1073741824, ceiling(-1073741826, 1073741824) = 0 746 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0 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) = -4786 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8787 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16788 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32789 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64790 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128791 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256792 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512793 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024794 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048795 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096796 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192797 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384798 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768799 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536800 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072801 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144802 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288803 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576804 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152805 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304806 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608807 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216808 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432809 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864810 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728811 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456812 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912813 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = - 2147483648, ceiling(-1073741826, 1073741824) = -1073741824814 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = -2147483648785 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 786 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 787 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 788 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 789 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 790 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 791 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 792 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 793 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 794 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 795 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 796 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 797 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 798 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 799 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 800 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 801 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 802 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 803 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 804 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 805 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 806 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 807 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 808 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 809 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 810 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 811 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 812 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 813 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = -1073741824, ceiling(-1073741826, 1073741824) = 0 814 ceiling(-2147483648, -2147483648) = -2147483648, ceiling(-2147483646, -2147483648) = 0, ceiling(2147483646, -2147483648) = 0 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) = -4854 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = -8855 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = -16856 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = -32857 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = -64858 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = -128859 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = -256860 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = -512861 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = -1024862 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = -2048863 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = -4096864 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = -8192865 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = -16384866 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = -32768867 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = -65536868 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = -131072869 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = -262144870 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = -524288871 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = -1048576872 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = -2097152873 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = -4194304874 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = -8388608875 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = -16777216876 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = -33554432877 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = -67108864878 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = -134217728879 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = -268435456880 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = -536870912881 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = -1073741824882 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = -2147483648883 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = -4294967296884 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = -8589934592885 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = -17179869184886 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = -34359738368887 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = -68719476736888 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = -137438953472889 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = -274877906944890 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = -549755813888891 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = -1099511627776892 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = -2199023255552893 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = -4398046511104894 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = -8796093022208895 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = -17592186044416896 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = -35184372088832897 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = -70368744177664898 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = -140737488355328899 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = -281474976710656900 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = -562949953421312901 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = -1125899906842624902 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = -2251799813685248903 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = -4503599627370496904 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = -9007199254740992905 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = -18014398509481984906 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = -36028797018963968907 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = -72057594037927936908 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = -144115188075855872909 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = -288230376151711744910 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = -576460752303423488911 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = -1152921504606846976912 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = -2305843009213693952913 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = - 9223372036854775808, ceiling(-4611686018427387906, 4611686018427387904) = -4611686018427387904914 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = -9223372036854775808853 ceiling(4, 4) = 4, ceiling(6, 4) = 8, ceiling(-6, 4) = 0 854 ceiling(8, 8) = 8, ceiling(10, 8) = 16, ceiling(-10, 8) = 0 855 ceiling(16, 16) = 16, ceiling(18, 16) = 32, ceiling(-18, 16) = 0 856 ceiling(32, 32) = 32, ceiling(34, 32) = 64, ceiling(-34, 32) = 0 857 ceiling(64, 64) = 64, ceiling(66, 64) = 128, ceiling(-66, 64) = 0 858 ceiling(128, 128) = 128, ceiling(130, 128) = 256, ceiling(-130, 128) = 0 859 ceiling(256, 256) = 256, ceiling(258, 256) = 512, ceiling(-258, 256) = 0 860 ceiling(512, 512) = 512, ceiling(514, 512) = 1024, ceiling(-514, 512) = 0 861 ceiling(1024, 1024) = 1024, ceiling(1026, 1024) = 2048, ceiling(-1026, 1024) = 0 862 ceiling(2048, 2048) = 2048, ceiling(2050, 2048) = 4096, ceiling(-2050, 2048) = 0 863 ceiling(4096, 4096) = 4096, ceiling(4098, 4096) = 8192, ceiling(-4098, 4096) = 0 864 ceiling(8192, 8192) = 8192, ceiling(8194, 8192) = 16384, ceiling(-8194, 8192) = 0 865 ceiling(16384, 16384) = 16384, ceiling(16386, 16384) = 32768, ceiling(-16386, 16384) = 0 866 ceiling(32768, 32768) = 32768, ceiling(32770, 32768) = 65536, ceiling(-32770, 32768) = 0 867 ceiling(65536, 65536) = 65536, ceiling(65538, 65536) = 131072, ceiling(-65538, 65536) = 0 868 ceiling(131072, 131072) = 131072, ceiling(131074, 131072) = 262144, ceiling(-131074, 131072) = 0 869 ceiling(262144, 262144) = 262144, ceiling(262146, 262144) = 524288, ceiling(-262146, 262144) = 0 870 ceiling(524288, 524288) = 524288, ceiling(524290, 524288) = 1048576, ceiling(-524290, 524288) = 0 871 ceiling(1048576, 1048576) = 1048576, ceiling(1048578, 1048576) = 2097152, ceiling(-1048578, 1048576) = 0 872 ceiling(2097152, 2097152) = 2097152, ceiling(2097154, 2097152) = 4194304, ceiling(-2097154, 2097152) = 0 873 ceiling(4194304, 4194304) = 4194304, ceiling(4194306, 4194304) = 8388608, ceiling(-4194306, 4194304) = 0 874 ceiling(8388608, 8388608) = 8388608, ceiling(8388610, 8388608) = 16777216, ceiling(-8388610, 8388608) = 0 875 ceiling(16777216, 16777216) = 16777216, ceiling(16777218, 16777216) = 33554432, ceiling(-16777218, 16777216) = 0 876 ceiling(33554432, 33554432) = 33554432, ceiling(33554434, 33554432) = 67108864, ceiling(-33554434, 33554432) = 0 877 ceiling(67108864, 67108864) = 67108864, ceiling(67108866, 67108864) = 134217728, ceiling(-67108866, 67108864) = 0 878 ceiling(134217728, 134217728) = 134217728, ceiling(134217730, 134217728) = 268435456, ceiling(-134217730, 134217728) = 0 879 ceiling(268435456, 268435456) = 268435456, ceiling(268435458, 268435456) = 536870912, ceiling(-268435458, 268435456) = 0 880 ceiling(536870912, 536870912) = 536870912, ceiling(536870914, 536870912) = 1073741824, ceiling(-536870914, 536870912) = 0 881 ceiling(1073741824, 1073741824) = 1073741824, ceiling(1073741826, 1073741824) = 2147483648, ceiling(-1073741826, 1073741824) = 0 882 ceiling(2147483648, 2147483648) = 2147483648, ceiling(2147483650, 2147483648) = 4294967296, ceiling(-2147483650, 2147483648) = 0 883 ceiling(4294967296, 4294967296) = 4294967296, ceiling(4294967298, 4294967296) = 8589934592, ceiling(-4294967298, 4294967296) = 0 884 ceiling(8589934592, 8589934592) = 8589934592, ceiling(8589934594, 8589934592) = 17179869184, ceiling(-8589934594, 8589934592) = 0 885 ceiling(17179869184, 17179869184) = 17179869184, ceiling(17179869186, 17179869184) = 34359738368, ceiling(-17179869186, 17179869184) = 0 886 ceiling(34359738368, 34359738368) = 34359738368, ceiling(34359738370, 34359738368) = 68719476736, ceiling(-34359738370, 34359738368) = 0 887 ceiling(68719476736, 68719476736) = 68719476736, ceiling(68719476738, 68719476736) = 137438953472, ceiling(-68719476738, 68719476736) = 0 888 ceiling(137438953472, 137438953472) = 137438953472, ceiling(137438953474, 137438953472) = 274877906944, ceiling(-137438953474, 137438953472) = 0 889 ceiling(274877906944, 274877906944) = 274877906944, ceiling(274877906946, 274877906944) = 549755813888, ceiling(-274877906946, 274877906944) = 0 890 ceiling(549755813888, 549755813888) = 549755813888, ceiling(549755813890, 549755813888) = 1099511627776, ceiling(-549755813890, 549755813888) = 0 891 ceiling(1099511627776, 1099511627776) = 1099511627776, ceiling(1099511627778, 1099511627776) = 2199023255552, ceiling(-1099511627778, 1099511627776) = 0 892 ceiling(2199023255552, 2199023255552) = 2199023255552, ceiling(2199023255554, 2199023255552) = 4398046511104, ceiling(-2199023255554, 2199023255552) = 0 893 ceiling(4398046511104, 4398046511104) = 4398046511104, ceiling(4398046511106, 4398046511104) = 8796093022208, ceiling(-4398046511106, 4398046511104) = 0 894 ceiling(8796093022208, 8796093022208) = 8796093022208, ceiling(8796093022210, 8796093022208) = 17592186044416, ceiling(-8796093022210, 8796093022208) = 0 895 ceiling(17592186044416, 17592186044416) = 17592186044416, ceiling(17592186044418, 17592186044416) = 35184372088832, ceiling(-17592186044418, 17592186044416) = 0 896 ceiling(35184372088832, 35184372088832) = 35184372088832, ceiling(35184372088834, 35184372088832) = 70368744177664, ceiling(-35184372088834, 35184372088832) = 0 897 ceiling(70368744177664, 70368744177664) = 70368744177664, ceiling(70368744177666, 70368744177664) = 140737488355328, ceiling(-70368744177666, 70368744177664) = 0 898 ceiling(140737488355328, 140737488355328) = 140737488355328, ceiling(140737488355330, 140737488355328) = 281474976710656, ceiling(-140737488355330, 140737488355328) = 0 899 ceiling(281474976710656, 281474976710656) = 281474976710656, ceiling(281474976710658, 281474976710656) = 562949953421312, ceiling(-281474976710658, 281474976710656) = 0 900 ceiling(562949953421312, 562949953421312) = 562949953421312, ceiling(562949953421314, 562949953421312) = 1125899906842624, ceiling(-562949953421314, 562949953421312) = 0 901 ceiling(1125899906842624, 1125899906842624) = 1125899906842624, ceiling(1125899906842626, 1125899906842624) = 2251799813685248, ceiling(-1125899906842626, 1125899906842624) = 0 902 ceiling(2251799813685248, 2251799813685248) = 2251799813685248, ceiling(2251799813685250, 2251799813685248) = 4503599627370496, ceiling(-2251799813685250, 2251799813685248) = 0 903 ceiling(4503599627370496, 4503599627370496) = 4503599627370496, ceiling(4503599627370498, 4503599627370496) = 9007199254740992, ceiling(-4503599627370498, 4503599627370496) = 0 904 ceiling(9007199254740992, 9007199254740992) = 9007199254740992, ceiling(9007199254740994, 9007199254740992) = 18014398509481984, ceiling(-9007199254740994, 9007199254740992) = 0 905 ceiling(18014398509481984, 18014398509481984) = 18014398509481984, ceiling(18014398509481986, 18014398509481984) = 36028797018963968, ceiling(-18014398509481986, 18014398509481984) = 0 906 ceiling(36028797018963968, 36028797018963968) = 36028797018963968, ceiling(36028797018963970, 36028797018963968) = 72057594037927936, ceiling(-36028797018963970, 36028797018963968) = 0 907 ceiling(72057594037927936, 72057594037927936) = 72057594037927936, ceiling(72057594037927938, 72057594037927936) = 144115188075855872, ceiling(-72057594037927938, 72057594037927936) = 0 908 ceiling(144115188075855872, 144115188075855872) = 144115188075855872, ceiling(144115188075855874, 144115188075855872) = 288230376151711744, ceiling(-144115188075855874, 144115188075855872) = 0 909 ceiling(288230376151711744, 288230376151711744) = 288230376151711744, ceiling(288230376151711746, 288230376151711744) = 576460752303423488, ceiling(-288230376151711746, 288230376151711744) = 0 910 ceiling(576460752303423488, 576460752303423488) = 576460752303423488, ceiling(576460752303423490, 576460752303423488) = 1152921504606846976, ceiling(-576460752303423490, 576460752303423488) = 0 911 ceiling(1152921504606846976, 1152921504606846976) = 1152921504606846976, ceiling(1152921504606846978, 1152921504606846976) = 2305843009213693952, ceiling(-1152921504606846978, 1152921504606846976) = 0 912 ceiling(2305843009213693952, 2305843009213693952) = 2305843009213693952, ceiling(2305843009213693954, 2305843009213693952) = 4611686018427387904, ceiling(-2305843009213693954, 2305843009213693952) = 0 913 ceiling(4611686018427387904, 4611686018427387904) = 4611686018427387904, ceiling(4611686018427387906, 4611686018427387904) = -4611686018427387904, ceiling(-4611686018427387906, 4611686018427387904) = 0 914 ceiling(-9223372036854775808, -9223372036854775808) = -9223372036854775808, ceiling(-9223372036854775806, -9223372036854775808) = 0, ceiling(9223372036854775806, -9223372036854775808) = 0 915 915 916 916 unsigned long long int -
tests/Makefile.am
rc84dd61 r0b0a285 90 90 concurrency/clib.c \ 91 91 concurrency/unified_locking/mutex_test.hfa \ 92 concurrency/channels/parallel_harness.hfa \ 93 array-container/dimexpr-match.hfa \ 94 array-container/dimexpr-match-detail.sh 92 concurrency/channels/parallel_harness.hfa 95 93 96 94 dist-hook: … … 113 111 # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 114 112 all-local : # This name is important to automake and implies the default build target. 115 @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all113 @+${TEST_PY} --debug=${debug} --install=${installed} --invariant ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all 116 114 117 115 tests : all-local # synonym … … 227 225 -cp ${test} ${abspath ${@}} 228 226 229 array-container/dimexpr-match-c-ERRS : array-container/dimexpr-match-c.cfa230 ${CFACOMPILE_SYNTAX} -DERRS231 -cp ${test} ${abspath ${@}}232 233 array-container/dimexpr-match-cfa-ERRS : array-container/dimexpr-match-cfa.cfa234 ${CFACOMPILE_SYNTAX} -DERRS235 -cp ${test} ${abspath ${@}}236 237 227 alloc-ERROR : alloc.cfa ${CFACCBIN} 238 228 ${CFACOMPILE_SYNTAX} -DERR1 -
tests/collections/vector-demo.cfa
rc84dd61 r0b0a285 143 143 assert( v`capacity > 5 && v`length == 5 ); 144 144 145 v[2] = -0.1 f; // 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.1; // 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
rc84dd61 r0b0a285 4 4 A 5 5 A 6 A7 A8 6 Finished -
tests/concurrency/actors/dynamic.cfa
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 7 7 8 8 struct Server { inline actor; }; 9 struct Server2 { inline Server; int b; }; 10 struct D_msg { int a; inline message; }; 11 struct D_msg2 { inline D_msg; }; 9 12 10 struct Server2 { inline Server; int b; };11 13 void ^?{}( Server2 & this ) { mutex(sout) sout | 'A'; } 12 13 struct D_msg { int a; inline message; };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; };18 16 19 17 allocation handle() { … … 32 30 D_msg * dm = alloc(); 33 31 (*dm){}; 34 D_msg2 * dm2 = alloc(); 35 (*dm2){}; 32 D_msg2 dm2; 36 33 Server2 * s = alloc(); 37 34 (*s){}; 38 35 Server2 * s2 = alloc(); 39 36 (*s2){}; 40 *s |*dm;41 *s2 | *dm2;37 *s << *dm; 38 *s2 << dm2; 42 39 stop_actor_system(); 43 40 } … … 47 44 D_msg * dm = alloc(); 48 45 (*dm){}; 49 D_msg2 * dm2 = alloc(); 50 (*dm2){}; 51 s[0] | *dm; 52 s[1] | *dm2; 46 D_msg2 dm2; 47 s[0] << *dm; 48 s[1] << dm2; 53 49 stop_actor_system(); 54 50 } -
tests/concurrency/actors/matrix.cfa
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 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
rc84dd61 r0b0a285 10 10 // Created On : Sat Mar 16 15:30:34 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jun 17 09:11:56 202313 // Update Count : 9 412 // Last Modified On : Sat Apr 20 09:07:19 2019 13 // Update Count : 90 14 14 // 15 15 … … 18 18 19 19 enum Status { CONT, MSG, ESTX, ELNTH, ECRC }; 20 21 20 coroutine Driver { 22 21 Status status; … … 24 23 }; // Driver 25 24 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 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; 30 28 } // next 31 29 … … 75 73 if ( eof( sin ) ) break eof; // eof ? 76 74 choose( next( driver, byte ) ) { // analyse character 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"; 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: ; 82 84 } // choose 83 85 } // for … … 85 87 86 88 // Local Variables: // 89 // tab-width: 4 // 87 90 // compile-command: "cfa -g -Wall -Wextra devicedriver.cfa" // 88 91 // End: // -
tests/io/manipulatorsInput.cfa
rc84dd61 r0b0a285 7 7 // Created On : Sat Jun 8 17:58:54 2019 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Sat Jun 17 07:56:02 202310 // Update Count : 4 89 // Last Modified On : Wed Jul 15 15:56:03 2020 10 // Update Count : 47 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
rc84dd61 r0b0a285 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. no_invariant143 invariant = options.invariant 144 144 continue_ = options.continue_ 145 145 dry_run = options.dry_run # must be called before tools.config_hash() -
tests/test.py
rc84dd61 r0b0a285 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.', action='store_true') 117 parser.add_argument('--no-invariant', help='Tell the compiler not to check invariants.', action='store_false') 116 parser.add_argument('--invariant', help='Tell the compiler to check invariants while running.', action='store_true') 118 117 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180) 119 118 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.