-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add support for 4-arg ops in mini IR #48908
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,15 +717,15 @@ typedef struct { | |
LLVMArgInfo args [1]; | ||
} LLVMCallInfo; | ||
|
||
#define MONO_MAX_SRC_REGS 3 | ||
#define MONO_MAX_SRC_REGS 4 | ||
|
||
struct MonoInst { | ||
guint16 opcode; | ||
guint8 type; /* stack type */ | ||
guint8 flags; | ||
|
||
/* used by the register allocator */ | ||
gint32 dreg, sreg1, sreg2, sreg3; | ||
gint32 dreg, sreg1, sreg2, sreg3, sreg4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a fair bit of discussion about this when I looked into it, and I thought the conclusion was that we didn't want to add them this way since it's only an immediate value. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds a lot of overhead for the tiny minority of opcodes which have 4 opcodes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's 4 bytes of padding between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still run on a (sadly) 32-bit platform – wasm – so I don't think we can assume this doesn't add overhead on platforms we care about. Which is not to say we can't take this approach, just that it shouldn't be predicated on incorrect assumptions. |
||
|
||
MonoInst *next, *prev; | ||
|
||
|
@@ -1728,15 +1728,20 @@ extern MonoJitStats mono_jit_stats; | |
#ifdef MINI_OP3 | ||
#undef MINI_OP3 | ||
#endif | ||
#ifdef MINI_OP4 | ||
#undef MINI_OP4 | ||
#endif | ||
#define MINI_OP(a,b,dest,src1,src2) a, | ||
#define MINI_OP3(a,b,dest,src1,src2,src3) a, | ||
#define MINI_OP4(a,b,dest,src1,src2,src3,src4) a, | ||
enum { | ||
OP_START = MONO_CEE_LAST - 1, | ||
#include "mini-ops.h" | ||
OP_LAST | ||
}; | ||
#undef MINI_OP | ||
#undef MINI_OP3 | ||
#undef MINI_OP4 | ||
|
||
#if TARGET_SIZEOF_VOID_P == 8 | ||
#define OP_PCONST OP_I8CONST | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is actually not enough and the
3
value is hard-coded in a few different places instead of just using this define.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is far away from being completed. I just did the most basic change. Will fix the errors exposed by testing.