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

Add support for externs, pointers (ffi), casts #95

Merged
merged 8 commits into from
Apr 11, 2024
Merged

Add support for externs, pointers (ffi), casts #95

merged 8 commits into from
Apr 11, 2024

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Mar 7, 2024

Adds the following:

  • Support to declare extern functions, like malloc.
  • Support for pointers to use for ffi in the std
  • Support for casts (needed to use pointers in a useful way)

Todo:

  • Pointer arithmetic

@edg-l edg-l changed the base branch from main to add_structs_ir March 7, 2024 12:10
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 52.63158% with 252 lines in your changes are missing coverage. Please review.

Project coverage is 61.83%. Comparing base (7ccb2cc) to head (99269b4).

Files Patch % Lines
crates/concrete_ir/src/lowering.rs 56.65% 127 Missing ⚠️
crates/concrete_codegen_mlir/src/codegen.rs 55.26% 68 Missing ⚠️
crates/concrete_ir/src/lib.rs 32.60% 31 Missing ⚠️
crates/concrete_ir/src/lowering/prepass.rs 50.00% 15 Missing ⚠️
crates/concrete_check/src/lib.rs 0.00% 10 Missing ⚠️
crates/concrete_ast/src/types.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            bench      #95      +/-   ##
==========================================
- Coverage   64.29%   61.83%   -2.46%     
==========================================
  Files          33       33              
  Lines        3355     3650     +295     
==========================================
+ Hits         2157     2257     +100     
- Misses       1198     1393     +195     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from add_structs_ir to main March 7, 2024 17:04
@edg-l edg-l changed the title Add support for extern fns and pointers (for ffi/to wrap libc) Add support for externs, pointers (ffi), casts Mar 12, 2024
@edg-l edg-l changed the base branch from main to bench March 12, 2024 11:43
@edg-l edg-l changed the base branch from bench to main March 12, 2024 11:43
@edg-l edg-l changed the base branch from main to bench March 12, 2024 11:44
Copy link

github-actions bot commented Mar 12, 2024

Benchmarking factorial

Running 5000000 iterations
Using input value: 20
Concrete Result = 2432902008176640000 Time taken : 59.40 ms
Rust Result = 2432902008176640000 Time taken : 60.08 ms

Benchmarking fib

Running 5000 iterations
Using input value: 20
Concrete Result = 6765 Time taken : 135.91 ms
Rust Result = 6765 Time taken : 85.22 ms

@edg-l edg-l marked this pull request as ready for review March 14, 2024 14:08
Base automatically changed from bench to main March 14, 2024 14:24
@unbalancedparentheses
Copy link
Member

This needs to be reviewed in terms of design. @igaray @juanbono let's jump on a call tomorrow.

@igaray igaray merged commit c3a499c into main Apr 11, 2024
5 checks passed
@igaray igaray deleted the externfn branch April 11, 2024 18:44
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.

5 participants