Skip to content

Conversation

fanyang-mono
Copy link
Member

Fixes #48475


/* used by the register allocator */
gint32 dreg, sreg1, sreg2, sreg3;
gint32 dreg, sreg1, sreg2, sreg3, sreg4;
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's 4 bytes of padding between sreg3 and next on 64-bit machines.

Copy link
Contributor

@CoffeeFlux CoffeeFlux Mar 2, 2021

Choose a reason for hiding this comment

The 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.

} LLVMCallInfo;

#define MONO_MAX_SRC_REGS 3
#define MONO_MAX_SRC_REGS 4
Copy link
Contributor

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.

Copy link
Member Author

@fanyang-mono fanyang-mono Mar 2, 2021

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.

@imhameed
Copy link
Contributor

imhameed commented Mar 2, 2021

Current consensus is 'too much churn/work for minimal gain'. #48475 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mono] Support 4-arg ops in mini IR

5 participants