Skip to content

Commit

Permalink
Silence warnings in non-Intel architectures (e.g. ARM)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttsiodras committed Jul 16, 2022
1 parent a472dff commit 8ff4161
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Windows users can download and run a pre-compiled Windows binary

After decompressing, you can simply execute either one of the two .bat
files. The 'autopilot' one zooms in a specific location, while the other
one allows you to zoom interactively using your mouse (left-click zooms in,
right-click zooms out).
one allows you to zoom interactively using your mouse (left-click/hold zooms in,
right-click/hold zooms out).

For those of you that want to build from source code, there are
cross-compilation instructions later in this document.
Expand All @@ -36,11 +36,11 @@ Usage
You can then try these:

$ src/mandelSSE
(Runs in autopilot in a 1024x768 window)
(Runs in autopilot mode, in a 1024x768 window)

$ src/mandelSSE -m 1280 720
(Runs in mouse-driven mode, in a 1280x720 window)
(left-click zooms-in, right-click zooms out)
(left-click/hold zooms-in, right-click/hold zooms out)

Option `-h` gives you additional information about how to control
the Mandelbrot zoomer:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Windows users can download and run a pre-compiled Windows binary

After decompressing, you can simply execute either one of the two .bat
files. The 'autopilot' one zooms in a specific location, while the other
one allows you to zoom interactively using your mouse (left-click zooms in,
right-click zooms out).
one allows you to zoom interactively using your mouse (left-click/hold zooms in,
right-click/hold zooms out).

For those of you that want to build from source code, there are
cross-compilation instructions later in this document.
Expand All @@ -36,11 +36,11 @@ Usage
You can then try these:

$ src/mandelSSE
(Runs in autopilot in a 1024x768 window)
(Runs in autopilot mode, in a 1024x768 window)

$ src/mandelSSE -m 1280 720
(Runs in mouse-driven mode, in a 1280x720 window)
(left-click zooms-in, right-click zooms out)
(left-click/hold zooms-in, right-click/hold zooms out)

Option `-h` gives you additional information about how to control
the Mandelbrot zoomer:
Expand Down
14 changes: 12 additions & 2 deletions src/mandel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@

void usage(char *argv[])
{
printf("Usage: %s [-a|-m] [-h] [-b] [-v|-s|-d] [-i iter] [-p pct] [-f rate] [WIDTH HEIGHT]\n", argv[0]);
printf("Usage: %s [-a|-m] [-h] [-b] "
#ifdef __x86_64__
"[-v|-s|-d] "
#endif
"[-i iter] [-p pct] [-f rate] [WIDTH HEIGHT]\n", argv[0]);
puts("Where:");
puts("\t-h\tShow this help message");
puts("\t-m\tRun in mouse-driven mode");
puts("\t-a\tRun in autopilot mode (default)");
puts("\t-b\tRun in benchmark mode (implies autopilot)");
#ifdef __x86_64__
puts("\t-v\tForce use of AVX");
puts("\t-s\tForce use of SSE");
puts("\t-d\tForce use of non-AVX, non-SSE code");
#endif
puts("\t-i iter\tThe maximum number of iterations of the Mandelbrot loop (default: 2048)");
puts("\t-p pct\tThe percentage of pixels computed per frame (default: 0.75)");
puts("\t \t(the rest are copied from the previous frame)");
Expand All @@ -48,7 +54,9 @@ int main(int argc, char *argv[])
{
int opt, fps = 60;
bool autoPilot = true, benchmark = false;
#ifdef __x86_64__
bool forceAVX = false, forceSSE = false, forceDefault = false;
#endif
double percent = 0.75;

iterations = 2048;
Expand All @@ -68,6 +76,7 @@ int main(int argc, char *argv[])
autoPilot = true;
benchmark = true;
break;
#ifdef __x86_64__
case 'v':
forceAVX = true;
break;
Expand All @@ -77,6 +86,7 @@ int main(int argc, char *argv[])
case 'd':
forceDefault = true;
break;
#endif
case 'i':
if (1 != sscanf(optarg, "%d", &iterations))
panic("[x] Invalid number of iterations: '%s'", optarg);
Expand Down Expand Up @@ -159,7 +169,7 @@ int main(int argc, char *argv[])
printf("[-] Iterations: %d\n", iterations);
#else
CoreLoopDouble = CoreLoopDoubleDefault;
printf("[-] Mode: %s\n", "non-AVX");
printf("[-] Mode: %s\n", "non-AVX/non-SSE");
#endif

const char *windowTitle;
Expand Down
4 changes: 2 additions & 2 deletions src/xaos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ double autopilot(double percent, bool benchmark)
if (benchmark)
break;
}
printf("[-] Rendered %d frames.\n", frames);
printf("[-] Rendered : %d frames\n", frames);
return ((double)frames)*1000.0/ticks;
}

Expand Down Expand Up @@ -384,7 +384,7 @@ double mousedriven(double percent)
}
}
// Inform point reached, for potential autopilot target
printf("[-] Rendered %d frames.\n", frames);
printf("[-] Rendered : %d frames\n", frames);
return ((double)frames)*1000.0/ticks;
}

0 comments on commit 8ff4161

Please sign in to comment.