Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Dec 31, 2024
1 parent 1d0b1ed commit 8423ed9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions numerics/sin_cos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// The macros OSACA_FUNCTION_BEGIN and OSACA_RETURN are used to analyse the
// latency of a double -> double function, as measured, e.g., by the
// nanobenchmarks; this notionally corresponds to the duration of an iteration
// of a loop x = f(x).
// of a loop `x = f(x)`.
// The latency-critical path of the function is reported as the loop-carried
// dependency by OSACA, and as the critical path by IACA in throughput analysis
// mode.
Expand Down Expand Up @@ -93,14 +93,14 @@
// the loop. There are some subtleties:
// — We need to trick the compiler into believing the loop is finite, so that it
// doesn’t optimize away the end marker or even the function. This is
// achieved by exiting based on the value of OSACA_loop_terminator.
// achieved by exiting based on the value of `OSACA_loop_terminator`.
// — Return statements may be in if statements, and there may be several of
// them, so they cannot be the end of a loop started unconditionally. Instead
// we loop with goto.
// — Some volatile reads and writes are used to clarify identity of the
// registers in the generated code (where the names of OSACA_input and
// OSACA_result appear in movsd instructions) and to improve the structure of
// the generated graph.
// registers in the generated code (where the names of `OSACA_input` and
// 'OSACA_result' appear in movsd instructions) and to improve the structure
// of the generated graph.
//
// Putting a load of the input from memory in the analysed section makes the
// OSACA dependency graph clearer. However:
Expand Down Expand Up @@ -141,7 +141,7 @@ static bool OSACA_loop_terminator = false;
// also compiled normally and assigned to a boolean; whether this results in any
// generated code depends on `OSACA_EVALUATE_CONDITIONS`. Note that, with
// `OSACA_EVALUATE_CONDITIONS`, in `OSACA_IF(p) { } OSACA_ELSE_IF(q) { }`, if
// `p` holds `UNDER_OSACA_HYPOTHESES`, code is generated to evalutae `p`, but
// `p` holds `UNDER_OSACA_HYPOTHESES`, code is generated to evaluate `p`, but
// not `q`.

#define OSACA_IF(condition) \
Expand All @@ -155,7 +155,7 @@ static bool OSACA_loop_terminator = false;
#define OSACA_CONDITION_QUALIFIER
#endif

#else
#else // if !PRINCIPIA_USE_OSACA

#define OSACA_IF(condition) if (condition)

Expand Down

0 comments on commit 8423ed9

Please sign in to comment.