Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISC-V] coreclr-jit directory #82379

Merged
merged 27 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
15cf55b
[RISCV-V] coreclr-jit directory
clamp03 Oct 26, 2022
f4aa536
Fix in jit/CMakeLists.txt
clamp03 Feb 20, 2023
37f9519
Tidy up by jit-format
clamp03 Feb 20, 2023
f3a7a41
Add a emitIns_S_R_R to handling more temporary reg
clamp03 Feb 21, 2023
521db1c
Fix jit code format
clamp03 Feb 21, 2023
48c198c
Fix
clamp03 Mar 7, 2023
8760646
[JIT] Fix test
clamp03 Mar 7, 2023
60d461d
[JIT] Updated
clamp03 Mar 8, 2023
d18dba2
[JIT] JitFormat
clamp03 Mar 8, 2023
2ed1f9c
[JIT] Enable IsImplicitByrefParameterValuePostMorph
clamp03 Mar 8, 2023
d78f857
[JIT] Update
clamp03 Mar 9, 2023
ffb1eb6
Merge remote-tracking branch 'upstream/main' into riscv_jit
clamp03 Mar 10, 2023
6c4b302
[JIT] Replace to RISCV64
clamp03 Mar 15, 2023
30591c9
[JIT] Update emitter and fix bugs
clamp03 Mar 22, 2023
2cff93e
[JIT] Fix a build error (remove GT_ADDR)
clamp03 Apr 3, 2023
b8d92e1
[JIT] FIX BUILD ERROR
clamp03 Apr 4, 2023
618978a
[JIT] Update by reviews
clamp03 Apr 5, 2023
cec6fa0
[JIT] Update JCMP and fix related errors
clamp03 Apr 5, 2023
db341cc
[JIT] Add NYI
clamp03 Apr 5, 2023
607dd64
[JIT] Add getRISCV64PassStructInRegisterFlags
clamp03 Apr 6, 2023
6492c51
[JIT] Remove constant handling in genRangeCheck
clamp03 Apr 6, 2023
f06eef5
[VM] Add getRISCV64PassStructInRegisterFlags
clamp03 Apr 6, 2023
672629a
[VM] Update JITEEVersionIdentifier
clamp03 Apr 6, 2023
f25d760
Merge remote-tracking branch 'upstream/main' into riscv_jit
clamp03 Apr 6, 2023
718b6d9
Run jit-format
jakobbotsch Apr 6, 2023
b94ebc5
Merge branch 'main' of github.com:dotnet/runtime into pr-82379
jakobbotsch Apr 8, 2023
f39aaa3
Fix after merge
jakobbotsch Apr 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[JIT] Fix test
  • Loading branch information
clamp03 committed Mar 8, 2023
commit 8760646d26b6087c619ebe7d0f63b20c5be821bb
18 changes: 17 additions & 1 deletion src/coreclr/jit/codegenriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5522,7 +5522,23 @@ void CodeGen::genCodeForIndir(GenTreeIndir* tree)
//
void CodeGen::genCodeForCpBlkHelper(GenTreeBlk* cpBlkNode)
{
NYI("unimplemented on RISCV64 yet");
// Destination address goes in arg0, source address goes in arg1, and size goes in arg2.
// genConsumeBlockOp takes care of this for us.
genConsumeBlockOp(cpBlkNode, REG_ARG_0, REG_ARG_1, REG_ARG_2);

if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
{
// issue a full memory barrier before a volatile CpBlk operation
instGen_MemoryBarrier();
}

genEmitHelperCall(CORINFO_HELP_MEMCPY, 0, EA_UNKNOWN);

if (cpBlkNode->gtFlags & GTF_BLK_VOLATILE)
{
// issue a INS_BARRIER_RMB after a volatile CpBlk operation
instGen_MemoryBarrier(BARRIER_FULL);
}
}

//----------------------------------------------------------------------------------
Expand Down
16 changes: 9 additions & 7 deletions src/coreclr/jit/emitriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ void emitter::emitIns_I(instruction ins, emitAttr attr, ssize_t imm)
code |= ((imm >> 20) & 0x1) << 31;
break;
default:
fprintf(stderr, "emitIns_I %llx %llx\n", ins, code);
unreached();
fprintf(stderr, "Not implemented instruction in I: 0x%x\n", code);
NYI_RISCV64("illegal ins within emitIns_I!");
}

instrDesc* id = emitNewInstr(attr);
Expand Down Expand Up @@ -511,8 +511,8 @@ void emitter::emitIns_R_I(instruction ins, emitAttr attr, regNumber reg, ssize_t
code |= ((imm >> 20) & 0x1) << 31;
break;
default:
fprintf(stderr, "emitIns_R_I %llx %llx\n", ins, code);
unreached();
fprintf(stderr, "Not implemented instruction in R_I: 0x%x\n", code);
NYI_RISCV64("illegal ins within emitIns_R_I!");
break;
} // end switch (ins)

Expand Down Expand Up @@ -582,7 +582,8 @@ void emitter::emitIns_R_R(
code |= (reg2 & 0x1f) << 15;
}
else if ((INS_fcvt_s_w <= ins && INS_fmv_w_x >= ins) || (INS_fcvt_d_w == ins || INS_fcvt_d_wu == ins) ||
(INS_fcvt_s_l == ins || INS_fcvt_s_lu == ins) || (INS_fmv_d_x == ins))
(INS_fcvt_s_l == ins || INS_fcvt_s_lu == ins) || (INS_fmv_d_x == ins) ||
(INS_fcvt_d_l == ins || INS_fcvt_d_lu == ins))

{
// TODO CHECK ROUNDING MODE
Expand All @@ -600,6 +601,7 @@ void emitter::emitIns_R_R(
}
else
{
fprintf(stderr, "Not implemented instruction in R_R: 0x%x\n", code);
NYI_RISCV64("illegal ins within emitIns_R_R!");
}

Expand Down Expand Up @@ -649,7 +651,7 @@ void emitter::emitIns_R_R_I(
else
{
fprintf(stderr, "Not implemented instruction in R_R_I: 0x%x\n", code);
_ASSERTE(!"TODO RISCV64 NYI");
NYI_RISCV64("illegal ins within emitIns_R_R_I!");
}
instrDesc* id = emitNewInstr(attr);

Expand Down Expand Up @@ -755,7 +757,7 @@ void emitter::emitIns_R_R_R(
else
{
fprintf(stderr, "Not implemented instruction in R_R_R: 0x%x\n", code);
_ASSERTE(!"TODO RISCV64 NYI");
NYI_RISCV64("illegal ins within emitIns_R_R_R!");
}

instrDesc* id = emitNewInstr(attr);
Expand Down
11 changes: 10 additions & 1 deletion src/coreclr/jit/instr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,16 @@ void CodeGen::inst_RV_RV(instruction ins,
#ifdef TARGET_ARM
GetEmitter()->emitIns_R_R(ins, size, reg1, reg2, flags);
#else
GetEmitter()->emitIns_R_R(ins, size, reg1, reg2);
#ifdef TARGET_RISCV64
if (INS_fsgnj_s == ins || INS_fsgnj_d == ins)
{
GetEmitter()->emitIns_R_R_R(ins, size, reg1, reg2, reg2);
}
else
#endif
{
GetEmitter()->emitIns_R_R(ins, size, reg1, reg2);
}
jakobbotsch marked this conversation as resolved.
Show resolved Hide resolved
#endif
}

Expand Down