pike.git / src / code / riscv.c

version» Context lines:

pike.git/src/code/riscv.c:280:    unsigned INT32 flags;    size_t millicode[RV_MILLICODE_MAX+1];   } compiler_state;         /* Create a <4 KiO jumptable */      enum rv_jumpentry {    RV_JUMPENTRY_BRANCH_CHECK_THREADS_ETC,    RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH, +  RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH_AT,    RV_JUMPENTRY_COMPLEX_SVALUE_IS_TRUE,    RV_JUMPENTRY_LOW_RETURN,    RV_JUMPENTRY_LOW_RETURN_POP,    RV_JUMPENTRY_F_OFFSET,   };      #define JUMPTABLE_SECTION __attribute__((section(".text.jumptable")))      void riscv_jumptable(void) JUMPTABLE_SECTION;   void riscv_jumptable(void) { }
pike.git/src/code/riscv.c:302:    static RETTYPE PIKE_CONCAT(rv_jumptable_, OP)ARGTYPES JUMPTABLE_SECTION; \    static RETTYPE PIKE_CONCAT(rv_jumptable_, OP)ARGTYPES { \    RET TARGET ARGS; \    }   #define JUMP_ENTRY(OP, TARGET, RETTYPE, ARGTYPES, RET, ARGS) \    extern RETTYPE TARGET ARGTYPES; \    JUMP_ENTRY_NOPROTO(OP, TARGET, RETTYPE, ARGTYPES, RET, ARGS)      JUMP_ENTRY_NOPROTO(branch_check_threads_etc, branch_check_threads_etc, void, (void), , ())   JUMP_ENTRY_NOPROTO(inter_return_opcode_F_CATCH, inter_return_opcode_F_CATCH, PIKE_OPCODE_T *, (PIKE_OPCODE_T *addr), return, (addr)) + JUMP_ENTRY_NOPROTO(inter_return_opcode_F_CATCH_AT, inter_return_opcode_F_CATCH_AT, PIKE_OPCODE_T *, (PIKE_OPCODE_T *addr), return, (addr))   JUMP_ENTRY_NOPROTO(complex_svalue_is_true, complex_svalue_is_true, int, (const struct svalue *s), return, (s))   JUMP_ENTRY_NOPROTO(low_return, low_return, void, (void), , ())   JUMP_ENTRY_NOPROTO(low_return_pop, low_return_pop, void, (void), , ())      #define OPCODE_NOCODE(DESC, OP, FLAGS)   #define OPCODE0(OP,DESC,FLAGS) JUMP_ENTRY(OP, PIKE_CONCAT(opcode_, OP), void, (void), , ())   #define OPCODE1(OP,DESC,FLAGS) JUMP_ENTRY(OP, PIKE_CONCAT(opcode_, OP), void, (INT32 a), , (a))   #define OPCODE2(OP,DESC,FLAGS) JUMP_ENTRY(OP, PIKE_CONCAT(opcode_, OP), void, (INT32 a, INT32 b), , (a, b))   #define OPCODE0_JUMP(OP,DESC,FLAGS) JUMP_ENTRY(OP, PIKE_CONCAT(jump_opcode_, OP), void *, (void), return, ())   #define OPCODE1_JUMP(OP,DESC,FLAGS) JUMP_ENTRY(OP, PIKE_CONCAT(jump_opcode_, OP), void *, (INT32 a), return, (a))
pike.git/src/code/riscv.c:350:   #include "interpret_protos.h"   #undef JUMP_ENTRY_NOPROTO   #define JUMP_ENTRY_NOPROTO(OP, TARGET, RETTYPE, ARGTYPES, RET, ARGS) \    [ (OP)-F_OFFSET+RV_JUMPENTRY_F_OFFSET ] = (void *)PIKE_CONCAT(rv_jumptable_, OP),   #undef JUMP_ENTRY   #define JUMP_ENTRY JUMP_ENTRY_NOPROTO   static void * const rv_jumptable_index[] =   {    [RV_JUMPENTRY_BRANCH_CHECK_THREADS_ETC] = rv_jumptable_branch_check_threads_etc,    [RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH] = rv_jumptable_inter_return_opcode_F_CATCH, +  [RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH_AT] = rv_jumptable_inter_return_opcode_F_CATCH_AT,    [RV_JUMPENTRY_COMPLEX_SVALUE_IS_TRUE] = rv_jumptable_complex_svalue_is_true,    [RV_JUMPENTRY_LOW_RETURN] = rv_jumptable_low_return,    [RV_JUMPENTRY_LOW_RETURN_POP] = rv_jumptable_low_return_pop,   #include "interpret_protos.h"   };         void riscv_ins_int(INT32 n)   {   #if PIKE_BYTEORDER == 1234
pike.git/src/code/riscv.c:644:      static void rv_call_c_opcode(unsigned int opcode)   {    int flags = instrs[opcode-F_OFFSET].flags;    enum rv_jumpentry index = opcode-F_OFFSET+RV_JUMPENTRY_F_OFFSET;       rv_maybe_update_pc();       if (opcode == F_CATCH)    index = RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH; +  else if (opcode == F_CATCH_AT) +  index = RV_JUMPENTRY_INTER_RETURN_OPCODE_F_CATCH_AT;       rv_call_via_jumptable(index);       if (flags & I_UPDATE_SP) {    compiler_state.flags &= ~FLAG_SP_LOADED;    }    if (flags & I_UPDATE_M_SP) {}    if (flags & I_UPDATE_FP) {    compiler_state.flags &= ~FLAG_FP_LOADED;    }
pike.git/src/code/riscv.c:749:   }      void riscv_ins_f_byte(unsigned int opcode)   {    int flags = instrs[opcode-F_OFFSET].flags;    INT32 rel_addr;       switch (opcode) {       case F_CATCH: +  case F_CATCH_AT:    {    rel_addr = PIKE_PC;    rv_emit(RV_AUIPC(RV_REG_A0, 0));    rv_emit(RV_ADDI_(RV_REG_A0, RV_REG_A0, 0));    }    break;       case F_RETURN_IF_TRUE:    {    rv_load_sp_reg();
pike.git/src/code/riscv.c:813:    rv_emit(RV_BNE(RV_REG_A5, RV_REG_ZERO, 0));    rv_func_epilogue();    UPDATE_F_JUMP(branch_op, PIKE_PC);    }       if (flags & I_JUMP) {    /* This is the code that JUMP_EPILOGUE_SIZE compensates for. */    rv_emit(RV_JALR(RV_REG_ZERO, RV_REG_A0, 0));    rv_maybe_regenerate_millicode();    -  if (opcode == F_CATCH) { +  if ((opcode == F_CATCH) || (opcode == F_CATCH_AT)) {    rv_update_pcrel(rel_addr, RV_REG_A0, 2*(PIKE_PC - rel_addr));    }    }   }      void riscv_ins_f_byte_with_arg(unsigned int a, INT32 b)   {    rv_mov_int32(RV_REG_A0, b);    riscv_ins_f_byte(a);   }