File tree Expand file tree Collapse file tree 4 files changed +19
-18
lines changed Expand file tree Collapse file tree 4 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -26,3 +26,4 @@ herbie-compiled/
2626
2727# Python
2828.env /
29+ .worktrees
Original file line number Diff line number Diff line change 11
22# Testing
33
4- - Run ` make fmt ` to format the code before presentingcode . This is
4+ - Run ` make fmt ` to format the code before finishing a task . This is
55 mandatory and PRs that don't follow the coding style are rejected.
6+ - Always check your ` git diff ` before finishing a task. There's often
7+ leftover or dead code, and you should delete it.
68- Run ` racket src/main.rkt report bench/tutorial.fpcore tmp ` to test
79 that your changes work; this should take about 5-10 seconds and all
810 of the tests should pass, getting basically perfect accuracy.
Original file line number Diff line number Diff line change 529529;; Synthesizes lowering rules for a given platform.
530530(define (platform-lowering-rules [pform (*active-platform*)])
531531 (define impls (platform-impls pform))
532- (append* (for/list ([impl (in-list impls)])
533- (hash-ref! (*lowering-rules*)
534- (cons impl pform)
535- (lambda ()
536- (define name (sym-append 'lower- impl))
537- (define-values (vars spec-expr impl-expr) (impl->rule-parts impl))
538- (list (rule name spec-expr impl-expr '(lowering))
539- (rule (sym-append 'lower-unsound- impl)
540- (add-unsound spec-expr)
541- impl-expr
542- '(lowering))
543- (rule (sym-append 'lower-sound- impl)
544- (add-sound-with-wildcard spec-expr)
545- impl-expr
546- '(lowering))))))))
532+ (append*
533+ (for/list ([impl (in-list impls)])
534+ (hash-ref!
535+ (*lowering-rules*)
536+ (cons impl pform)
537+ (lambda ()
538+ (define name (sym-append 'lower- impl))
539+ (define-values (vars spec-expr impl-expr) (impl->rule-parts impl))
540+ (list (rule name spec-expr impl-expr '(lowering))
541+ (rule (sym-append 'lower-unsound- impl) (add-unsound spec-expr) impl-expr '(lowering))
542+ (rule (sym-append 'lower-sound- impl)
543+ (add-sound-with-wildcard spec-expr)
544+ impl-expr
545+ '(lowering))))))))
547546
548547;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
549548;; Racket egraph
Original file line number Diff line number Diff line change 4040(define (add-sound-with-wildcard expr)
4141 (match expr
4242 [(list op args ... )
43- (cons (sym-append "sound- " op)
44- (append (map add-sound-with-wildcard args) (list '_ )))]
43+ (cons (sym-append "sound- " op) (append (map add-sound-with-wildcard args) (list '_ )))]
4544 [_ expr]))
4645
4746(define-syntax define-rule
You can’t perform that action at this time.
0 commit comments