{"title":"Architecture Description Languages for Retargetable Compilation","authors":"W. Qin, S. Malik","doi":"10.1201/9781420040579.ch14","DOIUrl":"https://doi.org/10.1201/9781420040579.ch14","url":null,"abstract":"","PeriodicalId":295765,"journal":{"name":"The Compiler Design Handbook","volume":"42 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121374212","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Register Allocation","authors":"Florent Bouchez-Tichadou, F. Rastello","doi":"10.1201/9781420040579.ch13","DOIUrl":"https://doi.org/10.1201/9781420040579.ch13","url":null,"abstract":"In chapter 1 we simplified the generation of x86 assembly by placing all variables on the stack. We can improve the performance of the generated code considerably if we instead try to place as many variables as possible into registers. The CPU can access a register in a single cycle, whereas accessing the stack can take from several cycles (to go to cache) to hundreds of cycles (to go to main memory). Figure 1 shows a program fragment that we'll use as a running example. The program is almost in x86 assembly but not quite; it still contains variables instead of stack locations or registers. The goal of register allocation is to fit as many variables into registers as possible. It is often the case that we have more variables than registers, so we can't naively map each variable to a register. Fortunately, it is also common for different variables to be needed during different periods of time, and in such cases the variables can be mapped to the same register. Consider variables y and z in Figure 1. After the variable z is used in addl z, x it is no longer needed. Variable y, on the other hand, is only used after this point, so z and y could share the same register. FIGURE 1. An example program in pseudo assembly code. The program still uses variables instead of registers and stack locations.","PeriodicalId":295765,"journal":{"name":"The Compiler Design Handbook","volume":"49 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122243704","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Type Systems in Programming Languages","authors":"Ramesh Subrahmanyam","doi":"10.1201/9781420040579.ch21","DOIUrl":"https://doi.org/10.1201/9781420040579.ch21","url":null,"abstract":"Types Support for data abstraction is provided by existential types, which are “dual” to the universal types associated with polymorphism. 8.1 Statics The language Lpp Ω is defined to be an enrichment of L →,∀p Ω with the following additional constructs: Types σ : : = ∃u::κ(σ) Expressions e : : = packμ with e asσ | openσ′ e asu::κ withx:σ in e′ The variables u and x are bound in e′, and, as usual, we identify expressions that differ only in the names of the bound variables. The expression openσ (packμ with e ′ as∃u::κ(σ′)) asu::κ withx:σ′ in e is sometimes written abstypeu::κ isμ withx:σ′=e′ in e end to emphasize the connection with the data abstraction mechanisms found in ML and CLU where the only expressions of existential type are explicit packages. The formation rules for these constructs are as follows: `∆[u::κ] σ `∆ ∃u::κ(σ) (u / ∈ dom(∆)) (t-exist) ∆ ` μ :: κ Γ `∆ e : {μ/u}σ Γ `∆ packμ with e as∃u::κ(σ) : ∃u::κ(σ) (t-pack)","PeriodicalId":295765,"journal":{"name":"The Compiler Design Handbook","volume":"11 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125287813","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Introduction to Operational Semantics","authors":"Sanjiva Prasad, S. Arun-Kumar","doi":"10.1201/9781420040579.ch22","DOIUrl":"https://doi.org/10.1201/9781420040579.ch22","url":null,"abstract":"This chapter presents the syntax of a programming language, IMP, a small language of while programs. IMP is called an \"imperative\" language because program execution involves carrying out a series of explicit commands to change state. Formally, IMP's behaviour is described by rules which specify how its expressions are evaluated and its commands are executed. The rules provide an operational semantics of IMP in that they are close to giving an implementation of the language, for example, in the programming language Prolog. It is also shown how they furnish a basis for simple proofs of equivalence between commands. 2.1 IMP-a simple imperative language Firstly, we list the syntactic sets associated with IMP: • numbers N, consisting of positive and negative integers with zero, • truth values T = {true, false}, • locations Loc, • arithmetic expressions Aexp, • boolean expressions Bexp, • commands Com. We assume the syntactic structure of numbers and locations is given. For instance, the set Loc might consist of non-empty strings of letters or such strings followed by digits, while N might be the set of signed decimal numerals for positive and negative whole numbers-indeed these are the representations we use when considering specific examples. (Locations are often called program variables but we reserve that term for another concept.) For the other syntactic sets we have to say how their elements are built-up. We'll use a variant of BNF (Backus-Naur form) as a way of writing down the rules of formation of the elements of these syntactic sets. The formation rules will express things like: If ao and al are arithmetic expressions then so is ao + al. It's clear that the symbols ao and al are being used to stand for any arithmetic expression. In our informal presentation of syntax we'll use such metavariables to range over the syntactic sets-the metavariables ao, al above are understood to range over the set of arithmetic expressions. In presenting the syntax of IMP we'll follow the convention that 12 Chapter 2 The metavariables we use to range over the syntactic categories can be primed or sub-scripted. We describe the formation rules for arithmetic expressions Aexp by: The symbol \"::=\" should be read as \"can be\" and the symbol \"I\" as \"or\". Thus an arithmetic expression a can be a number n or a location X or ao + al or ao-al or ao x a1, built from arithmetic …","PeriodicalId":295765,"journal":{"name":"The Compiler Design Handbook","volume":"11 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122138686","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Retargetable Very Long Instuction Word Compiler Framework for Digital Signal Processors","authors":"Subramanian Rajagopalan, S. Malik","doi":"10.1201/9781420040579.ch16","DOIUrl":"https://doi.org/10.1201/9781420040579.ch16","url":null,"abstract":"","PeriodicalId":295765,"journal":{"name":"The Compiler Design Handbook","volume":"23 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"124906736","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}