Skip to content

Instantly share code, notes, and snippets.

View denismerigoux's full-sized avatar

Denis Merigoux denismerigoux

View GitHub Profile
// When sealing ebb1 before creating the v4 instruction
function ""() {
ebb0:
v0 = iconst.i32 1
v1 = iconst.i32 2
v2 = iadd v0, v1
brnz v1, ebb1
v3 = iadd v0, v2
ebb1:
@denismerigoux
denismerigoux / int_exprs.wast.0.cton
Created June 19, 2017 23:35
First translation from wasm to Cretonne IL
function %(i32, i32) -> i32 {
ebb0(v0: i32, v1: i32):
v2 = iconst.i32 1
v3 = iadd v2, v0
v4 = iconst.i32 1
v5 = iadd v4, v1
v6 = icmp slt v5, v3
v7 = sextend.i32 v6
return v7
}
@denismerigoux
denismerigoux / example
Created August 8, 2017 22:54
Example of ebb splitting that lead to differences in Ebb postorder
base_func {
ebb0:
brz ebb1
jump ebb2
ebb1:
brz ebb3
jump ebb3
ebb2:
jump ebb3
ebb3:
@denismerigoux
denismerigoux / Loop statistics
Last active August 9, 2017 21:57
Diverse Cretonne stats for translated WASM modules
Setup: the modules are translated into Cretonne IL using wasm2cretonne and the dummy runtime,
then a full-fledge context is created (cfg, dominator tree, loop analysis) and the LICM pass
is run.
===== cv-wasm.wasm ==========
Loops: 16,978
Ebbs partially in a loop: 13,229
Ebb entirely in loop: 64,909
Ebb total: 162,640
Splits during analysis: 8
@denismerigoux
denismerigoux / diff.diff
Created April 27, 2019 21:52
Diff in ed25519 with the changes I brought
diff --git a/code/experimental/ed25519/Hacl.Impl.Ed25519.SecretExpand.fst b/code/experimental/ed25519/Hacl.Impl.Ed25519.SecretExpand.fst
index e63032e..f0bc332 100644
--- a/code/experimental/ed25519/Hacl.Impl.Ed25519.SecretExpand.fst
+++ b/code/experimental/ed25519/Hacl.Impl.Ed25519.SecretExpand.fst
@@ -10,10 +10,11 @@ val secret_expand:
expanded:lbuffer uint8 64ul
-> secret:lbuffer uint8 32ul ->
Stack unit
- (requires fun h -> live h expanded /\ live h secret)
+ (requires fun h -> live h expanded /\ live h secret /\ disjoint expanded secret)
/*
# First structure and signatures definitions
declaration structure Person
data name content string
data income content amount
date number_of_children content integer
declaration scope TaxCreditA :
@denismerigoux
denismerigoux / impots_revenus_2019.py
Last active October 11, 2020 10:29
Python implementation of the French income tax computation, generated by https://gitlab.inria.fr/verifisc/mlang
# -*- coding: utf-8 -*-
# File generated by the Mlang compiler
import yaml
from math import floor
class Singleton(type):
_instances = {}
@denismerigoux
denismerigoux / allocations_familiales.js
Created February 1, 2021 19:17
Run the French family benefits computation in JS!
var Law = require("./french_law.js");
var Benchmark = require("benchmark");
var suite = new Benchmark.Suite();
suite
.add("AllocationFamiliales#benchmark", function () {
Law.computeAllocationsFamiliales({
currentDate: new Date("2020-05-20"),
children: [
{
{
"items": [
[
{
"ArrayDecl": [
[
"State",
null
],
[
<head>
<style>
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.catala-code .hll { background-color: #ffffcc }
.catala-code { background: #ffffff; }
.catala-code .c { color: #888888 } /* Comment */