History

riscv: Add .option assembly directive (unimp)

Ekaitz Zarraga committed 2 years ago

Commit cbe70fa1 parent 618c1733 files · +38 −1Browse files

Unified · Split

3 files
  1. riscv64-tok.h +11 −0
  2. tccasm.c +23 −0
  3. tcctok.h +4 −1
riscv64-tok.h+11−0
@@ -411,4 +411,15 @@ · 410 unmodified lines
411411 DEF_ASM(snez)
412412 DEF_ASM(tail)
413413
414+/* Possible values for .option directive */
415+ DEF_ASM(arch)
416+ DEF_ASM(rvc)
417+ DEF_ASM(norvc)
418+ DEF_ASM(pic)
419+ DEF_ASM(nopic)
420+ DEF_ASM(relax)
421+ DEF_ASM(norelax)
422+ DEF_ASM(push)
423+ DEF_ASM(pop)
424+
414425 #undef DEF_ASM_WITH_SUFFIX
tccasm.c+23−0
@@ -922,6 +922,29 @@ static void asm_parse_directive(TCCState *s1, int global) · 921 unmodified lines
922922 case TOK_ASMDIR_code64:
923923 next();
924924 break;
925+#endif
926+#ifdef TCC_TARGET_RISCV64
927+ case TOK_ASMDIR_option:
928+ next();
929+ switch(tok){
930+ case TOK_ASM_pic:
931+ case TOK_ASM_nopic:
932+ case TOK_ASM_relax:
933+ case TOK_ASM_norelax:
934+ case TOK_ASM_push:
935+ case TOK_ASM_pop:
936+ /* TODO: unimplemented */
937+ next();
938+ break;
939+ case TOK_ASM_arch:
940+ /* TODO: unimplemented, requires extra parsing */
941+ tcc_error("unimp .option '.%s'", get_tok_str(tok, NULL));
942+ break;
943+ default:
944+ tcc_error("unknown .option '.%s'", get_tok_str(tok, NULL));
945+ break;
946+ }
947+ break;
925948 #endif
926949 default:
927950 tcc_error("unknown assembler directive '.%s'", get_tok_str(tok, NULL));
tcctok.h+4−1
@@ -202,7 +202,8 @@ · 201 unmodified lines
202202 /* pragma */
203203 DEF(TOK_pack, "pack")
204204 #if !defined(TCC_TARGET_I386) && !defined(TCC_TARGET_X86_64) && \
205− !defined(TCC_TARGET_ARM) && !defined(TCC_TARGET_ARM64)
205+ !defined(TCC_TARGET_ARM) && !defined(TCC_TARGET_ARM64) && \
206+ !defined(TCC_TARGET_RISCV64)
206207 /* already defined for assembler */
207208 DEF(TOK_ASM_push, "push")
208209 DEF(TOK_ASM_pop, "pop")
@@ -401,6 +402,8 @@ · 192 unmodified lines
401402 DEF_ASMDIR(code32)
402403 #elif defined(TCC_TARGET_X86_64)
403404 DEF_ASMDIR(code64)
405+#elif defined(TCC_TARGET_RISCV64)
406+ DEF_ASMDIR(option)
404407 #endif
405408 DEF_ASMDIR(short)
406409 DEF_ASMDIR(long)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t