You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6354 Reporter:@gasche Assigned to:@mshinwell Status: resolved (set by @mshinwell on 2016-12-07T13:00:21Z) Resolution: fixed Priority: normal Severity: feature Category: back end (clambda to assembly) Monitored by:@jmeber@yallop
Original bug ID: 6354
Reporter: @gasche
Assigned to: @mshinwell
Status: resolved (set by @mshinwell on 2016-12-07T13:00:21Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: back end (clambda to assembly)
Monitored by: @jmeber @yallop
Bug description
Patch and description at:
#17
Some optimisations on Cmm expressions involving tagging or constants. Here's a (best-case) example:
let int_of_digits a b c =
100 * (Char.code a - Char.code '0') +
10 * (Char.code b - Char.code '0') +
1 * (Char.code c - Char.code '0')
Trunk compiles this to:
(+
(+ (+ (* 200 (>>s (+ a/1020 -96) 1)) (* 20 (>>s (+ b/1021 -96) 1)))
(* 2 (>>s (+ c/1022 -96) 1)))
1)
This branch compiles this to:
(+ (+ (+ ( * a/1020 100) ( * b/1021 10)) c/1022) -10766)
Floating all of the constant operations, tags, etc. out of arithmetic means they can be merged into one addition.
The text was updated successfully, but these errors were encountered: