commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
191c607bf9f9d842accdead8fe45decc4d1ea66b
Jakob Stoklund Olesen
2016-07-15T22:14:16
Add an entity_map module. This supports the pattern of creating structs wrapping a u32 and using them as indexes into a vector of entities. These entity references should implement the EntityRef trait. The EntityMap is a generic map from an EntityRef to some value type. It expects densely indexed entities and uses a ...
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs new file mode 100644 index 000000000..3e1f16a59 --- /dev/null +++ b/src/libcretonne/entity_map.rs @@ -0,0 +1,130 @@ +//! Densely numbered entity references as mapping keys. +//! +//! This module defines an `EntityRef` trait that should be implem...
2
132
0
4e74d85056bd7df4478cbc5d1e7d2f4a6bee3b57
Morgan Phillips
2016-07-14T19:22:08
Id CFG graphs by function name
diff --git a/cranelift/src/tools/print_cfg.rs b/cranelift/src/tools/print_cfg.rs index e55033832..fc85cbebe 100644 --- a/cranelift/src/tools/print_cfg.rs +++ b/cranelift/src/tools/print_cfg.rs @@ -35,7 +35,7 @@ impl<T: Write> CFGPrinter<T> { pub fn print(&mut self, func: &Function) -> Result<(), String> { ...
1
3
3
0cdcf29308b5eea353bacae09127e15a70a516d5
Morgan Phillips
2016-07-14T19:22:08
Id CFG graphs by function name
diff --git a/src/tools/print_cfg.rs b/src/tools/print_cfg.rs index e55033832..fc85cbebe 100644 --- a/src/tools/print_cfg.rs +++ b/src/tools/print_cfg.rs @@ -35,7 +35,7 @@ impl<T: Write> CFGPrinter<T> { pub fn print(&mut self, func: &Function) -> Result<(), String> { self.level = 0; - self.header(...
1
3
3
53ed7f5ea39a829d5b3fa8169d4e51d5ca81250f
Morgan Phillips
2016-07-13T21:31:05
Add a print-cfg subcommand. The command returns parses a .cton file, builds a CFG, and prints it to stdout in graphviz format.
diff --git a/cranelift/src/tools/main.rs b/cranelift/src/tools/main.rs index 1ea40c201..abad701af 100644 --- a/cranelift/src/tools/main.rs +++ b/cranelift/src/tools/main.rs @@ -11,12 +11,14 @@ use std::process; mod cat; +mod print_cfg; const USAGE: &'static str = " Cretonne code generator utility Usage: ...
2
174
0
4a6e53f90d032aa2fa93a36163927bf2c7cf196e
Morgan Phillips
2016-07-13T21:31:05
Add a print-cfg subcommand. The command returns parses a .cton file, builds a CFG, and prints it to stdout in graphviz format.
diff --git a/src/tools/main.rs b/src/tools/main.rs index 1ea40c201..abad701af 100644 --- a/src/tools/main.rs +++ b/src/tools/main.rs @@ -11,12 +11,14 @@ use std::process; mod cat; +mod print_cfg; const USAGE: &'static str = " Cretonne code generator utility Usage: cton-util cat <file>... + cton-util...
2
174
0
985606b12ce0542b060465a30097d81b043ed855
Morgan Phillips
2016-07-13T18:04:39
Replace Results with assertions in invariant cases. It seems reasonable that certain non-recoverable errors during the building of the CFG should crash.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 14f0467fc..4fc2f1b29 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -43,76 +43,42 @@ impl ControlFlowGraph { /// During initialization mappings will be generated for any existing ///...
1
12
95
295a4eb03fa93f3ba80654f5bdab7c1c5003478b
Morgan Phillips
2016-07-13T18:04:39
Replace Results with assertions in invariant cases. It seems reasonable that certain non-recoverable errors during the building of the CFG should crash.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 14f0467fc..4fc2f1b29 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -43,76 +43,42 @@ impl ControlFlowGraph { /// During initialization mappings will be generated for any existing /// blocks within the CFG's associated func...
1
12
95
24b421bd6834628eaa1f1701de5af461fb4937a1
Morgan Phillips
2016-07-12T21:46:24
Remove misleading test comments
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index cf69d0f18..14f0467fc 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -202,8 +202,6 @@ mod tests { let nullary_inst = nullary(&mut func); func.append_inst(ebb1_malformed, nulla...
1
0
4
79c7ae6233d2db63e5f0a85868251c3445bebe1c
Morgan Phillips
2016-07-12T21:46:24
Remove misleading test comments
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index cf69d0f18..14f0467fc 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -202,8 +202,6 @@ mod tests { let nullary_inst = nullary(&mut func); func.append_inst(ebb1_malformed, nullary_inst); - // This jump should...
1
0
4
522227c965fbecb6fbf05c590f90dbf92aafdb1c
Morgan Phillips
2016-07-12T21:42:49
Cargo-fmt fixes
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index a8640d345..cf69d0f18 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -2,7 +2,7 @@ //! Predecessors are denoted by tuples of EBB and branch/jump instructions. Each predecessor //! tuple corres...
1
11
9
180eae3bb5c85dbd1a3a12728692489fe91840dc
Morgan Phillips
2016-07-12T21:42:49
Cargo-fmt fixes
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index a8640d345..cf69d0f18 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -2,7 +2,7 @@ //! Predecessors are denoted by tuples of EBB and branch/jump instructions. Each predecessor //! tuple corresponds to the end of a basic block. //! ...
1
11
9
e4a9c5c13cc759014d2b561f20930b9f94608c94
Morgan Phillips
2016-07-12T21:37:37
Add a Control Flow Graph representation. The CFG must be instantiated against an existing function but may be modified after creation
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs new file mode 100644 index 000000000..a8640d345 --- /dev/null +++ b/cranelift/src/libcretonne/cfg.rs @@ -0,0 +1,270 @@ +//! A control flow graph represented as mappings of extended basic blocks to their predecessors. +//! Predecessors are ...
3
273
2
c6b1388fdcd8eaaa6a49273049bcff0b8aebfe2d
Morgan Phillips
2016-07-12T21:37:37
Add a Control Flow Graph representation. The CFG must be instantiated against an existing function but may be modified after creation
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs new file mode 100644 index 000000000..a8640d345 --- /dev/null +++ b/src/libcretonne/cfg.rs @@ -0,0 +1,270 @@ +//! A control flow graph represented as mappings of extended basic blocks to their predecessors. +//! Predecessors are denoted by tuples of EBB and b...
3
273
2
3c5c5a9e40b851751a81446f0c7c2ad46fad0c5c
Jakob Stoklund Olesen
2016-07-08T18:44:20
Don't print a space after quoted function names.
diff --git a/cranelift/src/libcretonne/write.rs b/cranelift/src/libcretonne/write.rs index 6a14497f8..22d87ba10 100644 --- a/cranelift/src/libcretonne/write.rs +++ b/cranelift/src/libcretonne/write.rs @@ -63,7 +63,7 @@ fn write_spec(w: &mut Write, func: &Function) -> Result { if !needs_quotes(&func.name) { ...
1
2
2
02861df78c167343f827411efa275941ebdaf4dc
Jakob Stoklund Olesen
2016-07-08T18:44:20
Don't print a space after quoted function names.
diff --git a/src/libcretonne/write.rs b/src/libcretonne/write.rs index 6a14497f8..22d87ba10 100644 --- a/src/libcretonne/write.rs +++ b/src/libcretonne/write.rs @@ -63,7 +63,7 @@ fn write_spec(w: &mut Write, func: &Function) -> Result { if !needs_quotes(&func.name) { write!(w, "function {}{}", func.name, ...
1
2
2
26ed45160ebe1b9f215fec6db1a701b3203fd259
Jakob Stoklund Olesen
2016-07-08T01:24:22
Fix rustc warning about unused Write trait.
diff --git a/cranelift/src/libcretonne/entities.rs b/cranelift/src/libcretonne/entities.rs index dcdff9e82..6294a8e8c 100644 --- a/cranelift/src/libcretonne/entities.rs +++ b/cranelift/src/libcretonne/entities.rs @@ -20,7 +20,7 @@ //! format. use std::default::Default; -use std::fmt::{self, Display, Formatter, Writ...
3
3
3
84abe288377684a255f6f68cdf51990cecccb471
Jakob Stoklund Olesen
2016-07-08T01:24:22
Fix rustc warning about unused Write trait.
diff --git a/src/libcretonne/entities.rs b/src/libcretonne/entities.rs index dcdff9e82..6294a8e8c 100644 --- a/src/libcretonne/entities.rs +++ b/src/libcretonne/entities.rs @@ -20,7 +20,7 @@ //! format. use std::default::Default; -use std::fmt::{self, Display, Formatter, Write}; +use std::fmt::{self, Display, Forma...
3
3
3
70507a3be04d1536b852a7651e8479f908a8c66c
Jakob Stoklund Olesen
2016-07-06T22:02:12
Add enums for condition codes. The icmp and fmp instructions use different kinds of condition codes because integers and floating point values behave differently. Add a CondCode trait implementing shared behavior.
diff --git a/cranelift/src/libcretonne/condcodes.rs b/cranelift/src/libcretonne/condcodes.rs new file mode 100644 index 000000000..692ecda96 --- /dev/null +++ b/cranelift/src/libcretonne/condcodes.rs @@ -0,0 +1,325 @@ +//! Condition codes for the Cretonne code generator. +//! +//! A condition code here is an enumerated...
2
326
0
90bb2fd27d793b6dd221a7340f372d2d3c0d2642
Jakob Stoklund Olesen
2016-07-06T22:02:12
Add enums for condition codes. The icmp and fmp instructions use different kinds of condition codes because integers and floating point values behave differently. Add a CondCode trait implementing shared behavior.
diff --git a/src/libcretonne/condcodes.rs b/src/libcretonne/condcodes.rs new file mode 100644 index 000000000..692ecda96 --- /dev/null +++ b/src/libcretonne/condcodes.rs @@ -0,0 +1,325 @@ +//! Condition codes for the Cretonne code generator. +//! +//! A condition code here is an enumerated type that determined how to c...
2
326
0
b4525a329bd125312c6cf6bc1f1ad9b7f03877fe
Jakob Stoklund Olesen
2016-07-05T19:49:34
Ignore comments in .cton files. The lexer still recognizes comments and generates tokens for them. They may be useful for test annotations at some point.
diff --git a/cranelift/src/libreader/parser.rs b/cranelift/src/libreader/parser.rs index 94e94cbdc..ec584cdca 100644 --- a/cranelift/src/libreader/parser.rs +++ b/cranelift/src/libreader/parser.rs @@ -135,17 +135,23 @@ impl<'a> Parser<'a> { // Get the current lookahead token, after making sure there is one. ...
1
9
3
74038d153c12468ffc33b016c07c03647e194435
Jakob Stoklund Olesen
2016-07-05T19:49:34
Ignore comments in .cton files. The lexer still recognizes comments and generates tokens for them. They may be useful for test annotations at some point.
diff --git a/src/libreader/parser.rs b/src/libreader/parser.rs index 94e94cbdc..ec584cdca 100644 --- a/src/libreader/parser.rs +++ b/src/libreader/parser.rs @@ -135,17 +135,23 @@ impl<'a> Parser<'a> { // Get the current lookahead token, after making sure there is one. fn token(&mut self) -> Option<Token<'a>...
1
9
3
56996adabd0df06ef650531f0ad088a03a525621
Jakob Stoklund Olesen
2016-07-05T19:33:19
Don't return any values from inst_results() for VOID instructions. Instructions that don't produce any result values are marked with first_type() = VOID. The inst_results() iterator should not return any values for such instructions.
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index a42b9de20..ff8d5d4de 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -1,6 +1,6 @@ //! Representation of Cretonne IL functions. -use types::{Type, FunctionName, Signature}; +use types::{T...
1
26
2
a985bc18bcd7dbfc242082782124b925cdaf7df0
Jakob Stoklund Olesen
2016-07-05T19:33:19
Don't return any values from inst_results() for VOID instructions. Instructions that don't produce any result values are marked with first_type() = VOID. The inst_results() iterator should not return any values for such instructions.
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index a42b9de20..ff8d5d4de 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -1,6 +1,6 @@ //! Representation of Cretonne IL functions. -use types::{Type, FunctionName, Signature}; +use types::{Type, FunctionName, Signature, VOID}; us...
1
26
2
320d5b369a4be9c6fc54684b9cd31500420d08ec
Jakob Stoklund Olesen
2016-07-01T21:26:24
rustfmt v0.5.0
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 9c44f524c..a42b9de20 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -148,8 +148,8 @@ impl Function { // Update the second_result pointer in `inst`. if head != NO_VALUE { ...
3
10
10
a981fc5605892a119b8f0e3d8cd56a4d851679be
Jakob Stoklund Olesen
2016-07-01T21:26:24
rustfmt v0.5.0
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 9c44f524c..a42b9de20 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -148,8 +148,8 @@ impl Function { // Update the second_result pointer in `inst`. if head != NO_VALUE { *self.inst_mut(inst) - ...
3
10
10
8e1de5c0f8bd850fdbb5076c12331b44509d46d4
Jakob Stoklund Olesen
2016-07-01T21:23:54
Give a better error message for unknown opcodes. Include the name of the unrecognized opcode along with the line number.
diff --git a/cranelift/src/libreader/parser.rs b/cranelift/src/libreader/parser.rs index 7d25fc096..1fe336824 100644 --- a/cranelift/src/libreader/parser.rs +++ b/cranelift/src/libreader/parser.rs @@ -539,7 +539,7 @@ impl<'a> Parser<'a> { let opcode = if let Some(Token::Identifier(text)) = self.token() { ...
1
1
1
cb4e9fbae02a933bd63ea3178c9a3461eec8f42c
Jakob Stoklund Olesen
2016-07-01T21:23:54
Give a better error message for unknown opcodes. Include the name of the unrecognized opcode along with the line number.
diff --git a/src/libreader/parser.rs b/src/libreader/parser.rs index 7d25fc096..1fe336824 100644 --- a/src/libreader/parser.rs +++ b/src/libreader/parser.rs @@ -539,7 +539,7 @@ impl<'a> Parser<'a> { let opcode = if let Some(Token::Identifier(text)) = self.token() { match text.parse() { ...
1
1
1
5ce1a4f0e876381b66685b0989268400c71aa184
Jakob Stoklund Olesen
2016-07-01T21:09:34
Parse and write IR in the 'cat' subcommand. The 'cton-util cat' command parses the given files and writes them out again to stdout. This has the effect of reformatting and stripping comments. Fix a writer bug that inverted the blank line before the first EBB.
diff --git a/cranelift/src/libcretonne/write.rs b/cranelift/src/libcretonne/write.rs index 0d615c545..38800bb48 100644 --- a/cranelift/src/libcretonne/write.rs +++ b/cranelift/src/libcretonne/write.rs @@ -16,7 +16,7 @@ pub fn write_function(w: &mut Write, func: &Function) -> Result { try!(writeln!(w, " {{")); ...
2
20
7
7519475f917ae21fcc117119a8d74378355f0201
Jakob Stoklund Olesen
2016-07-01T21:09:34
Parse and write IR in the 'cat' subcommand. The 'cton-util cat' command parses the given files and writes them out again to stdout. This has the effect of reformatting and stripping comments. Fix a writer bug that inverted the blank line before the first EBB.
diff --git a/src/libcretonne/write.rs b/src/libcretonne/write.rs index 0d615c545..38800bb48 100644 --- a/src/libcretonne/write.rs +++ b/src/libcretonne/write.rs @@ -16,7 +16,7 @@ pub fn write_function(w: &mut Write, func: &Function) -> Result { try!(writeln!(w, " {{")); let mut any = try!(write_preamble(w, fu...
2
20
7
61094f6909e8a8e863ecb800476be4fad8a6b1db
Jakob Stoklund Olesen
2016-06-03T21:56:25
Begin a basic command line interface. Add an external dependency to the docopt package and use it for a scaffold command line interface for the cton-util command. I am not too happy about taking external dependencies, and docopt pulls in 13 other packages. However, I really don't want to be writing command line parse...
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index 248c6bb37..8b92e5dbe 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -5,6 +5,8 @@ // // ====------------------------------------------------------------------------------------==== // +pub ...
5
194
1
96e88893be9bccf55393dde01152508ec69b969b
Jakob Stoklund Olesen
2016-06-03T21:56:25
Begin a basic command line interface. Add an external dependency to the docopt package and use it for a scaffold command line interface for the cton-util command. I am not too happy about taking external dependencies, and docopt pulls in 13 other packages. However, I really don't want to be writing command line parse...
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index 248c6bb37..8b92e5dbe 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -5,6 +5,8 @@ // // ====------------------------------------------------------------------------------------==== // +pub const VERSION: &'static str = env!("CARG...
5
194
1
49aa38b15f233ff727e729f5dd714adabb915fee
Jakob Stoklund Olesen
2016-06-02T15:40:47
Use an err! macro to build parser errors with format! arguments.
diff --git a/cranelift/src/libreader/parser.rs b/cranelift/src/libreader/parser.rs index 600632a51..7d25fc096 100644 --- a/cranelift/src/libreader/parser.rs +++ b/cranelift/src/libreader/parser.rs @@ -33,6 +33,23 @@ impl Display for Error { pub type Result<T> = result::Result<T, Error>; +// Create an `Err` variant...
1
62
61
8fac050bb5c9650f3f476f6a3c771e1a99784457
Jakob Stoklund Olesen
2016-06-02T15:40:47
Use an err! macro to build parser errors with format! arguments.
diff --git a/src/libreader/parser.rs b/src/libreader/parser.rs index 600632a51..7d25fc096 100644 --- a/src/libreader/parser.rs +++ b/src/libreader/parser.rs @@ -33,6 +33,23 @@ impl Display for Error { pub type Result<T> = result::Result<T, Error>; +// Create an `Err` variant of `Result<X>` from a location and `for...
1
62
61
441001c1ad6f5455d25e1ce9a55046c9945773aa
Jakob Stoklund Olesen
2016-06-02T03:45:58
Avoid allocating a temporary Vec in the parser. Wrangle the borrow checker into allowing us to iterate over function result values while mutating the ctx.values table.
diff --git a/cranelift/src/libreader/parser.rs b/cranelift/src/libreader/parser.rs index f9a66a523..600632a51 100644 --- a/cranelift/src/libreader/parser.rs +++ b/cranelift/src/libreader/parser.rs @@ -577,13 +577,11 @@ impl<'a> Parser<'a> { } // Now map the source result values to the just created i...
1
23
7
4eb327d0273946dda4ea79ab99c008942556fc4f
Jakob Stoklund Olesen
2016-06-02T03:45:58
Avoid allocating a temporary Vec in the parser. Wrangle the borrow checker into allowing us to iterate over function result values while mutating the ctx.values table.
diff --git a/src/libreader/parser.rs b/src/libreader/parser.rs index f9a66a523..600632a51 100644 --- a/src/libreader/parser.rs +++ b/src/libreader/parser.rs @@ -577,13 +577,11 @@ impl<'a> Parser<'a> { } // Now map the source result values to the just created instruction results. - // We need ...
1
23
7
9af18728fa1ff2469c9b5f6a701c404092e44915
Jakob Stoklund Olesen
2016-06-01T16:14:01
Clean up unused-import warnings.
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 6e7e6ea80..716887211 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -1,7 +1,7 @@ //! Representation of Cretonne IL functions. use types::{Type, FunctionName, Signature}; -use entities:...
1
1
2
fc8d2f92fd85edbd01861978fcf165bfbdd4bd00
Jakob Stoklund Olesen
2016-06-01T16:14:01
Clean up unused-import warnings.
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 6e7e6ea80..716887211 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -1,7 +1,7 @@ //! Representation of Cretonne IL functions. use types::{Type, FunctionName, Signature}; -use entities::*; +use entities::{Ebb, NO_EBB, Inst, N...
1
1
2
840b48397220887a47a922f609cf95ee0610487a
Jakob Stoklund Olesen
2016-05-27T19:03:09
Generate Value and Ebb references in lexer. During parsing, it is possible to see instruction operands that reference values or EBBs that have not been created yet. These references have to be resolved by a second pass following parsing once all EBBs and values have been created. To prepare for this second pass, star...
diff --git a/cranelift/src/libcretonne/entities.rs b/cranelift/src/libcretonne/entities.rs index 8513447ab..dcdff9e82 100644 --- a/cranelift/src/libcretonne/entities.rs +++ b/cranelift/src/libcretonne/entities.rs @@ -24,7 +24,7 @@ use std::fmt::{self, Display, Formatter, Write}; use std::u32; /// An opaque referenc...
3
107
75
f0fc9c9477450d39f6cc9741b77fbdf602222808
Jakob Stoklund Olesen
2016-05-27T19:03:09
Generate Value and Ebb references in lexer. During parsing, it is possible to see instruction operands that reference values or EBBs that have not been created yet. These references have to be resolved by a second pass following parsing once all EBBs and values have been created. To prepare for this second pass, star...
diff --git a/src/libcretonne/entities.rs b/src/libcretonne/entities.rs index 8513447ab..dcdff9e82 100644 --- a/src/libcretonne/entities.rs +++ b/src/libcretonne/entities.rs @@ -24,7 +24,7 @@ use std::fmt::{self, Display, Formatter, Write}; use std::u32; /// An opaque reference to an extended basic block in a functi...
3
107
75
25e78fdbff5899102306c816d503527377127574
Jakob Stoklund Olesen
2016-05-17T18:54:46
Parse basic blocks and instructions. Create map entries for ebbs and values as they are defined, but leave ebb and value operands unresolved on instructions as they are parsed. Instruction operands can refer to ebbs and values that may not have been defined yet. Don't infer or check result types yet.
diff --git a/cranelift/src/libcretonne/entities.rs b/cranelift/src/libcretonne/entities.rs index bdc76d804..d4e1cb849 100644 --- a/cranelift/src/libcretonne/entities.rs +++ b/cranelift/src/libcretonne/entities.rs @@ -105,6 +105,12 @@ pub enum ExpandedValue { } impl Value { + pub fn direct_from_number(n: u32) -> ...
4
371
16
1dcac579fb8e49e8bfe0495c86226d53b6c83acb
Jakob Stoklund Olesen
2016-05-17T18:54:46
Parse basic blocks and instructions. Create map entries for ebbs and values as they are defined, but leave ebb and value operands unresolved on instructions as they are parsed. Instruction operands can refer to ebbs and values that may not have been defined yet. Don't infer or check result types yet.
diff --git a/src/libcretonne/entities.rs b/src/libcretonne/entities.rs index bdc76d804..d4e1cb849 100644 --- a/src/libcretonne/entities.rs +++ b/src/libcretonne/entities.rs @@ -105,6 +105,12 @@ pub enum ExpandedValue { } impl Value { + pub fn direct_from_number(n: u32) -> Value { + let encoding = n * 2; +...
4
371
16
1be81c435200968cd71fa3bb91b88f53f00eadf1
Jakob Stoklund Olesen
2016-05-13T22:31:37
Implement write_instruction and write_ebb. Use the new iterators to write out the contents of a function.
diff --git a/cranelift/src/libcretonne/instructions.rs b/cranelift/src/libcretonne/instructions.rs index 325033284..39202b000 100644 --- a/cranelift/src/libcretonne/instructions.rs +++ b/cranelift/src/libcretonne/instructions.rs @@ -130,14 +130,14 @@ pub enum InstructionData { BinaryImm { opcode: Opcode, ...
2
108
10
9838a4040e7a04e0e8d4f8d61263ed8559e23eab
Jakob Stoklund Olesen
2016-05-13T22:31:37
Implement write_instruction and write_ebb. Use the new iterators to write out the contents of a function.
diff --git a/src/libcretonne/instructions.rs b/src/libcretonne/instructions.rs index 325033284..39202b000 100644 --- a/src/libcretonne/instructions.rs +++ b/src/libcretonne/instructions.rs @@ -130,14 +130,14 @@ pub enum InstructionData { BinaryImm { opcode: Opcode, ty: Type, - arg: Value, ...
2
108
10
dd5c1a1a3f2dde647d7acebc524f3d62d8c575dc
Jakob Stoklund Olesen
2016-05-14T00:45:57
Track instruction order in an EBB. Place instructions in a doubly linked list and point to the first and last instruction in an EBB. Provide an iterator for all the EBBs too. This doesn't reflect the layout order, but simply the order blocks were created.
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 5064a7939..a444dd0b3 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -1,17 +1,10 @@ - //! Representation of Cretonne IL functions. use types::{Type, FunctionName, Signature}; use entit...
1
312
171
5e0e9234642c80fd1b67ac244b890d1ebfd8b1d3
Jakob Stoklund Olesen
2016-05-14T00:45:57
Track instruction order in an EBB. Place instructions in a doubly linked list and point to the first and last instruction in an EBB. Provide an iterator for all the EBBs too. This doesn't reflect the layout order, but simply the order blocks were created.
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 5064a7939..a444dd0b3 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -1,17 +1,10 @@ - //! Representation of Cretonne IL functions. use types::{Type, FunctionName, Signature}; use entities::*; use instructions::*; use std::...
1
312
171
62ecbc744817d99d60a35787ad1d5a7644fc7e64
Jakob Stoklund Olesen
2016-05-13T20:32:20
Break entity references and instruction info out into new modules. Avoid gathering too much code in repr.rs. The `entities` module contains entity reference types, and the `instructions` module contains instruction opcodes and formats.
diff --git a/cranelift/src/libcretonne/entities.rs b/cranelift/src/libcretonne/entities.rs new file mode 100644 index 000000000..bdc76d804 --- /dev/null +++ b/cranelift/src/libcretonne/entities.rs @@ -0,0 +1,185 @@ +//! IL entity references. +//! +//! Instructions in Cretonne IL need to reference other entities in the ...
6
424
353
9c9be1cb58f3cf4a0d40dd01bc5ca37e8d81f4ad
Jakob Stoklund Olesen
2016-05-13T20:32:20
Break entity references and instruction info out into new modules. Avoid gathering too much code in repr.rs. The `entities` module contains entity reference types, and the `instructions` module contains instruction opcodes and formats.
diff --git a/src/libcretonne/entities.rs b/src/libcretonne/entities.rs new file mode 100644 index 000000000..bdc76d804 --- /dev/null +++ b/src/libcretonne/entities.rs @@ -0,0 +1,185 @@ +//! IL entity references. +//! +//! Instructions in Cretonne IL need to reference other entities in the function. This can be other +/...
6
424
353
6e17d229d008ff3ca221df11de58cae6b321e9e0
Jakob Stoklund Olesen
2016-05-02T23:04:21
Fix build.
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 807be698a..534fd1a7c 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -510,7 +510,7 @@ impl Function { /// /// The instruction is allowed to produce at most one result as indicated...
1
3
3
21b0eae044d43dea83dcb71e369a56a61138b661
Jakob Stoklund Olesen
2016-05-02T23:04:21
Fix build.
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 807be698a..534fd1a7c 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -510,7 +510,7 @@ impl Function { /// /// The instruction is allowed to produce at most one result as indicated by `data.ty`. Use /// `make_multi_...
1
3
3
24970593acbf6e06625242f61ce47ba2a11b3d27
Jakob Stoklund Olesen
2016-05-02T22:25:43
Implement value lists. Values that are defined together are represented as a singly linked list. These lists appear in: - Instructions with multiple result values. The first result value is special, and the following results form a linked list of Def extended_value table entries. - EBB arguments are represented as...
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index c219ecb4b..807be698a 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -3,6 +3,7 @@ use types::{Type, FunctionName, Signature}; use immediates::*; +use std::default::Default; use std::fm...
1
265
22
1d768ff734212f1159fbed57020da948f3ce12d7
Jakob Stoklund Olesen
2016-05-02T22:25:43
Implement value lists. Values that are defined together are represented as a singly linked list. These lists appear in: - Instructions with multiple result values. The first result value is special, and the following results form a linked list of Def extended_value table entries. - EBB arguments are represented as...
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index c219ecb4b..807be698a 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -3,6 +3,7 @@ use types::{Type, FunctionName, Signature}; use immediates::*; +use std::default::Default; use std::fmt::{self, Display, Formatter, Write}; u...
1
265
22
ab50f174120d5ce566f2abdcfaee87fab90fb89b
Jakob Stoklund Olesen
2016-04-30T00:23:34
Implement Index<Inst/StackSlot> for Function. When Function serves as a container for IL entities, use the Index trait to translate a reference class to a Data object. Works for: - StackSlot -> StackSlotData - Inst -> InstructionData
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 3917fa8f4..c219ecb4b 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -261,6 +261,15 @@ impl Display for Inst { } } +/// Allow immutable access to instructions via function indexing....
1
11
7
e026b36db416081ba08015cc64ad08cb951667b7
Jakob Stoklund Olesen
2016-04-30T00:23:34
Implement Index<Inst/StackSlot> for Function. When Function serves as a container for IL entities, use the Index trait to translate a reference class to a Data object. Works for: - StackSlot -> StackSlotData - Inst -> InstructionData
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 3917fa8f4..c219ecb4b 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -261,6 +261,15 @@ impl Display for Inst { } } +/// Allow immutable access to instructions via function indexing. +impl Index<Inst> for Function { + t...
1
11
7
b390b3113a7494060ec3ee7ec646c38c0d802fa6
Jakob Stoklund Olesen
2016-04-29T20:30:07
Add a write.rs module. Convert a function to text.
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index b67ca5df1..f47b04915 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -8,3 +8,4 @@ pub mod types; pub mod immediates; pub mod repr; +pub mod write; diff --git a/cranelift/src/libcretonne/repr...
3
119
0
ddea422cebdeb7c8c678da8e0f901f105afde920
Jakob Stoklund Olesen
2016-04-29T20:30:07
Add a write.rs module. Convert a function to text.
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index b67ca5df1..f47b04915 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -8,3 +8,4 @@ pub mod types; pub mod immediates; pub mod repr; +pub mod write; diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 702a37160..391...
3
119
0
ed6677d576a8ece71c785ff8f8a6f6b8323b6dc6
Jakob Stoklund Olesen
2016-04-28T21:35:52
Parse stack slot decls. Add a stack slot array to repr::Function, use repr::StackSlot to reference them. Parse stack slot declarations in the function preamble, add them to the function. Add a new `Context` struct which keeps track of mappings between identifiers used in the file and real references.
diff --git a/cranelift/src/libcretonne/immediates.rs b/cranelift/src/libcretonne/immediates.rs index 4fefdbb9d..072a8dcb9 100644 --- a/cranelift/src/libcretonne/immediates.rs +++ b/cranelift/src/libcretonne/immediates.rs @@ -74,6 +74,10 @@ impl Imm64 { pub fn from_bits(x: u64) -> Imm64 { Imm64(x as i64) ...
3
262
4
88931983a81f574016691171718ee42e8fadff69
Jakob Stoklund Olesen
2016-04-28T21:35:52
Parse stack slot decls. Add a stack slot array to repr::Function, use repr::StackSlot to reference them. Parse stack slot declarations in the function preamble, add them to the function. Add a new `Context` struct which keeps track of mappings between identifiers used in the file and real references.
diff --git a/src/libcretonne/immediates.rs b/src/libcretonne/immediates.rs index 4fefdbb9d..072a8dcb9 100644 --- a/src/libcretonne/immediates.rs +++ b/src/libcretonne/immediates.rs @@ -74,6 +74,10 @@ impl Imm64 { pub fn from_bits(x: u64) -> Imm64 { Imm64(x as i64) } + + pub fn to_bits(&self) -> u6...
3
262
4
d1c79e891670ceb428373a6458de6ee6da1e7764
Jakob Stoklund Olesen
2016-04-28T21:02:16
Add FunctionName, Signature to repr::Function. Simplify the uses in parser.rs to avoid too many module qualifiers.
diff --git a/cranelift/src/libcretonne/repr.rs b/cranelift/src/libcretonne/repr.rs index 1318a0936..7d11b62bd 100644 --- a/cranelift/src/libcretonne/repr.rs +++ b/cranelift/src/libcretonne/repr.rs @@ -1,7 +1,7 @@ //! Representation of Cretonne IL functions. -use types::Type; +use types::{Type, FunctionName, Signat...
3
54
23
021bde11918e1a25c601ac81284b35bf1f515bba
Jakob Stoklund Olesen
2016-04-28T21:02:16
Add FunctionName, Signature to repr::Function. Simplify the uses in parser.rs to avoid too many module qualifiers.
diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs index 1318a0936..7d11b62bd 100644 --- a/src/libcretonne/repr.rs +++ b/src/libcretonne/repr.rs @@ -1,7 +1,7 @@ //! Representation of Cretonne IL functions. -use types::Type; +use types::{Type, FunctionName, Signature}; use immediates::*; use std::fmt:...
3
54
23
90b3e16b560add11de74dce4f6ee42d2cb242823
Jakob Stoklund Olesen
2016-04-28T20:16:13
Tests for signature parser.
diff --git a/cranelift/src/libcretonne/types.rs b/cranelift/src/libcretonne/types.rs index 0aaa30841..d54b3c51d 100644 --- a/cranelift/src/libcretonne/types.rs +++ b/cranelift/src/libcretonne/types.rs @@ -224,6 +224,7 @@ pub struct ArgumentType { /// /// The function signature describes the types of arguments and ret...
2
32
1
41d95c0342fccbec4ed9a2761f6a62d8f6655a70
Jakob Stoklund Olesen
2016-04-28T20:16:13
Tests for signature parser.
diff --git a/src/libcretonne/types.rs b/src/libcretonne/types.rs index 0aaa30841..d54b3c51d 100644 --- a/src/libcretonne/types.rs +++ b/src/libcretonne/types.rs @@ -224,6 +224,7 @@ pub struct ArgumentType { /// /// The function signature describes the types of arguments and return values along with other /// details...
2
32
1
65dfef16e9525f0f161f02adc2d6b2af7ef927fb
Jakob Stoklund Olesen
2016-04-28T16:05:11
Begin parser unit tests, add public interface. The main entry point is Parser::parse().
diff --git a/cranelift/src/libctonfile/parser.rs b/cranelift/src/libctonfile/parser.rs index 060883b77..506952051 100644 --- a/cranelift/src/libctonfile/parser.rs +++ b/cranelift/src/libctonfile/parser.rs @@ -12,6 +12,7 @@ use cretonne::{types, repr}; pub use lexer::Location; /// A parse error is returned when the ...
1
56
8
07afc6e8da8efdd7e4af0692a506657030a74b0b
Jakob Stoklund Olesen
2016-04-28T16:05:11
Begin parser unit tests, add public interface. The main entry point is Parser::parse().
diff --git a/src/libctonfile/parser.rs b/src/libctonfile/parser.rs index 060883b77..506952051 100644 --- a/src/libctonfile/parser.rs +++ b/src/libctonfile/parser.rs @@ -12,6 +12,7 @@ use cretonne::{types, repr}; pub use lexer::Location; /// A parse error is returned when the parse failed. +#[derive(Debug)] pub str...
1
56
8
c69a21f79e6f6d1874cce8f3d2ccb6532f42d3e8
Jakob Stoklund Olesen
2016-04-27T20:38:50
Parser for .cton files. Recursive descent parser, although with this simple grammar there won't be any recursion.
diff --git a/cranelift/src/libctonfile/parser.rs b/cranelift/src/libctonfile/parser.rs index 44cf3a250..d75d21ee2 100644 --- a/cranelift/src/libctonfile/parser.rs +++ b/cranelift/src/libctonfile/parser.rs @@ -1,2 +1,202 @@ -use cretonne; +// ====------------------------------------------------------------------------...
1
201
1
f1a4b28d3f4c9f762e682fe67340df5cd34b24fc
Jakob Stoklund Olesen
2016-04-27T20:38:50
Parser for .cton files. Recursive descent parser, although with this simple grammar there won't be any recursion.
diff --git a/src/libctonfile/parser.rs b/src/libctonfile/parser.rs index 44cf3a250..d75d21ee2 100644 --- a/src/libctonfile/parser.rs +++ b/src/libctonfile/parser.rs @@ -1,2 +1,202 @@ -use cretonne; +// ====--------------------------------------------------------------------------------------====// +// +// Parser for ...
1
201
1
7ccef63077d4f20948b0a84b0751a90b8345f458
Jakob Stoklund Olesen
2016-04-27T22:38:54
Handle value type names in the lexer.
diff --git a/cranelift/src/libctonfile/lexer.rs b/cranelift/src/libctonfile/lexer.rs index 69d9c9858..855dd3405 100644 --- a/cranelift/src/libctonfile/lexer.rs +++ b/cranelift/src/libctonfile/lexer.rs @@ -6,6 +6,7 @@ // ====--------------------------------------------------------------------------------------====// ...
1
41
2
c712ddc7766b0ddc8d5c2de613b3ae39b0892f68
Jakob Stoklund Olesen
2016-04-27T22:38:54
Handle value type names in the lexer.
diff --git a/src/libctonfile/lexer.rs b/src/libctonfile/lexer.rs index 69d9c9858..855dd3405 100644 --- a/src/libctonfile/lexer.rs +++ b/src/libctonfile/lexer.rs @@ -6,6 +6,7 @@ // ====--------------------------------------------------------------------------------------====// use std::str::CharIndices; +use cretonn...
1
41
2
1228abca29a0e7c280cec9295ea1e17c491c5c0e
Jakob Stoklund Olesen
2016-04-11T23:41:00
Begin lexer implementation. Add a lexer module which implements the lexical analysis of .cton files.
diff --git a/cranelift/src/libctonfile/lexer.rs b/cranelift/src/libctonfile/lexer.rs new file mode 100644 index 000000000..69d9c9858 --- /dev/null +++ b/cranelift/src/libctonfile/lexer.rs @@ -0,0 +1,425 @@ + +// ====--------------------------------------------------------------------------------------====// +// +// Lex...
2
430
1
ab74770ffeda58cc20bc9855e2b1bfd2f92626b2
Jakob Stoklund Olesen
2016-04-11T23:41:00
Begin lexer implementation. Add a lexer module which implements the lexical analysis of .cton files.
diff --git a/src/libctonfile/lexer.rs b/src/libctonfile/lexer.rs new file mode 100644 index 000000000..69d9c9858 --- /dev/null +++ b/src/libctonfile/lexer.rs @@ -0,0 +1,425 @@ + +// ====--------------------------------------------------------------------------------------====// +// +// Lexical analysis for .cton files....
2
430
1
bbeafde243475a923eab544d7407c2f19a0736a4
Jakob Stoklund Olesen
2016-04-27T21:51:16
Type::by() returns an Optional<Type>. Don't use assertions to enforce the limits on SIMD lanes in a type, Type is too fundamental for that. Instead, the Vector-forming by() method returns an Optional<Type>, and None if the requested SIMD vector is not valid. Same for Type::half_vector().
diff --git a/cranelift/src/libcretonne/types.rs b/cranelift/src/libcretonne/types.rs index 6c8fb90d9..0aaa30841 100644 --- a/cranelift/src/libcretonne/types.rs +++ b/cranelift/src/libcretonne/types.rs @@ -147,21 +147,26 @@ impl Type { /// /// If this is already a SIMD vector type, this produces a SIMD vector ...
1
32
21
9e00ce5081b2cf77353c3869a71f195ea25dcaf9
Jakob Stoklund Olesen
2016-04-27T21:51:16
Type::by() returns an Optional<Type>. Don't use assertions to enforce the limits on SIMD lanes in a type, Type is too fundamental for that. Instead, the Vector-forming by() method returns an Optional<Type>, and None if the requested SIMD vector is not valid. Same for Type::half_vector().
diff --git a/src/libcretonne/types.rs b/src/libcretonne/types.rs index 6c8fb90d9..0aaa30841 100644 --- a/src/libcretonne/types.rs +++ b/src/libcretonne/types.rs @@ -147,21 +147,26 @@ impl Type { /// /// If this is already a SIMD vector type, this produces a SIMD vector type with `n * /// self.lane_count(...
1
32
21
c0f77f35c73a8c2a475eb1b931363e2970a626ff
Jakob Stoklund Olesen
2016-04-27T21:25:54
Add function signatures. Describe function argument and return value types along with flags for passing values in an ABI-compliant way.
diff --git a/cranelift/src/libcretonne/types.rs b/cranelift/src/libcretonne/types.rs index 88a2b6cad..6c8fb90d9 100644 --- a/cranelift/src/libcretonne/types.rs +++ b/cranelift/src/libcretonne/types.rs @@ -3,6 +3,12 @@ use std::fmt::{self, Display, Formatter, Write}; +// ====----------------------------------------...
1
131
0
04d3b10564de43741fc6af1e0cfdfd47cf0cd961
Jakob Stoklund Olesen
2016-04-27T21:25:54
Add function signatures. Describe function argument and return value types along with flags for passing values in an ABI-compliant way.
diff --git a/src/libcretonne/types.rs b/src/libcretonne/types.rs index 88a2b6cad..6c8fb90d9 100644 --- a/src/libcretonne/types.rs +++ b/src/libcretonne/types.rs @@ -3,6 +3,12 @@ use std::fmt::{self, Display, Formatter, Write}; +// ====--------------------------------------------------------------------------------...
1
131
0
58f70ef12d77395d660e18f9d3b72a4a6ac5c918
Jakob Stoklund Olesen
2016-04-12T21:53:57
Implement FromStr for Imm64, Ieee32, Ieee64. These are bitwise exact conversions from string to immediates, implementing the inverse of the Display trait. Only accept hexadecimal floating point numbers to avoid issues with rounding when converting decimal numbers to binary.
diff --git a/cranelift/src/libcretonne/immediates.rs b/cranelift/src/libcretonne/immediates.rs index 79326d9a0..4fefdbb9d 100644 --- a/cranelift/src/libcretonne/immediates.rs +++ b/cranelift/src/libcretonne/immediates.rs @@ -70,6 +70,12 @@ impl FromStr for Opcode { #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub str...
1
480
13
6a1f74125fb641f3007d2fad96a241599efd94f9
Jakob Stoklund Olesen
2016-04-12T21:53:57
Implement FromStr for Imm64, Ieee32, Ieee64. These are bitwise exact conversions from string to immediates, implementing the inverse of the Display trait. Only accept hexadecimal floating point numbers to avoid issues with rounding when converting decimal numbers to binary.
diff --git a/src/libcretonne/immediates.rs b/src/libcretonne/immediates.rs index 79326d9a0..4fefdbb9d 100644 --- a/src/libcretonne/immediates.rs +++ b/src/libcretonne/immediates.rs @@ -70,6 +70,12 @@ impl FromStr for Opcode { #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub struct Imm64(i64); +impl Imm64 { + pub...
1
480
13
661ac9e7ad9ae244700a8671b9371218aedf04cb
Jakob Stoklund Olesen
2016-04-08T18:06:33
Implement std::str::FromStr for matching opcodes. Replace the home-grown from_str function.
diff --git a/cranelift/src/libcretonne/immediates.rs b/cranelift/src/libcretonne/immediates.rs index 911197c34..79326d9a0 100644 --- a/cranelift/src/libcretonne/immediates.rs +++ b/cranelift/src/libcretonne/immediates.rs @@ -7,6 +7,7 @@ use std::fmt::{self, Display, Formatter}; use std::mem; +use std::str::FromStr;...
1
12
9
49ae98a1e9f4b5f9d6cacecc092eb92262c0722a
Jakob Stoklund Olesen
2016-04-08T18:06:33
Implement std::str::FromStr for matching opcodes. Replace the home-grown from_str function.
diff --git a/src/libcretonne/immediates.rs b/src/libcretonne/immediates.rs index 911197c34..79326d9a0 100644 --- a/src/libcretonne/immediates.rs +++ b/src/libcretonne/immediates.rs @@ -7,6 +7,7 @@ use std::fmt::{self, Display, Formatter}; use std::mem; +use std::str::FromStr; // Include code generated by `meta/g...
1
12
9
b0c0dd1b9f5f308c83c903b194adbb662d40011b
Jakob Stoklund Olesen
2016-04-07T18:09:36
Add repr.rs module containing the representation of functions. A function owns instructions and extended basic blocks. References to these entities are implemented as opaque structs indexing into the functions internal tables. This avoids fighting Rust's ownership checking and it also makes references 4 bytes on all p...
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index 9c837eb0f..b67ca5df1 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -7,3 +7,4 @@ pub mod types; pub mod immediates; +pub mod repr; diff --git a/cranelift/src/libcretonne/repr.rs b/cranelif...
2
342
0
3a570e8b2168364c1c1e97c485aff4fc89dc6aaa
Jakob Stoklund Olesen
2016-04-07T18:09:36
Add repr.rs module containing the representation of functions. A function owns instructions and extended basic blocks. References to these entities are implemented as opaque structs indexing into the functions internal tables. This avoids fighting Rust's ownership checking and it also makes references 4 bytes on all p...
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index 9c837eb0f..b67ca5df1 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -7,3 +7,4 @@ pub mod types; pub mod immediates; +pub mod repr; diff --git a/src/libcretonne/repr.rs b/src/libcretonne/repr.rs new file mode 100644 index 0000000...
2
342
0
de12bc0f1aff7212f4860a239e53008d2d4f443a
Jakob Stoklund Olesen
2016-04-01T16:54:49
Implement Imm64 in an 'immediates.rs' module. Format larger immediates as hexadecimal with a multiple of 4 digits and '_' group separators.
diff --git a/cranelift/src/libcretonne/immediates.rs b/cranelift/src/libcretonne/immediates.rs new file mode 100644 index 000000000..a60291b16 --- /dev/null +++ b/cranelift/src/libcretonne/immediates.rs @@ -0,0 +1,53 @@ + +//! Immediate operands for Cretonne instructions +//! +//! This module defines the types of immed...
2
54
0
38d0f626a7d93cb00238314fcd348972fde41fb8
Jakob Stoklund Olesen
2016-04-01T16:54:49
Implement Imm64 in an 'immediates.rs' module. Format larger immediates as hexadecimal with a multiple of 4 digits and '_' group separators.
diff --git a/src/libcretonne/immediates.rs b/src/libcretonne/immediates.rs new file mode 100644 index 000000000..a60291b16 --- /dev/null +++ b/src/libcretonne/immediates.rs @@ -0,0 +1,53 @@ + +//! Immediate operands for Cretonne instructions +//! +//! This module defines the types of immediate operands that can appear ...
2
54
0
d9ba9480c9cef1822b24ad4dc5982a08934419a2
Jakob Stoklund Olesen
2016-03-12T00:06:14
Make the types module public, add documentation comments.
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index e2adcaec6..380209e7f 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -1,8 +1,8 @@ -//====--------------------------------------------------------------------------------------====// +// ====-...
2
25
4
4ba29e594fc21ba19a828e819ca5dee1c1391b3e
Jakob Stoklund Olesen
2016-03-12T00:06:14
Make the types module public, add documentation comments.
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index e2adcaec6..380209e7f 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -1,8 +1,8 @@ -//====--------------------------------------------------------------------------------------====// +// ====-----------------------------------------...
2
25
4
6395e671f777a388af6f23460b0f88cac369ceeb
Alex Huszagh
2025-10-09T04:31:15
Remove `doc_auto_cfg`. Closes #230
diff --git a/lexical-core/src/lib.rs b/lexical-core/src/lib.rs index 80b218b..1e36c23 100644 --- a/lexical-core/src/lib.rs +++ b/lexical-core/src/lib.rs @@ -685,7 +685,6 @@ #![cfg_attr(feature = "lint", warn(unsafe_op_in_unsafe_fn))] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(docsrs, feature(doc_cfg))] -...
7
0
7
bfd938d75b0550cebce9ec7fa872bfb587723e8a
Alex Huszagh
2025-09-21T12:23:12
Add unittests for issue 224.
diff --git a/lexical-write-float/tests/issue_224.rs b/lexical-write-float/tests/issue_224.rs new file mode 100644 index 0000000..bdf78ef --- /dev/null +++ b/lexical-write-float/tests/issue_224.rs @@ -0,0 +1,14 @@ +#![cfg(feature = "radix")] + +use lexical_util::constants::BUFFER_SIZE; +use lexical_write_float::{options...
2
26
0
ddfc0f6bfcc0085ff982f567f41f24a5541a14ea
Alex Huszagh
2025-09-21T03:34:01
Increment version for 1.0.6 release.
diff --git a/lexical-core/Cargo.toml b/lexical-core/Cargo.toml index bf8e247..dab0338 100644 --- a/lexical-core/Cargo.toml +++ b/lexical-core/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT/Apache-2.0" name = "lexical-core" readme = "README.md" repository = "https://github.com/Alexhuszagh/rust-lexical" -version = "1.0.5" ...
7
18
28
ef89a675571b2423c49120951076d5724e33fa63
Alex Huszagh
2025-09-21T01:04:21
Patch doc link references.
diff --git a/lexical-core/src/lib.rs b/lexical-core/src/lib.rs index 6a8071d..80b218b 100644 --- a/lexical-core/src/lib.rs +++ b/lexical-core/src/lib.rs @@ -629,6 +629,11 @@ //! [`lexical-write-float`], and [`lexical-write-integer`]) could cause those //! safety invariants to be broken. //! +//! [`lexical-parse-floa...
1
5
0
c3dfaa26908cefe01b9cbadfedabe23056c62d71
Alex Huszagh
2025-09-21T00:54:49
Patch version dependencies for our test suite.
diff --git a/extras/Cargo.toml b/extras/Cargo.toml index 0ff0778..245c9ae 100644 --- a/extras/Cargo.toml +++ b/extras/Cargo.toml @@ -19,3 +19,7 @@ opt-level = 3 debug = false debug-assertions = false lto = true + +# FIXME: Support 0.61.0+ when we only support Rustc 1.71.0+. +[patch.crates-io] +windows-sys = { git = ...
6
14
5
04df3de298b93449db5efdd764e75427505c19d5
Alex Huszagh
2025-01-12T04:19:38
Fix our doctest (it was always valid).
diff --git a/lexical-util/src/format_builder.rs b/lexical-util/src/format_builder.rs index 121af29..b4577e1 100644 --- a/lexical-util/src/format_builder.rs +++ b/lexical-util/src/format_builder.rs @@ -2121,7 +2121,7 @@ impl NumberFormatBuilder { /// | Input | Valid? | /// |:-:|:-:| /// | `1e3` | ❌ | - ...
1
2
2
6a48439e2b91031a76e763391b5afd5fe4b30b7a
Alex Huszagh
2025-01-11T15:28:54
Add in `from_radix` for API consistency.
diff --git a/lexical-parse-integer/src/options.rs b/lexical-parse-integer/src/options.rs index 94fedf7..e34c0c8 100644 --- a/lexical-parse-integer/src/options.rs +++ b/lexical-parse-integer/src/options.rs @@ -190,6 +190,13 @@ impl Options { Self::builder().build_unchecked() } + /// Create the default...
2
14
0
6e3bf04174983c9502cbea795103c9008d3c3053
Alex Huszagh
2025-01-11T17:22:29
Add minor performance enhancements via better inlining.
diff --git a/lexical-parse-float/src/binary.rs b/lexical-parse-float/src/binary.rs index a1baee6..1e787de 100644 --- a/lexical-parse-float/src/binary.rs +++ b/lexical-parse-float/src/binary.rs @@ -149,7 +149,6 @@ pub fn parse_u64_digits<'a, Iter, const FORMAT: u128>( /// /// This avoids the need for arbitrary-precisi...
2
3
3
cc8624594c62dc0a9c855fe760c6e4b8df886c88
Alex Huszagh
2025-01-11T16:47:19
Add fast-float2 back to our benchmarks.
diff --git a/extras/benchmark/input.rs b/extras/benchmark/input.rs index abf6f33..0148bbe 100644 --- a/extras/benchmark/input.rs +++ b/extras/benchmark/input.rs @@ -491,6 +491,18 @@ macro_rules! from_lexical_generator { }}; } +macro_rules! from_fast_float2_generator { + ($group:ident, $name:expr, $iter:expr,...
2
14
0
3707570c3189a733ece5741fbb1a1cfdd17dad69
Alex Huszagh
2024-12-09T20:38:40
Fixes the comparison chain for NaN and equality in half floats. This fixes the infinite recursion in `f16` and `bf16` when checking float equality or `is_nan`. This is patched by fixing the `is_nan` comparison. Closes #196
diff --git a/lexical-util/Cargo.toml b/lexical-util/Cargo.toml index 8d8e29a..3a47b68 100644 --- a/lexical-util/Cargo.toml +++ b/lexical-util/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT/Apache-2.0" name = "lexical-util" readme = "README.md" repository = "https://github.com/Alexhuszagh/rust-lexical" -version = "1.0.5" ...
3
7
3
49d4c26e34bcadd46eae2d1bdaf353ebee7c0d9f
Alex Huszagh
2024-12-09T12:51:32
Remove unused `Float` imports in tests.
diff --git a/lexical-write-float/tests/api_tests.rs b/lexical-write-float/tests/api_tests.rs index 1e73e10..81309f3 100644 --- a/lexical-write-float/tests/api_tests.rs +++ b/lexical-write-float/tests/api_tests.rs @@ -142,8 +142,6 @@ proptest! { #[test] #[cfg(feature = "f16")] fn f16_proptest(bits in u16:...
1
0
4
65334976f3329aaca139d5286f48cf70dd077fad
Andrew Lamb
2024-12-09T11:50:56
Add tests for formatting numberic limits
diff --git a/lexical-core/tests/api_tests.rs b/lexical-core/tests/api_tests.rs index 1e676f9..0815b1a 100644 --- a/lexical-core/tests/api_tests.rs +++ b/lexical-core/tests/api_tests.rs @@ -53,3 +53,41 @@ fn string_to_float_test() { Ok((12345.0f32, 7)) ); } + +/// Test that converting the specified value ...
1
38
0
9b26c69ff4b4eee5d1ac6ce405e27d92597ee89c
Alex Huszagh
2024-12-08T11:03:21
Add patch for dragonbox float with f16's trait.
diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs index ee5a239..7f3b1c0 100644 --- a/lexical-write-float/src/algorithm.rs +++ b/lexical-write-float/src/algorithm.rs @@ -1501,7 +1501,7 @@ macro_rules! dragonbox_unimpl { } #[inline(always)] - ...
1
6
1
dd77f93950a47d0ef33c83aa1eb94e117618b799
Alex Huszagh
2024-12-07T09:19:33
Add additional unittest to validate our bounds.
diff --git a/lexical-write-integer/tests/api_tests.rs b/lexical-write-integer/tests/api_tests.rs index 9df442f..635fe71 100644 --- a/lexical-write-integer/tests/api_tests.rs +++ b/lexical-write-integer/tests/api_tests.rs @@ -1300,6 +1300,11 @@ proptest! { prop_assert_eq!(i, roundtrip(i)); } + #[test]...
1
5
0
6b518e5657f4517b8534f5e6bc9619be9fa9fd14
Alex Huszagh
2024-12-07T08:27:51
Add in optimizations for 64-bit integers. This uses the partial jeaiii algorithm, only for sizes <= u32::MAX, otherwise it uses a mix of that along with a fixed-width Alexandrescu unfolding algorithm. The latter requires more multiplications but has less branches, the major performance issue.
diff --git a/lexical-write-integer/src/decimal.rs b/lexical-write-integer/src/decimal.rs index 6399aac..fd67b3e 100644 --- a/lexical-write-integer/src/decimal.rs +++ b/lexical-write-integer/src/decimal.rs @@ -16,7 +16,7 @@ use lexical_util::format::{RADIX, RADIX_SHIFT, STANDARD}; use lexical_util::num::UnsignedIntege...
3
100
33
9090ffaf068b032f58c2a57bfff4886940836c9a
Alex Huszagh
2024-12-07T08:26:31
Simplify to directly use decimal trait.
diff --git a/lexical-write-float/src/algorithm.rs b/lexical-write-float/src/algorithm.rs index 6372040..ee5a239 100644 --- a/lexical-write-float/src/algorithm.rs +++ b/lexical-write-float/src/algorithm.rs @@ -30,10 +30,9 @@ use lexical_util::bf16::bf16; #[cfg(feature = "f16")] use lexical_util::f16::f16; -use lexica...
1
6
5
8db6b84a441ba6fe531ace204a52146e4c6ffccc
Alex Huszagh
2024-12-07T03:54:43
Optimize u8, u16, and u32 with the jeaiii algorithm. This uses a modified implementation from @jeaiii and @jk-jeon to reduce the amount of branching and further optimize for large and small numbers of digits, by doing comparisons of larger, then smaller values for deeper levels of the tree.
diff --git a/lexical-write-integer/src/algorithm.rs b/lexical-write-integer/src/algorithm.rs index 0b5874c..cf0eb66 100644 --- a/lexical-write-integer/src/algorithm.rs +++ b/lexical-write-integer/src/algorithm.rs @@ -3,6 +3,10 @@ //! These routines are highly optimized: they unroll 4 loops at a time, //! using pre-co...
4
274
1