From af47268d550b5d1f1380b1a7be01389eae02a4d2 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 27 Jun 2010 21:12:18 +0000 Subject: * interp/g-util.boot: Add new opcode %before?. * interp/g-opt.boot ($VMsideEffectFreeOperators): Include it. --- src/interp/g-opt.boot | 2 +- src/interp/g-util.boot | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 8c7c4a10..6786bbbf 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -479,7 +479,7 @@ $VMsideEffectFreeOperators == %nil %pair? %lconcat %llength %lfirst %lsecond %lthird %lreverse %lempty? %hash %ismall? %string? %f2s %ceq %clt %cle %cgt %cge %c2i %i2c - %vref %vlength) + %vref %vlength %before?) ++ List of simple VM operators $simpleVMoperators == diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 97519045..284a7e98 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -227,6 +227,9 @@ expandPeq ['%peq,x,y] == y = '%nil => ['NULL,expandToVMForm x] ['EQ,expandToVMForm x, expandToVMForm y] +expandBefore? ['%before?,x,y] == + ['GGREATER,expandToVMForm y,expandToVMForm x] + -- Integer operations expandIneg ['%ineg,x] == x := expandToVMForm x @@ -393,8 +396,8 @@ for x in [ ++ Table of opcode-expander pairs. for x in [ - ['%collect,:function expandCollect], - ['%loop, :function expandLoop], + ['%collect, :function expandCollect], + ['%loop, :function expandLoop], ['%return, :function expandReturn], ['%igt, :function expandIgt], @@ -410,11 +413,12 @@ for x in [ ['%fneg, :function expandFneg], ['%fprec, :function expandFprec], - ["%peq",:function expandPeq], + ['%peq, :function expandPeq], + ['%before?, :function expandBefore?], - ["%bind",:function expandBind], - ["%store",:function expandStore], - ["%dynval",:function expandDynval] + ["%bind", :function expandBind], + ["%store", :function expandStore], + ["%dynval", :function expandDynval] ] repeat property(first x,"%Expander") := rest x ++ Return the expander of a middle-end opcode, or nil if there is none. -- cgit v1.2.3