Skip to content

Commit

Permalink
[doc] update usage
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Jan 10, 2024
1 parent 60b1e07 commit e479180
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ using namespace Xbyak_riscv;
struct Code : CodeGenerator {
Code(int v)
{
add(a0, a0, a1);
addi(a0, a0, v);
addw(a0, a0, a1);
addiw(a0, a0, v);
ret();
}
};
Expand Down Expand Up @@ -53,6 +53,21 @@ x28-31|t3-6
These names are defined in the `Xbyak_riscv` namespace.
# Syntax
asm|Xbyak
-|-
`add x3, x4, x5`|`add(x3, x4, x5);`
`ld x3, 16(x4)`|`ld(x3, x4, 16);`
`sw t0,8(s1)`|sw(t0, s1, 8);`
`amoswap.w a0,a1,(a2)`|amoswap_w(a0, a1, a2);`
Replace a period in instructions with an underscore.
# RVC
Use `supportRVC()` to enable RVC instructions.
# Macros
- Define `XBYAK_RISCV_V = 1` to enable Vector Operations.

0 comments on commit e479180

Please sign in to comment.