mirror of
https://github.com/anoma/juvix.git
synced 2024-12-04 06:23:13 +03:00
dcea0bbecb
* Closes #2571 * It is reasonable to finish this PR before tackling #2562, because the field element type is the primary data type in Cairo. * Depends on #2653 Checklist --------- - [x] Add field type and operations to intermediate representations (JuvixCore, JuvixTree, JuvixAsm, JuvixReg). - [x] Add CLI option to choose field size. - [x] Add frontend field builtins. - [x] Automatic conversion of integer literals to field elements. - [x] Juvix standard library support for fields. - [x] Check if field size matches when loading a stored module. - [x] Update the Cairo Assembly (CASM) interpreter to use the field type instead of integer type. - [x] Add field type to VampIR backend. - [x] Tests --------- Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
6 lines
75 B
Plaintext
6 lines
75 B
Plaintext
-- Fields
|
|
|
|
def f := \x \y fsub 0F (fadd x (fmul y (fdiv 1F x)));
|
|
|
|
f 10F 7F
|