From e479180282405fb1cdad03a7e97c2bf713965bac Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Thu, 11 Jan 2024 08:32:16 +0900 Subject: [PATCH] [doc] update usage --- doc/usage.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/usage.md b/doc/usage.md index e9db358..f65148b 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -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(); } }; @@ -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.