Commit Graph

219 Commits

Author SHA1 Message Date
Benjamin Bouvier
2ee35b7ea1 Implement a Windows Baldrdash calling convention; 2019-08-16 14:25:15 +02:00
Benjamin Bouvier
abc3397017 [docs] Remove special handling of CDSL python modules; 2019-07-11 11:48:45 +02:00
Benjamin Bouvier
55f36ce81a [docs] Update docs to point to the docs.rs website; 2019-07-11 11:48:45 +02:00
Nicolas B. Pierron
bc75eee0cd Use BB-like EBB in docs/*.clif 2019-07-08 15:17:49 +02:00
lazypassion
747ad3c4c5 moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
moved crates in lib/ to src/, renamed crates, modified some files' text (#660)
2019-01-28 15:56:54 -08:00
Dan Gohman
b096d0606b Move ifcmp, icmp_imm, and ffcmp into the CPU flags doc section. 2019-01-02 11:46:15 -08:00
Bruce Mitchener
4f8753fa11 Fix typos. 2018-12-24 10:03:22 -08:00
Vincent Esche
c9666381f6 Fixed links in …/docs/compare-llvm.rst 2018-12-13 09:14:20 -05:00
Dan Gohman
a20c852148 Support heaps with no offset-guard pages.
Also, say "guard-offset pages" rather than just "guard pages" to describe the
region of a heap which is never accessible and which exists to support
optimizations for heap accesses with offsets.

And, introduce a `Uimm64` immediate type, and make all heap fields use
`Uimm64` instead of `Imm64` since they really are unsigned.
2018-12-11 15:40:24 -05:00
Dan Gohman
ef21fffa1c Clarify Cranelift's design with respect to mid-level optimization. (#619)
* Clarify Cranelift's design with respect to mid-level optimization.

Cranelift doesn't currently do much mid-level optimization, however it
is something we're thinking about, so remove text describing it as out of
scope, and add more text explaining the vision for how it would fit into
the overall system.
2018-11-28 08:54:40 -08:00
Dan Gohman
7c03ba43be Document which instructions are meant for producers to use.
This reorganizes some things in ir.rst to put all instructions not meant
for frontends to worry about in a dedicated section.

Fixes #282.
2018-11-28 06:53:04 -08:00
Dan Gohman
f0695a79d1 Add an autoinst line for fallthrough_return so that it's included in the docs. 2018-11-26 22:18:36 -08:00
Lachlan Sneff
586a8835e9 Add a readonly flag for loads (#562)
* Add readonly MemFlag

* Add readonly flag verifier check

* Make global loads readonly

* Fix gvn to consider readonly loads
2018-10-22 21:50:09 -07:00
Dan Gohman
1098eafb45 Remove the concept of non-dense jump tables.
WebAssembly doesn't have non-dense jump tables, and higher-level users
are better served by the facilities in lib/frontend/src/switch.rs for
working with non-dense switches.

This eliminates the concept of "absent" jump table entries, which
were represented as "0" in the text format.

Also, jump table contents are now enclosed in `[` and `]`, so that
we can unambiguously display empty jump tables. Previously, empty jump
tables were displayed as if they had a single absent entry.
2018-10-04 12:46:40 -07:00
Dan Gohman
da0243b0ab Update docs to reflect that saturating fp-to-int conversion is now implemented. 2018-09-05 16:35:41 -07:00
Dan Gohman
437a657899 Document tables. 2018-09-05 14:30:34 -07:00
Dan Gohman
8d41d2cc43 Add more documentation for special parameters. 2018-09-05 14:30:34 -07:00
Dan Gohman
608e74d8cb Document that b8 etc. are intended for use as SIMD elements. 2018-09-05 14:23:03 -07:00
Dan Gohman
ca9da7702e Reorganize the global value kinds. (#490)
* Reorganize the global value kinds.

This:
 - renames "deref" global values to "load" and gives it a offset that works
   like the "load" instructions' does
 - adds an explicit "iadd_imm" global value kind, which replaces the
   builtin iadd in "vmctx" and "deref" global values.
 - also renames "globalsym" to "symbol"
2018-09-04 21:09:04 -07:00
Sergey Pepyakin
9dbfbbde10 Stack Limit as an Argument Purpose (#372)
* Initial approach.

* Move stack_limit check before opening the frame

* Account for GPRs and frame pointer in stack check

* Check stack_limit example.

* Remove stack_limit attribute code.

Amends #359

* fmt
2018-08-04 06:16:21 -07:00
Dan Gohman
c5a554db83 Move the comment about Sphinx 1.4 out of the top-level README. 2018-08-02 15:25:09 -07:00
Dan Gohman
7f530cd751 Add a langref.rst page that redirects to the new ir.rst page. 2018-08-02 15:25:09 -07:00
Dan Gohman
c61f8a5baf Rename langref.rst to ir.rst.
This aligns with our use of the term "IR" rather than "IL" or
other terms involving "language".
2018-08-02 09:18:59 -07:00
Dan Gohman
c42bed7452 Update paths for the meta => meta-python rename. 2018-08-01 05:05:33 -07:00
Dan Gohman
1b42105faa Remove reserved_reg functionality. (#424)
* Remove reserved_reg functionality.

This wasn't implemented, and if we need it in the future, it seems like
it would be better to extend the concept of global values to cover this.

* Use GlobalValue::reserved_value() for sentinal values.
2018-07-31 07:57:37 -07:00
Dan Gohman
7f98f436f0 Add a link to the faerie github page. 2018-07-19 11:08:53 -07:00
Dan Gohman
20899d04a1 Fix "Title overline too short." warnings in more *.rst files. 2018-07-19 11:08:53 -07:00
Dan Gohman
753bb049f8 Fix "Title overline too short." warnings in *.rst files. 2018-07-13 17:23:23 -07:00
Dan Gohman
f4dbd38a4c Rename Cretonne to Cranelift! 2018-07-13 09:15:16 -07:00
Grégoire Geis
dd72b54eef Now diagnosing missing vmctx arguments (fixes #376) (#384)
* Now diagnosing missing vmctx arguments (fixes #376).

* Added filetest for fix of #376.

* Respect formatting rules in verifier/mod.rs.

* Added parameters for each use of vmctx in test files.

* Added comments on additions on vmctx verifications.
2018-07-03 20:59:32 -07:00
Dan Gohman
b0cce6daec Update the documentation for the new adjust_sp_* instruction names.
`adjust_sp_imm` has been split into `adjust_sp_up_imm` and
`adjust_sp_down_imm`, and `adjust_sp_down` has been added.
2018-07-02 15:43:15 -07:00
Dan Gohman
1074e2c755 Tidy up trailing whitespace. 2018-07-02 08:05:14 -07:00
Dan Gohman
8f3c49bc6c Update more references to "global variables".
This continues the transition to "global values", which aren't
implicitly dereferenced.
2018-06-28 12:52:51 -07:00
Lachlan Sneff
38ab82bcc0 Made changes for review 2018-06-15 18:33:30 -07:00
Lachlan Sneff
3686fc2fc7 Fix typos caused by find-and-replace 2018-06-15 18:33:30 -07:00
Lachlan Sneff
5c320a0d30 Change GlobalVar to GlobalValue 2018-06-15 18:33:30 -07:00
Sergey Pepyakin
f10682c246 Add documentation. 2018-06-09 13:18:12 -07:00
Sergey Pepyakin
e9111d1de2 Ditch stack_check instruction 2018-06-09 13:18:12 -07:00
Dan Gohman
970045c309 Set clobbers_flags to False for urm_noflags_abcd.
`urm_noflags` is a variant of `urm` which doesn't clobber the flags, and
`urm_noflags_abcd` is a further variant for ABCD registers, so it also
doesn't clobber the flags.
2018-06-05 11:30:35 -07:00
Dan Gohman
4e67e08efd Use the target-lexicon crate.
This switches from a custom list of architectures to use the
target-lexicon crate.

 - "set is_64bit=1; isa x86" is replaced with "target x86_64", and
   similar for other architectures, and the `is_64bit` flag is removed
   entirely.

 - The `is_compressed` flag is removed too; it's no longer being used to
   control REX prefixes on x86-64, ARM and Thumb are separate
   architectures in target-lexicon, and we can figure out how to
   select RISC-V compressed encodings when we're ready.
2018-05-30 06:13:35 -07:00
Tyler McMullen
f636d795c5 load_complex and store_complex instructions (#309)
* Start adding the load_complex and store_complex instructions.

N.b.:
The text format is not correct yet. Requires changes to the lexer and parser.
I'm not sure why I needed to change the RuntimeError to Exception yet. Will fix.

* Get first few encodings of load_complex working. Still needs var args type checking.

* Clean up ModRM helper functions in binemit.

* Implement 32-bit displace for load_complex

* Use encoding helpers instead of doing them all by hand

* Initial implementation of store_complex

* Parse value list for load/store_complex with + as delimiter. Looks nice.

* Add sign/zero-extension and size variants for load_complex.

* Add size variants of store_complex.

* Add asm helper lines to load/store complex bin tests.

* Example of length-checking the instruction ValueList for an encoding. Extremely questionable implementation.

* Fix Python linting issues

* First draft of postopt pass to fold adds and loads into load_complex. Just simple loads for now.

* Optimization pass now works with all types of loads.

* Add store+add -> store_complex to postopt pass

* Put complex address optimization behind ISA flag.

* Add load/store complex for f32 and f64

* Fixes changes to lexer that broke NaN parsing.

Abstracts away the repeated checks for whether or not the characters
following a + or - are going to be parsed as a number or not.

* Fix formatting issues

* Fix register restrictions for complex addresses.

* Encoding tests for x86-32.

* Add documentation for newly added instructions, recipes, and cdsl changes.

* Fix python formatting again

* Apply value-list length predicates to all LoadComplex and StoreComplex instructions.

* Add predicate types to new encoding helpers for mypy.

* Import FieldPredicate to satisfy mypy.

* Add and fix some "asm" strings in the encoding tests.

* Line-up 'bin' comments in x86/binary64 test

* Test parsing of offset-less store_complex instruction.

* 'sNaN' not 'sNan'

* Bounds check the lookup for polymorphic typevar operand.

* Fix encodings for istore16_complex.
2018-05-09 14:07:00 -05:00
Dan Gohman
9e48344f7f Update examples to reflect that Cretonne indices typically start at 0. 2018-04-27 06:02:59 -07:00
Dan Gohman
779114aaed Require at least Sphinx 1.4 since the format of index tuples changed. 2018-04-27 06:02:59 -07:00
John Rieth
948d5fdeec Document that i8 and i16 arithmetic support is incomplete (#299)
* Document that i8 and i16 arithmetic support is incomplete
2018-04-26 11:07:34 -07:00
Dan Gohman
c5b15c2396 Refactor calling convention settings. (#304)
Add a calling-convention setting to the `Flags` used as part of the
`TargetIsa`. This allows Cretonne code that generates calls to use the
correct convention, such as when emitting libcalls during legalization
or when the wasm frontend is decoding functions. This setting can be
overridden per-function.

This also adds "fast", "cold", and "fastcall" conventions, with "fast"
as the new default. Note that "fast" and "cold" are not intended to be
ABI-compatible across Cretonne versions.

This will also ensure Windows users will get an `unimplemented!` rather
than silent calling-convention mismatches, which reflects the fact that
Windows calling conventions are not yet implemented.

This also renames SpiderWASM, which isn't camel-case, to Baldrdash,
which is, and which is also a more relevant name.
2018-04-22 21:35:18 -07:00
Dan Gohman
80da1a1e9f Add crate descriptions for cretonne-{module, faerie, simplejit}. 2018-04-17 23:19:10 -07:00
Dan Gohman
24fa169e1f Rename the 'cretonne' crate to 'cretonne-codegen'.
This fixes the next part of #287.
2018-04-17 09:46:56 -07:00
Dan Gohman
7767186dd0 Rename 'cton_*' library names to match the 'cretonne_*' crate names.
This renames `cton_frontend` to `cretonne_frontend` and so on.

This fixes the first part of #287.
2018-04-17 07:55:59 -07:00
Dan Gohman
0e57f3d0ea Add a "colocated" flag to symbol references. (#298)
This adds a "colocated" flag to function and symbolic global variables which
indicates that they are defined along with the current function, so they can
use PC-relative addressing.

This also changes the function decl syntax; the name now always precedes the
signature, and the "function" keyword is no longer included.
2018-04-13 15:00:09 -07:00
Dan Gohman
1c760ab179 Rename intel to x86.
x86 is the more accurate name, as there are non-Intel x86 implementations.

Fixes #263.
2018-04-12 10:02:16 -07:00