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

Add document for -mstrict-align and -mno-strict-align #49

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,34 @@ specification, and in the draft [CORE-V Builtin
Function](https://github.com/openhwgroup/core-v-sw/blob/master/specifications/corev-builtin-spec.md)
specification.

## Common Toolchain Command Line Options

This section lists common RISC-V specific toolchain command line options.

### `-mstrict-align`/`-mno-strict-align`
Indicates that the compiler should not assume that unaligned scalar and
unaligned vector memory references are handled by the system.

`-mstrict-align`: The compiler disallows misaligned memory access.
`-mno-strict-align`: The compiler allows misaligned memory access.

The compiler's behavior will follow this order of precedence:

- Use the setting from `-mstrict-align` / `-mno-strict-align` if either option
is given, taking the last one specified.
- Use the setting from `-mtune` if `-mstrict-align` / `-mno-strict-align` is not given.
- Use the setting from `-mcpu` if neither of the above options is given.
- Use the compiler's default setting if none of the above options are provided.

NOTE: Non-strict also known as unaligned access or misaligned access
NOTE: The compiler may generate misaligned access if the program violates the
alignment assumption.
NOTE: This option does not affect inline assembly.

## TODO

* `-mdiv`, `-mno-div`, `-mfdiv`, `-mno-fdiv`, `-msave-restore`,
`-mno-save-restore`, `-mstrict-align`, `-mno-strict-align`,
`-mexplicit-relocs`, `-mno-explicit-relocs`
* `-mdiv`, `-mno-div`, `-mfdiv`, `-mno-fdiv`, `-msave-restore`,
`-mno-save-restore`, `-mexplicit-relocs`, `-mno-explicit-relocs`

## Appendix: Exposing a vendor-specific extension across the toolchain

Expand Down