-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce compiler-rt and add bitwise and
, or
, xor
polyfills
#89
Conversation
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.
A good start, but definitely needs some changes in my view. One thing I want to see is documentation of the structure and why this structure is chosen.
eac1dc7
to
06124cc
Compare
Sure, where would be a good place for this? Dedicated |
cca754f
to
106000a
Compare
366eb21
to
bb94e00
Compare
and
polyfillsand
, or
, xor
polyfills
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.
Good stuff, but still more to do! Please apply comments I have made on one polyfill (or set of polyfills) to all relevant polyfills; I didn't want to repeat myself too much.
793118a
to
3e0facf
Compare
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.
Good stuff, but there is yet more to do!
3e0facf
to
5717707
Compare
Run `npm audit fix`. This was motivated by the following error: [error] Cannot find package 'prettier-plugin-toml' imported from /Users/wz/reilabs/starknet/hieratika/noop.js Signed-off-by: Wojciech Zmuda <[email protected]>
Signed-off-by: Wojciech Zmuda <[email protected]>
85051eb
to
ad25010
Compare
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.
LGTM! One last question; can we have the directory called compiler-rt
even if the project is compiler_rt
? It would be cleaner.
compiler_rt/README.md
Outdated
one of the polyfills. | ||
|
||
This project's name deliberately resembles [LLVM's `compiler-rt`](https://compiler-rt.llvm.org/), | ||
because it served the same purpose of providing implementations of the low-level operations written |
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.
because it served the same purpose of providing implementations of the low-level operations written | |
because it serves the same purpose of providing implementations of the low-level operations written |
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.
Fixed!
Add skeleton for the compiler_rt project, which is a scarb project containing Cairo code implementing Hieratika polyfills. The first added operations are: - `__llvm_and_i1_i1` - `__llvm_and_i8_i8` - `__llvm_and_i16_i16` - `__llvm_and_i32_i32` - `__llvm_and_i64_i64` - `__llvm_and_i128_i128` Signed-off-by: Wojciech Zmuda <[email protected]>
This workflow tests and formats Cairo code. It is triggered only on changes done to the compiler-rt directory. Signed-off-by: Wojciech Zmuda <[email protected]>
Add `__llvm_or_iN_iN` family of polyfills to ALU. Signed-off-by: Wojciech Zmuda <[email protected]>
Add `__llvm_xor_iN_iN` family of polyfills to ALU. Signed-off-by: Wojciech Zmuda <[email protected]>
ad25010
to
1e90256
Compare
and
, or
, xor
polyfillsand
, or
, xor
polyfills
Summary
Introduce compiler runtime module. Add relevant CI changes and update the PR template to reflect that we should also format the Cairo code.
Start implementing ALU. Add the top-level module and submodules for
and
,or
andxor
operations. Add relevant readmes.Implemented polyfills:
and
Implements bitwise
and
operation.API
__llvm_and_bool_bool(lhs: u128, rhs: u128) -> u128
__llvm_and_i8_i8(lhs: u128, rhs: u128) -> u128
__llvm_and_i16_i16(lhs: u128, rhs: u128) -> u128
__llvm_and_i32_i32(lhs: u128, rhs: u128) -> u128
__llvm_and_i64_i64(lhs: u128, rhs: u128) -> u128
__llvm_and_i128_i128(lhs: u128, rhs: u128) -> u128
or
Implements bitwise
or
operation.API
__llvm_or_bool_bool(lhs: u128, rhs: u128) -> u128
__llvm_or_i8_i8(lhs: u128, rhs: u128) -> u128
__llvm_or_i16_i16(lhs: u128, rhs: u128) -> u128
__llvm_or_i32_i32(lhs: u128, rhs: u128) -> u128
__llvm_or_i64_i64(lhs: u128, rhs: u128) -> u128
__llvm_or_i128_i128(lhs: u128, rhs: u128) -> u128
xor
Implements bitwise
xor
operation.API
__llvm_xor_bool_bool(lhs: u128, rhs: u128) -> u128
__llvm_xor_i8_i8(lhs: u128, rhs: u128) -> u128
__llvm_xor_i16_i16(lhs: u128, rhs: u128) -> u128
__llvm_xor_i32_i32(lhs: u128, rhs: u128) -> u128
__llvm_xor_i64_i64(lhs: u128, rhs: u128) -> u128
__llvm_xor_i128_i128(lhs: u128, rhs: u128) -> u128
Other PRs for issue #38 will follow.
Details
u128
instead of felts?Checklist
scarb fmt
.