Skip to content

Commit

Permalink
Merge pull request #147 from 0xPolygonMiden/bitwalker/update-toolchain
Browse files Browse the repository at this point in the history
chore: various housekeeping items
  • Loading branch information
bitwalker authored Mar 14, 2024
2 parents 539842d + a6aa09a commit 7ed9534
Show file tree
Hide file tree
Showing 138 changed files with 2,763 additions and 3,350 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Documentation available at editorconfig.org

root=true

[*]
ident_style = space
ident_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.rs]
max_line_length = 100

[*.yml]
ident_size = 2

[*.hir]
indent_size = 4

[*.toml]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '*.md'

env:
CARGO_MAKE_TOOLCHAIN: nightly-2023-12-20
CARGO_MAKE_TOOLCHAIN: nightly-2024-03-10

jobs:
compiler:
Expand Down
112 changes: 16 additions & 96 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions codegen/masm/src/codegen/emit/binary.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use miden_hir::{assert_matches, Felt, Immediate, Overflow, Type};

use crate::masm::Op;

use super::OpEmitter;
use crate::masm::Op;

impl<'a> OpEmitter<'a> {
pub fn eq(&mut self) {
Expand Down Expand Up @@ -450,7 +449,8 @@ impl<'a> OpEmitter<'a> {
//
// z = z2 * (2^63)^2 + z1 * 2^63 + z0
//
// We assume the stack holds two words representing x and y, with y on top of the stack
// We assume the stack holds two words representing x and y, with y on top of the
// stack
todo!()
}
Type::U64 => self.mul_u64(overflow),
Expand Down Expand Up @@ -806,11 +806,8 @@ impl<'a> OpEmitter<'a> {
let lhs = self.pop().expect("operand stack is empty");
let ty = lhs.ty();
assert_eq!(ty, imm.ty(), "expected exp operands to be the same type");
let exp: u8 = imm
.as_u64()
.unwrap()
.try_into()
.expect("invalid exponent: must be value < 64");
let exp: u8 =
imm.as_u64().unwrap().try_into().expect("invalid exponent: must be value < 64");
match &ty {
Type::U64 => todo!("exponentiation by squaring"),
Type::Felt => {
Expand Down Expand Up @@ -1047,10 +1044,7 @@ impl<'a> OpEmitter<'a> {
assert_eq!(ty, imm.ty(), "expected shl operands to be the same type");
match &ty {
Type::U64 => {
assert!(
imm.as_u64().unwrap() < 64,
"invalid shift value: must be < 64"
);
assert!(imm.as_u64().unwrap() < 64, "invalid shift value: must be < 64");
self.push_immediate(imm);
self.shl_u64();
}
Expand Down
3 changes: 1 addition & 2 deletions codegen/masm/src/codegen/emit/felt.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use miden_hir::{Felt, FieldElement};

use crate::masm::Op;

use super::OpEmitter;
use crate::masm::Op;

/// The value zero, as a field element
pub const ZERO: Felt = Felt::ZERO;
Expand Down
9 changes: 5 additions & 4 deletions codegen/masm/src/codegen/emit/int128.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::masm::Op;

use super::OpEmitter;
use crate::masm::Op;

#[allow(unused)]
impl<'a> OpEmitter<'a> {
Expand Down Expand Up @@ -153,7 +152,8 @@ impl<'a> OpEmitter<'a> {
}
}

/// Pop two i128 values, `b` and `a`, off the operand stack, and place the result of `a == b` on the stack.
/// Pop two i128 values, `b` and `a`, off the operand stack, and place the result of `a == b` on
/// the stack.
#[inline]
pub fn eq_i128(&mut self) {
self.emit_all(&[
Expand All @@ -166,7 +166,8 @@ impl<'a> OpEmitter<'a> {
]);
}

/// Pop two i128 values, `b` and `a`, off the operand stack, and place the result of `a == b` on the stack.
/// Pop two i128 values, `b` and `a`, off the operand stack, and place the result of `a == b` on
/// the stack.
#[inline]
pub fn neq_i128(&mut self) {
self.eq_i128();
Expand Down
Loading

0 comments on commit 7ed9534

Please sign in to comment.