Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Implement neg (float/integer) and not IL instructions. Fixes #4524 and #4525 - #4725

Merged
morganbr merged 2 commits into
dotnet:masterfrom
jacano:master
Oct 15, 2017
Merged

morganbr merged 2 commits into
dotnet:masterfrom
jacano:master

Conversation

@jacano

@jacano jacano commented Oct 14, 2017

Copy link
Copy Markdown
Contributor

I took some time to implement the neg and not opcode. I also added support to float for neg op because I noticed a BuildFNeg method was available. I don't really know if this it's correct.
Just let me know if this can help you guys ;)

@dnfclas

dnfclas commented Oct 14, 2017

Copy link
Copy Markdown

@jacano,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@jacano

jacano commented Oct 14, 2017

Copy link
Copy Markdown
Contributor Author

I didn't include a little test in tests/src/Simple/HelloWasm/Program.cs. I'm sorry, I can fix this now

@jacano

jacano commented Oct 14, 2017

Copy link
Copy Markdown
Contributor Author

I suspect I also need to handle the NativeInt type...

Name parameter updated in LLVM build methods to reflect the operation being built.
Use PushExpression method instead of direct push to stack.
@jacano

jacano commented Oct 14, 2017

Copy link
Copy Markdown
Contributor Author

I made two simple tests that are working:

test_passing

I was unable to get the neg test on floats working so I'm not pushing it.
I think that it is still missing some code to handle NativeInt type. I mean, check for NativeInt on the argument kind and make a conversion using LLVM.BuildPtrToInt, then neg/not and later LLVM.BuildIntToPtr.

@morganbr morganbr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great, @jacano. Thanks for the contribution!

@morganbr
morganbr merged commit ea81a18 into dotnet:master Oct 15, 2017
@morganbr morganbr mentioned this pull request Oct 15, 2017
@morganbr

Copy link
Copy Markdown
Contributor

@jacano, now that you've got one in, interested in picking up any more opcodes (or anything else)?

@jacano

jacano commented Oct 15, 2017

Copy link
Copy Markdown
Contributor Author

I think I can give a try to the array ops. As I saw in the issue description, you don't need to interact with the runtime nor the GC, so I suppose I can do it. I hope to have some time during the following week 😀

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.

3 participants