From: Taylor R Campbell Date: Sat, 28 Aug 2010 20:48:47 +0000 (+0000) Subject: PRE-INCREMENT is only ever a memory reference, not address, in RTL. X-Git-Tag: 20101212-Gtk~84 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a47e3409d6ceed6f6fbbff975a35e1a340c22309;p=mit-scheme.git PRE-INCREMENT is only ever a memory reference, not address, in RTL. --- diff --git a/src/compiler/machines/svm/lapgen.scm b/src/compiler/machines/svm/lapgen.scm index 3bf029f75..583e589ba 100644 --- a/src/compiler/machines/svm/lapgen.scm +++ b/src/compiler/machines/svm/lapgen.scm @@ -294,18 +294,21 @@ USA. (values scale (ea:indexed (word-source base) offset scale* - (word-source index) scale))) - (rule-matcher (POST-INCREMENT (REGISTER (? base)) 1) - (values 'WORD - (ea:post-increment (word-source base) 'WORD))) - (rule-matcher (PRE-INCREMENT (REGISTER (? base)) -1) - (values 'WORD - (ea:pre-decrement (word-source base) 'WORD))))) + (word-source index) scale))))) (define memory-ref-rules - (make-memory-rules - (lambda (expression) - (offset-operator? expression)))) + (append + (make-memory-rules + (lambda (expression) + (offset-operator? expression))) + ;; There is no POST-INCREMENT-ADDRESS or PRE-INCREMENT-ADDRESS, so + ;; these rules have no analogue in MEMORY-ADDRESS-RULES. + (list (rule-matcher (POST-INCREMENT (REGISTER (? base)) 1) + (values 'WORD + (ea:post-increment (word-source base) 'WORD))) + (rule-matcher (PRE-INCREMENT (REGISTER (? base)) -1) + (values 'WORD + (ea:pre-decrement (word-source base) 'WORD)))))) (define memory-address-rules (make-memory-rules