-
Notifications
You must be signed in to change notification settings - Fork 275
[goto-cc] Add support for ARM-enabling flags #957
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly nit-picking.
.gitignore
Outdated
@@ -37,6 +37,7 @@ src/ansi-c/gcc_builtin_headers_power.inc | |||
regression/**/tests.log | |||
regression/**/*.gb | |||
regression/**/*.smt2 | |||
regression/ansi-c/arch_flags*/linked-object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd get rid of this, more below.
@@ -0,0 +1,20 @@ | |||
CORE | |||
preproc.i | |||
-mcpu=cortex-a15 -o linked-object object.intel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name the output file "linked-object.gb" as the .gb suffix will ensure 1) the gitignore matches and 2) make clean
removes it.
-- | ||
This tests the -mcpu=cortex=a15 flag that should activate ARM-32 mode. | ||
The object file 'object.intel' was compiled from 'source.c' with goto-cc | ||
as usual: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly add "on a 64-bit platform".
@@ -0,0 +1,19 @@ | |||
CORE | |||
preproc.i | |||
-mcpu=cortex-a15 -o linked-object object.arm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above: add .gb
@@ -0,0 +1,19 @@ | |||
CORE | |||
preproc.i | |||
-mthumb -o linked-object object.intel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above: .gb
@@ -0,0 +1,19 @@ | |||
CORE | |||
preproc.i | |||
-mthumb -o linked-object object.arm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above: .gb
src/goto-cc/gcc_mode.cpp
Outdated
} | ||
} | ||
|
||
end_arch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use goto. Well, we should actually codify that in the CODING_STANDARD.
src/goto-cc/gcc_mode.cpp
Outdated
/* -mcpu sets both the arch and tune, but should only be used if | ||
* neither -march nor -mtune are passed on the command line. | ||
*/ | ||
std::string target_cpu = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No space around =
, ==
goto-cc now accepts the following flags: -mthumb{,-interwork} -mcpu=PROC -march=PROC -mtune=PROC where PROC is one of the (many) processors that GCC accepts for those three arguments. Supplying one or more of these flags causes goto-cc to switch to the mode of that architecture, i.e. by changing output code format, sizes of pointers and integers, etc. Thus, passing (for example) -mcpu=cortex-a15 is enough to make goto-cc generate ARM-32 code; there is no longer any need to pass -m32.
goto-cc now accepts the following flags:
-mthumb{,-interwork}
-mcpu=PROC
-march=PROC
-mtune=PROC
where PROC is one of the (many) processors that GCC accepts for those
three arguments.
Supplying one or more of these flags causes goto-cc to switch to the
mode of that architecture, i.e. by changing output code format, sizes of
pointers and integers, etc. Thus, passing (for example) -mcpu=cortex-a15
is enough to make goto-cc generate ARM-32 code; there is no longer any
need to pass -m32.
CR: https://cr.amazon.com/r/7156058/