Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimized application for own computer #103

Closed
wants to merge 2 commits into from

Conversation

salihberat
Copy link
Contributor

according to ChatGPT:
Removed -mssse3, -msse4.2, and -mpopcnt:

These flags are not needed when using -march or -mtune.
Both -march=native (if used) and -mtune=native automatically detect and enable relevant instruction sets based on the target CPU.

Kept -m32 for 32-bit builds (CFLAGS_x86):

This is required for explicitly targeting 32-bit systems.

Kept -march for architecture specification:

-march=i686 ensures compatibility with i686 systems for 32-bit builds.
-march=x86-64 ensures compatibility with 64-bit x86 systems.

Why -mtune=native Is Better in This Case

Using -mtune=native ensures that the generated code is tuned for the exact machine where it is compiled, potentially yielding better performance compared to the generic -mtune=intel. -------------

I DID NOT TEST THIS CODE!!!

according to ChatGPT:
Removed -mssse3, -msse4.2, and -mpopcnt:

    These flags are not needed when using -march or -mtune.
    Both -march=native (if used) and -mtune=native automatically detect and enable relevant instruction sets based on the target CPU.
---------------
Kept -m32 for 32-bit builds (CFLAGS_x86):

    This is required for explicitly targeting 32-bit systems.
--------------
Kept -march for architecture specification:

    -march=i686 ensures compatibility with i686 systems for 32-bit builds.
    -march=x86-64 ensures compatibility with 64-bit x86 systems.
----------------
Why -mtune=native Is Better in This Case

Using -mtune=native ensures that the generated code is tuned for the exact machine where it is compiled, potentially yielding better performance compared to the generic -mtune=intel.
-------------

I DID NOT TEST THIS CODE!!!
for computers:
general usage is been base,
i deleted intel code

and optimized compile is been second option
@cnlohr
Copy link
Owner

cnlohr commented Jan 3, 2025

This is not an appropriate thing to do, in general. This is for targeting android apps. -march=native will tune for your PC, not the PC you're targeting.

But, also, AFAIK, all x86 Android targets are Intel, so that's why I went with it.

Overall, this was largely to duplicate the default settings from what Android studio targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants