Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Zc extension is enabled, the behavior of the .option #226

Open
bigmagic123 opened this issue Sep 19, 2023 · 3 comments
Open

Zc extension is enabled, the behavior of the .option #226

bigmagic123 opened this issue Sep 19, 2023 · 3 comments

Comments

@bigmagic123
Copy link

I want to restrict the generation of Zc in a segment of assembly code using the .option.

When I write code like this:

.option push
.option arch, -zca
.option arch, -zcb
    add x3,x3,x27
.option pop

Passing the argument "arch=rv32ima_zca_zcb" during compilation.

zca remains enabled.

When I browse through the code, I notice that:

https://github.com/bminor/binutils-gdb/blob/master/bfd/elfxx-riscv.c

  {"zcf", "zca",	check_implicit_always},
  {"zcd", "zca",	check_implicit_always},
  {"zcb", "zca",	check_implicit_always},

When I enable zcb, zca will be included by default.

why it was designed this way?What would be the appropriate usage?

@jnk0le
Copy link
Contributor

jnk0le commented Sep 19, 2023

Zca is basically C extension without floating point load/stores

@KaiYG
Copy link

KaiYG commented Oct 3, 2023

Based on the spec, all Zc* depend on Zca.
But aren't Zcb & Zca re-enabled by the .option pop?

@tovine
Copy link
Contributor

tovine commented Oct 24, 2023

I want to restrict the generation of Zc in a segment of assembly code using the .option.

When I write code like this:

.option push
.option arch, -zca
.option arch, -zcb
    add x3,x3,x27
.option pop

Passing the argument "arch=rv32ima_zca_zcb" during compilation.

zca remains enabled.

Maybe the issue is that you're trying to disable zca before disabling zcb so the tools don't allow you to do this because zca is a dependency of zcb (which is still enabled at that point)?
Does it work if you reverse the order and first disable zcb and then zca?

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

No branches or pull requests

4 participants