From 39d2986e52f9706fc996a8f0359b294dca7addd6 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 12 Nov 2009 16:05:29 +0000 Subject: [PATCH] * rtl-c.scm (s-parallel): Use map-in-order instead of map. * rtl-xform.scm (/rtx-trim-for-doc): Handle set-quiet, nop, eq, ne, lt, le, gt, ge, ltu, leu, gtu, geu, index-of. --- ChangeLog | 6 ++++++ rtl-c.scm | 32 ++++++++++++++++++-------------- rtl-xform.scm | 16 ++++++++++++++-- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0554cc..09dd954 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-12 Doug Evans + + * rtl-c.scm (s-parallel): Use map-in-order instead of map. + * rtl-xform.scm (/rtx-trim-for-doc): Handle set-quiet, nop, + eq, ne, lt, le, gt, ge, ltu, leu, gtu, geu, index-of. + 2009-11-11 Doug Evans * html.scm (gen-insn-docs): Add logging message. diff --git a/rtl-c.scm b/rtl-c.scm index 878f27a..a10d09f 100644 --- a/rtl-c.scm +++ b/rtl-c.scm @@ -1198,13 +1198,15 @@ (set! /par-temp-list nil) (let* ((set-dest-exprs - (map (lambda (expr) - (rtx-traverse (estate-context estate) - (estate-owner estate) - expr - /par-replace-set-dest-expr-fn - #f)) - exprs)) + ;; Use map-in-order because we need temp creation and usage to + ;; follow the same order. + (map-in-order (lambda (expr) + (rtx-traverse (estate-context estate) + (estate-owner estate) + expr + /par-replace-set-dest-expr-fn + #f)) + exprs)) (set-dests (string-map (lambda (expr) (rtl-c-with-estate estate VOID expr)) set-dest-exprs)) @@ -1214,13 +1216,15 @@ (set! /par-temp-list temps) (let* ((set-src-exprs - (map (lambda (expr) - (rtx-traverse (estate-context estate) - (estate-owner estate) - expr - /par-replace-set-src-expr-fn - #f)) - exprs)) + ;; Use map-in-order because we need temp creation and usage to + ;; follow the same order. + (map-in-order (lambda (expr) + (rtx-traverse (estate-context estate) + (estate-owner estate) + expr + /par-replace-set-src-expr-fn + #f)) + exprs)) (set-srcs (string-map (lambda (expr) (rtl-c-with-estate estate VOID expr)) set-src-exprs))) diff --git a/rtl-xform.scm b/rtl-xform.scm index 1ff896e..4790eda 100644 --- a/rtl-xform.scm +++ b/rtl-xform.scm @@ -394,9 +394,11 @@ ) ; Subroutine of /rtx-trim-for-doc to simplify it. -; Trim all the arguments of rtx NAME. +; Trim the arguments of rtx NAME. +; ARGS has already had options,mode removed. (define (/rtx-trim-args name args) + (logit 4 "Trimming args of " name ": " args "\n") (let* ((rtx-obj (rtx-lookup name)) (arg-types (rtx-arg-types rtx-obj))) @@ -470,6 +472,7 @@ ; Examples of things to remove: ; - empty options list ; - ifield/operand/local/const wrappers +; - modes of operations that don't need them to convey meaning ; ; NOTE: While having to trim the result of rtx-simplify may seem ironic, ; it isn't. You need to keep separate the notions of simplifying "1+1" to "2" @@ -490,7 +493,13 @@ (car rest) rtx)) - ((set) + ((set set-quiet) + (let ((trimmed-args (/rtx-trim-args name rest))) + (if (null? options) + (cons name trimmed-args) + (cons name (cons options (cons mode trimmed-args)))))) + + ((eq ne lt le gt ge ltu leu gtu geu index-of) (let ((trimmed-args (/rtx-trim-args name rest))) (if (null? options) (cons name trimmed-args) @@ -520,6 +529,9 @@ (cons name (cons mode (reverse result)))) (cons name (cons options (cons mode (reverse result))))))) + ((nop) + (list 'nop)) + ((closure) ;; Remove outer closures, they are artificially added, and are ;; basically noise to the human trying to understand the semantics. -- 2.43.5