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

feat: add unsafe arithmetic ops #2629

Merged
merged 13 commits into from
Mar 4, 2022

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Feb 6, 2022

What I did

introduce unsafe math ops for #2429

How I did it

add unsafe add/sub/mul/div builtins. for int types that are smaller than 256 bits, they perform wrapping arithmetic

How to verify it

check the tests

Commit message

(tbd)

Description for the changelog

Add unsafe_ arithmetic ops which don't use checked arithmetic

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 6, 2022

This pull request introduces 1 alert and fixes 1 when merging 606f151 into 82f44ee - view on LGTM.com

new alerts:

  • 1 for Syntax error

fixed alerts:

  • 1 for 'import *' may pollute namespace

@charles-cooper charles-cooper force-pushed the unsafe_math branch 2 times, most recently from ebb1c6b to 204cb96 Compare February 8, 2022 04:07
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #2629 (85ef71c) into master (3de52b3) will increase coverage by 0.00%.
The diff coverage is 86.95%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2629   +/-   ##
=======================================
  Coverage   86.29%   86.29%           
=======================================
  Files          91       91           
  Lines        9739     9787   +48     
  Branches     2466     2479   +13     
=======================================
+ Hits         8404     8446   +42     
- Misses        833      838    +5     
- Partials      502      503    +1     
Impacted Files Coverage Δ
vyper/utils.py 85.71% <71.42%> (-1.43%) ⬇️
vyper/builtin_functions/functions.py 88.36% <93.54%> (+0.17%) ⬆️
vyper/codegen/expr.py 79.62% <100.00%> (+0.33%) ⬆️
vyper/cli/vyper_compile.py 68.14% <0.00%> (-0.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3de52b3...85ef71c. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 18, 2022

This pull request introduces 1 alert when merging ffce251 into e480e91 - view on LGTM.com

new alerts:

  • 1 for Unused import

@charles-cooper charles-cooper force-pushed the unsafe_math branch 2 times, most recently from 3e9b96d to d910d1b Compare February 18, 2022 01:30
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 18, 2022

This pull request introduces 1 alert and fixes 1 when merging d910d1b into e480e91 - view on LGTM.com

new alerts:

  • 1 for Syntax error

fixed alerts:

  • 1 for 'import *' may pollute namespace

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 18, 2022

This pull request introduces 1 alert and fixes 1 when merging 7cb3379 into e480e91 - view on LGTM.com

new alerts:

  • 1 for Syntax error

fixed alerts:

  • 1 for 'import *' may pollute namespace

luckily codegen is really easy - just compile straight to the EVM ops
add tests
actually the codegen is not so easy for non-[u]int256 types.
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 23, 2022

This pull request introduces 2 alerts when merging 768abf9 into 3de52b3 - view on LGTM.com

new alerts:

  • 2 for Unused import

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 25, 2022

This pull request introduces 3 alerts when merging 748db64 into 3de52b3 - view on LGTM.com

new alerts:

  • 3 for Unused import

@charles-cooper charles-cooper changed the title wip unsafe math feat: add unsafe arithmetic ops Feb 25, 2022
@charles-cooper charles-cooper marked this pull request as ready for review February 25, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants