Optimizations for the CSE Machine

Slides:



Advertisements
Similar presentations
Interval Heaps Complete binary tree. Each node (except possibly last one) has 2 elements. Last node has 1 or 2 elements. Let a and b be the elements in.
Advertisements

AST Generation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture 9.
Stacks & Their Applications COP Stacks  A stack is a data structure that stores information arranged like a stack.  We have seen stacks before.
Expression Trees What is an Expression tree? Expression tree implementation Why expression trees? Evaluating an expression tree (pseudo code) Prefix, Infix,
Arithmetic Expressions
Stacks & Queues Infix Calculator CSC 172 SPRING 2002 LECTURE 5.
Multiplication on MathLine. For Multiplication on MathLine: Introduce Multiplication Practice Multiplication Math Facts Multiply all facts up to 10 x.
Evaluation of Expressions Instructor : Prof. Jyh-Shing Roger Jang Designer : Shao-Huan Wang The ideas are reference to the textbook “Fundamentals of Data.
Traversing a Binary Tree 10/23/ Traversing Binary Tree There are 3 ways of traversing a binary tree T having root R. 1. Preorder Traversing Steps:
CHAPTER 05 Compiled by: Dr. Mohammad Omar Alhawarat Stacks & Queues.
Attribute Grammars Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 17.
Computer Architecture EKT 422 Chapter 10 Instruction Sets: Characteristics and Functions (cont.)
 STACK STACK  BASIC STACK OPERATIONS BASIC STACK OPERATIONS  PUSH ALGORITHM PUSH ALGORITHM  POP ALGORITHM POP ALGORITHM  EVALUATING A POSTFIX EXPRESSION.
Data Structures : Project 5 Data Structures Project 5 – Expression Trees and Code Generation.
Parsing Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 3.
Lambda Calculus Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 11.
Basic Data Structures Stacks. A collection of objects Objects can be inserted into or removed from the collection at one end (top) First-in-last-out.
Standardizing RPAL AST’s Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 10.
Writing RPAL Programs Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture 13.
More on MIPS programs n SPIM does not support everything supported by a general MIPS assembler. For example, –.end doesn’t work Use j $ra –.macro doesn’t.
An Attribute Grammar for Tiny Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 18.
Programming Language Principles Lecture 32 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Course Summary.
STACK Data Structure
LL(1) Parsing Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture 7.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Programming Language Concepts
Review Use of Stack Introduction Stack in our life Stack Operations
Run-Time Environments Chapter 7
Building AST's for RPAL Programs
Programming Language Principles
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Lecture No.06 Data Structures Dr. Sohail Aslam
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Spring 2017.
Lesson 5-15 AP Computer Science Principles
An Attribute Grammar for Tiny
September 7 Notes Boolean Algebra.
Stack application: postponing data usage
Programming Language Principles
Programming Language Concepts
CSE322 LEFT & RIGHT LINEAR REGULAR GRAMMAR
The Relational Algebra and Relational Calculus
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Spring 2013.
Programming Language Translators
Programming Language Principles
CSE 214 – Computer Science II Stacks
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Autumn 2018.
Binary Tree Traversals
Mathematical Background 1
Mathematical Background 1
Building AST's for RPAL Programs
Queue Applications Lecture 31 Mon, Apr 9, 2007.
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Zach Tatlock Winter 2018.
Programming Language Principles
Programming Language Principles
The RPAL Functional Language
Lecture 2: Stacks and Queues
Operator precedence and AST’s
Recursion and Fixed-Point Theory
Name Binding and Object Lifetimes
Queue Applications Lecture 31 Tue, Apr 11, 2006.
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Spring 2016.
Number Lines.
Algebraic Specification Software Specification Lecture 34
Operator Precedence and Associativity
Programming Language Principles
Programming Language Concepts
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Spring 2019.
Brett Wortzman Summer 2019 Slides originally created by Dan Grossman
Stacks A stack is an ordered set of elements, for which only the last element placed into the stack is accessible. The stack data type is also known as.
CSE341: Programming Languages Lecture 6 Nested Patterns Exceptions Tail Recursion Dan Grossman Autumn 2017.
Presentation transcript:

Optimizations for the CSE Machine Programming Language Principles Lecture 13 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida

Five CSE Rules (Minimally) Sufficient Let's take some shortcuts. CSE Rules 6 and 7: Unary and Binary Operators.

Five CSE Rules (Minimally) Sufficient (cont’d) In the control structures, abbreviate:   + to +   - to - . . . (other binary operators)  neg to neg  not to not In other words, DO NOT standardize unops and binops.

CSE Rule 8: Conditional Do not standardize → node. Instead, for B → E1 | E 2, generate then else  B, where then = control structure for E1 else = control structure for E2 B evaluated first, then  pops the stack, keeps one  and discards the other.

CSE Rules 9 and 10: Tuples Do not standardize "tau“. Instead, for a tuple of the form (E1, E2, ..., En), generate the control structure taun E1 ... En. taun will: Pop the top n values from the stack, Create a new n-tuple, Push the tuple on the stack. Note: tuple elements are evaluated right-to-left.

CSE Rule 11: n-ary Functions Do not standardize the "," node. Instead, For (x,y).E, simply allow multiple bindings in one environment.

Optimizations for the CSE Machine Programming Language Principles Lecture 13 Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida