1
0
Fork 0
tinycc/arm64-asm.c

95 lines
1.9 KiB
C
Raw Permalink Normal View History

2021-01-03 16:49:17 +02:00
/*************************************************************/
/*
* ARM64 dummy assembler for TCC
*
*/
#ifdef TARGET_DEFS_ONLY
#define CONFIG_TCC_ASM
#define NB_ASM_REGS 16
ST_FUNC void g(int c);
ST_FUNC void gen_le16(int c);
ST_FUNC void gen_le32(int c);
2021-01-03 16:49:17 +02:00
/*************************************************************/
#else
/*************************************************************/
#define USING_GLOBALS
#include "tcc.h"
static void asm_error(void)
2021-01-03 16:49:17 +02:00
{
tcc_error("ARM asm not implemented.");
2021-01-03 16:49:17 +02:00
}
/* XXX: make it faster ? */
ST_FUNC void g(int c)
2021-01-03 16:49:17 +02:00
{
int ind1;
if (nocode_wanted)
2021-01-03 16:49:17 +02:00
return;
ind1 = ind + 1;
2021-01-03 16:49:17 +02:00
if (ind1 > cur_text_section->data_allocated)
section_realloc(cur_text_section, ind1);
cur_text_section->data[ind] = c;
ind = ind1;
2021-01-03 16:49:17 +02:00
}
ST_FUNC void gen_le16 (int i)
2021-01-03 16:49:17 +02:00
{
g(i);
g(i>>8);
2021-01-03 16:49:17 +02:00
}
ST_FUNC void gen_le32 (int i)
2021-01-03 16:49:17 +02:00
{
gen_le16(i);
gen_le16(i>>16);
2021-01-03 16:49:17 +02:00
}
ST_FUNC void gen_expr32(ExprValue *pe)
2021-01-03 16:49:17 +02:00
{
gen_le32(pe->v);
2021-01-03 16:49:17 +02:00
}
ST_FUNC void asm_opcode(TCCState *s1, int opcode)
2021-01-03 16:49:17 +02:00
{
asm_error();
2021-01-03 16:49:17 +02:00
}
ST_FUNC void subst_asm_operand(CString *add_str, SValue *sv, int modifier)
2021-01-03 16:49:17 +02:00
{
asm_error();
2021-01-03 16:49:17 +02:00
}
/* generate prolog and epilog code for asm statement */
ST_FUNC void asm_gen_code(ASMOperand *operands, int nb_operands,
2021-01-03 16:49:17 +02:00
int nb_outputs, int is_output,
uint8_t *clobber_regs,
int out_reg)
{
}
ST_FUNC void asm_compute_constraints(ASMOperand *operands,
2021-01-03 16:49:17 +02:00
int nb_operands, int nb_outputs,
const uint8_t *clobber_regs,
int *pout_reg)
{
}
ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char *str)
2021-01-03 16:49:17 +02:00
{
asm_error();
2021-01-03 16:49:17 +02:00
}
ST_FUNC int asm_parse_regvar (int t)
2021-01-03 16:49:17 +02:00
{
asm_error();
2021-01-03 16:49:17 +02:00
return -1;
}
/*************************************************************/
#endif /* ndef TARGET_DEFS_ONLY */