[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar
From: |
Danny Milosavljevic |
Subject: |
[Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar |
Date: |
Wed, 7 Apr 2021 13:53:12 +0200 |
---
riscv64-asm.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/riscv64-asm.c b/riscv64-asm.c
index 27ff2cb..9b45ee1 100644
--- a/riscv64-asm.c
+++ b/riscv64-asm.c
@@ -691,8 +691,15 @@ ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char
*str)
ST_FUNC int asm_parse_regvar (int t)
{
- tcc_error("RISCV64 asm not implemented.");
- return -1;
+ if (t >= TOK_ASM_x0 && t <= TOK_ASM_pc) { /* register name */
+ switch (t) {
+ case TOK_ASM_pc:
+ return -1; // TODO: Figure out where it can be used after all
+ default:
+ return t - TOK_ASM_x0;
+ }
+ } else
+ return -1;
}
/*************************************************************/
--
2.29.2
- [Tinycc-devel] [PATCH 00/11] Add RISCV64 inline assembler, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 02/11] riscv64-asm: Add fence, fence.i, scall, sbreak, ecall, ebreak, wfi, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 06/11] riscv64-asm: Add add, addi, sub, addw, addd, addiw, addid, subw, subd, xor, xori, or, ori, and, andi, slt, slti, sltu, sltiu, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 05/11] riscv64-asm: Add sll, slli, srl, srli, sra, srai, sllw, slld, slliw, sllid, srlw, srld, srliw, srlid, sraw, srad, sraiw, sraid, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 07/11] riscv64-asm: Add lb, lh, lw, lbu, lhu, ld, lwu, sb, sh, sw, sd, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 10/11] riscv64-asm: Optimize gen_le32, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 01/11] riscv64-asm: Remove asm_error, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 03/11] riscv64-asm: Add rdcycle, rdcycleh, rdtime, rdtimeh, rdinstret, rdinstreth, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 08/11] riscv64-asm: Add beq, bne, blt, bge, bltu, bgeu, Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 11/11] riscv64-asm: Implement asm_clobber., Danny Milosavljevic, 2021/04/07
- [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar,
Danny Milosavljevic <=
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Charles Lohr, 2021/04/12
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Danny Milosavljevic, 2021/04/16
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Charles Lohr, 2021/04/16
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Danny Milosavljevic, 2021/04/23
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Christian Jullien, 2021/04/24
- Re: [Tinycc-devel] [PATCH 09/11] riscv64-asm: Implement asm_parse_regvar, Danny Milosavljevic, 2021/04/26
[Tinycc-devel] [PATCH 04/11] riscv64-asm: Add lui, auipc, Danny Milosavljevic, 2021/04/07