Skip to content

Commit 01d1b7b

Browse files
committed
Add support for f{l,s}d in riscv64-gen
1 parent 1958928 commit 01d1b7b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

riscv64-asm.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,9 @@ static void asm_mem_access_opcode(TCCState *s1, int token)
806806
case TOK_ASM_lwu:
807807
asm_emit_i(token, (0x0 << 2) | 3 | (6 << 12), &ops[0], &ops[1], &ops[2]);
808808
return;
809+
case TOK_ASM_fld:
810+
asm_emit_i(token, (0x1 << 2) | 3 | (3 << 12), &ops[0], &ops[1], &ops[2]);
811+
return;
809812

810813
// s{b|h|w|d} rs2, imm(rs1); S-format (with rsX swapped)
811814
case TOK_ASM_sb:
@@ -820,6 +823,9 @@ static void asm_mem_access_opcode(TCCState *s1, int token)
820823
case TOK_ASM_sd:
821824
asm_emit_s(token, (0x8 << 2) | 3 | (3 << 12), &ops[1], &ops[0], &ops[2]);
822825
return;
826+
case TOK_ASM_fsd:
827+
asm_emit_s(token, (0x9 << 2) | 3 | (3 << 12), &ops[1], &ops[0], &ops[2]);
828+
return;
823829
}
824830
}
825831

@@ -1272,13 +1278,15 @@ ST_FUNC void asm_opcode(TCCState *s1, int token)
12721278
case TOK_ASM_lh:
12731279
case TOK_ASM_lw:
12741280
case TOK_ASM_ld:
1281+
case TOK_ASM_fld:
12751282
case TOK_ASM_lbu:
12761283
case TOK_ASM_lhu:
12771284
case TOK_ASM_lwu:
12781285
case TOK_ASM_sb:
12791286
case TOK_ASM_sh:
12801287
case TOK_ASM_sw:
12811288
case TOK_ASM_sd:
1289+
case TOK_ASM_fsd:
12821290
asm_mem_access_opcode(s1, token);
12831291
break;
12841292

0 commit comments

Comments
 (0)