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] Added designated output instruction emitters #96741

Merged
merged 120 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
db5bc1c
Added declarations and r-type definition with assert helper
Dec 15, 2023
f09636f
Added insEncodeITypeInstr
Dec 15, 2023
ffeb2ad
Added definition of S type instr
Dec 15, 2023
4fba3b7
Added definition of U type instr
Dec 15, 2023
e2589bf
Added definition of B type instr
Dec 15, 2023
b5a17d3
Added definition of J type instr
Dec 15, 2023
ca39ca4
Restructurized bit operations
Dec 15, 2023
b280072
Improved checks in insEncode functions
Dec 15, 2023
6efd95d
Merge branch 'main' into riscv-emit-output-instr-refactor
Dec 18, 2023
5df65bc
Fixed some of the encoding methods
Dec 18, 2023
593009b
Bugfix
Dec 18, 2023
c238b82
Fixed comparation sign
Dec 18, 2023
c5f212a
Revert "Fixed comparation sign"
Dec 18, 2023
f9adbef
Fixed comparation sign
Dec 18, 2023
661aeba
Reverted changes in emitOutputInstrJumpDistanceHelper
Dec 18, 2023
6a8dffa
Fixed misspell
Dec 18, 2023
9e095a5
Fixes after review
Dec 18, 2023
ce8f594
Fixes in insEncodeJTypeInstr
Dec 19, 2023
e8f7149
Added emitOutput_RTypeInstr
Dec 19, 2023
37cfcb4
Added emitOutput_ITypeInstr
Dec 19, 2023
41600c6
Added emitOutput_STypeInstr
Dec 19, 2023
2098df0
Added emitOutput_UTypeInstr
Dec 19, 2023
c137d46
Added emitOutput_BTypeInstr
Dec 19, 2023
71485b5
Added emitOutput_JTypeInstr
Dec 19, 2023
6b6eaa3
Fixes in emitOutput_ methods
Dec 19, 2023
4d2d7c1
Replaced reloc with new code
Dec 19, 2023
12eabde
Removed invalid code
Dec 19, 2023
3760402
Added emit output rellocation
Dec 19, 2023
e0a89cc
Minor changes
Dec 19, 2023
9cb8a71
Added emitOutputInstr_Addi8
Dec 19, 2023
abb73ab
Implemented further addi32
Dec 19, 2023
bdf0489
Reverted changes from la
Dec 20, 2023
c1a0c4a
Fixed format bug
Dec 20, 2023
50f99d3
Fixed comment
Dec 20, 2023
694e53d
Renamed some of the emitters
Dec 22, 2023
a348d73
Added some comments
Dec 22, 2023
daf5c2a
Improved implementation and finished addi32
Dec 22, 2023
e468961
Microimprovements
Dec 22, 2023
8d91418
Quickfix to upperNBitsOfWord
Dec 22, 2023
5b350c2
Finished substituting instr_optsi
Dec 22, 2023
4aaf35f
Fixed bug in mask
Dec 22, 2023
3a7764b
Added emitOutputInstr_OptsRcReloc and prelimiary parent function
Dec 22, 2023
6899d5b
Added emitOutput_OptsRcNoReloc
Dec 22, 2023
2a7c354
Improvements in OptsRc
Dec 22, 2023
dca50f0
Fixes and introduced an emitOutputInstr_OptsRc
Dec 22, 2023
851b75a
Added emitOutputInstr_OptsRl and removed unused args from other funct…
Dec 22, 2023
2296c9d
Added emitOutputInstr_OptsRlReloc
Dec 22, 2023
4b11390
Finished emitOutputInstr_OptsRcNoReloc
Dec 22, 2023
33a0fc3
Fixed bugs and finished opts rl
Dec 22, 2023
429783f
Added emitOutputInstr_OptsJalr
Dec 22, 2023
0cc4781
Added emitOutputInstr_OptsJalr8
Dec 22, 2023
dcc623a
Added special comparation inverter
Dec 22, 2023
0308aa3
Add emitOutputInstr_OptsJalr24
Dec 22, 2023
f5f9562
Added emitOutputInstr_OptsJalr28
Dec 22, 2023
4bf37a0
Improved emitOutputInstr_OptsJalr28
Dec 22, 2023
a11b900
Enabled new opts jalr impl
Dec 22, 2023
aa4ed43
Added emitOutputInstr_OptsJCond
Jan 3, 2024
4e41b9a
Added emitOutputInstr_OptsJ
Jan 3, 2024
7b0dc15
Replaced old code with the new one
Jan 3, 2024
a4b3a26
Added emitOutputInstr_OptsC
Jan 3, 2024
8267ae7
Fixed last piece of switch
Jan 3, 2024
483d55c
Merge branch 'dotnet:main' into riscv-emit-output-instr-refactor
Bajtazar Jan 3, 2024
9e9d6d4
Removed old code
Jan 3, 2024
8fbc91d
Simplified code
Jan 3, 2024
89da41b
Other fixes
Jan 3, 2024
338a7bb
Fixes in emitOutput_* instr
Jan 3, 2024
83e052a
Fixed bitmask bug
Jan 3, 2024
9bd30a2
Merge branch 'riscv-encoded-ins-quickfix' into riscv-emit-output-inst…
Jan 3, 2024
3dddca6
Added temporary reinforced assers
Jan 8, 2024
8ab3b4c
Added shift ins
Jan 8, 2024
3813230
Improved shift func
Jan 8, 2024
ee5feab
Inserted shift func
Jan 8, 2024
6b9ec0d
Fixed minor bug
Jan 8, 2024
c849405
Other fixes
Jan 8, 2024
bddb835
Added checks to r type emitter
Jan 8, 2024
3fedc7a
Improved sanity checks in the emitOutput_RTypeInstr
Jan 9, 2024
34b6a28
Added ITypeInstr sanity checks
Jan 9, 2024
b3b88a4
Moved ITypeInstr_Shift sanity Check
Jan 9, 2024
ddefdc2
Added comment to the emitriscv64
Jan 9, 2024
7bdb37e
Added S-type sanity checks
Jan 9, 2024
b763720
Removed Shift ITypeInstr Variant
Jan 9, 2024
a147ef5
Fixes
Jan 9, 2024
c65ec81
Added BType sanity check
Jan 9, 2024
9d86e2c
Added csr operations to sanity checks
Jan 9, 2024
4e901da
Added ITypeInstr sanity check
Jan 9, 2024
4f2b7f4
Fixes
Jan 9, 2024
c1970c6
Removed duplicated code
Jan 9, 2024
eaae5bb
Fixed bug in noreloc
Jan 9, 2024
79a5301
Removed dead asserts
Jan 10, 2024
b776df5
Removed now unused asserts
Jan 10, 2024
1977b05
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 10, 2024
e08f86b
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 10, 2024
44eb85d
Fixed format
Jan 10, 2024
58bc44d
Merge branch 'riscv-emit-output-instr-refactor' of https://github.com…
Jan 10, 2024
d1dfaf1
Fixed missing const
Jan 10, 2024
870fa3c
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 10, 2024
150eb42
Removed useless ifdef
Jan 10, 2024
37064af
Merge branch 'riscv-emit-output-instr-refactor' of https://github.com…
Jan 10, 2024
d4c77ad
Fixed missing asserts
Jan 10, 2024
ef18dea
Added a new assert
Jan 10, 2024
b7bf02f
Merge branch 'main' into riscv-emit-output-instr-refactor
Jan 10, 2024
aae544b
Added zero assert
Jan 10, 2024
8583d52
Removed useless FALLTHROUGH statements
Jan 10, 2024
9cd98ab
Added trimmers
Jan 10, 2024
4c72aa1
Added explicit signed integers trimming
Jan 12, 2024
e09f03a
Fixes to prev commit
Jan 12, 2024
4b0f5ee
Added castFloatOrIntegralReg and fixed invalid asserts
Jan 12, 2024
03fcfa9
Renamed upper word helpers
Jan 12, 2024
334efa6
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 12, 2024
a18bf48
Spell fix
Jan 12, 2024
f258870
Merge branch 'riscv-emit-output-instr-refactor' of https://github.com…
Jan 12, 2024
97b0951
Moved castFloat... to the emitter
Jan 12, 2024
23666e9
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 12, 2024
6c9fe76
Changes after code review
Jan 12, 2024
6cd5af7
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 12, 2024
1f1f7cc
Merge branch 'main' into riscv-emit-output-instr-refactor
Bajtazar Jan 15, 2024
7e13ad4
Removed bitcast
Jan 15, 2024
6f61ec0
Added additional check
Jan 15, 2024
0246245
Removed unnecessary reinterpret casts
Jan 15, 2024
1120364
Removed redundant asserts
Jan 15, 2024
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
6 changes: 3 additions & 3 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void emitLclVarAddr::initLclVarAddr(int varNum, unsigned offset)
}

// Returns the variable to access. Note that it returns a negative number for compiler spill temps.
int emitLclVarAddr::lvaVarNum()
int emitLclVarAddr::lvaVarNum() const
{
switch (_lvaTag)
{
Expand All @@ -721,7 +721,7 @@ int emitLclVarAddr::lvaVarNum()
}
}

unsigned emitLclVarAddr::lvaOffset() // returns the offset into the variable to access
unsigned emitLclVarAddr::lvaOffset() const // returns the offset into the variable to access
{
switch (_lvaTag)
{
Expand Down Expand Up @@ -9742,7 +9742,7 @@ void emitter::emitRemoveLastInstruction()
* emitGetInsSC: Get the instruction's constant value.
*/

cnsval_ssize_t emitter::emitGetInsSC(instrDesc* id)
cnsval_ssize_t emitter::emitGetInsSC(const instrDesc* id) const
{
#ifdef TARGET_ARM // should it be TARGET_ARMARCH? Why do we need this? Note that on ARM64 we store scaled immediates
// for some formats
Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,9 @@ struct emitLclVarAddr
// Constructor
void initLclVarAddr(int varNum, unsigned offset);

int lvaVarNum(); // Returns the variable to access. Note that it returns a negative number for compiler spill temps.
unsigned lvaOffset(); // returns the offset into the variable to access
int lvaVarNum() const; // Returns the variable to access. Note that it returns a negative number for compiler spill
// temps.
unsigned lvaOffset() const; // returns the offset into the variable to access

// This struct should be 32 bits in size for the release build.
// We have this constraint because this type is used in a union
Expand Down Expand Up @@ -2105,7 +2106,7 @@ class emitter
static const IS_INFO emitGetSchedInfo(insFormat f);
#endif // TARGET_XARCH

cnsval_ssize_t emitGetInsSC(instrDesc* id);
cnsval_ssize_t emitGetInsSC(const instrDesc* id) const;
unsigned emitInsCount;

/************************************************************************/
Expand Down
Loading
Loading