# riscv: change up how we do args · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/92293214009cbf5d8aede56a5f54f533173324d5)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 92293214009cbf5d8aede56a5f54f533173324d5

Requested commit: 92293214009cbf5d8aede56a5f54f533173324d5

Commit: 92293214009cbf5d8aede56a5f54f533173324d5

Tree: f23c26d18a65466c84ea3ee7cfad7e24a3eee4ae

Author: David Rubin

Committer: David Rubin

## Message

```
riscv: change up how we do args

- before we were storing each arg in it's own function arg register. with this commit now we store the args in the fa register before calling as per the RISC-V calling convention, however as soon as we enter the callee, aka in airArg, we spill the argument to the stack. this allows us to spend less effort worrying about whether we're going to clobber the function arguments when another function is called inside of the callee.

- we were actually clobbering the fa regs inside of resolveCallingConvetion, because of the null argument to allocReg. now each lock is stored in an array which is then iterated over and unlocked, which actually aids in the first point of this commit.

```

## Parents

- [5e010b6deac7ad34f0cd06d507fc468fd98f9abc](https://git.cafe/gitcafe/zig/commit/5e010b6deac7ad34f0cd06d507fc468fd98f9abc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/92293214009cbf5d8aede56a5f54f533173324d5?format=markdown)
