Vbcc Compiler System

Total Page:16

File Type:pdf, Size:1020Kb

Vbcc Compiler System vbcc compiler system Volker Barthelmann i Table of Contents 1 General :::::::::::::::::::::::::::::::::::::::::: 1 1.1 Introduction ::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Legal :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 1 1.3 Installation :::::::::::::::::::::::::::::::::::::::::::::::::::: 2 1.3.1 Installing for Unix::::::::::::::::::::::::::::::::::::::::: 3 1.3.2 Installing for DOS/Windows::::::::::::::::::::::::::::::: 3 1.3.3 Installing for AmigaOS :::::::::::::::::::::::::::::::::::: 3 1.4 Tutorial :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 5 2 The Frontend ::::::::::::::::::::::::::::::::::: 7 2.1 Usage :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.2 Configuration :::::::::::::::::::::::::::::::::::::::::::::::::: 8 3 The Compiler :::::::::::::::::::::::::::::::::: 11 3.1 General Compiler Options::::::::::::::::::::::::::::::::::::: 11 3.2 Errors and Warnings :::::::::::::::::::::::::::::::::::::::::: 15 3.3 Data Types ::::::::::::::::::::::::::::::::::::::::::::::::::: 15 3.4 Optimizations::::::::::::::::::::::::::::::::::::::::::::::::: 16 3.4.1 Register Allocation ::::::::::::::::::::::::::::::::::::::: 18 3.4.2 Flow Optimizations :::::::::::::::::::::::::::::::::::::: 18 3.4.3 Common Subexpression Elimination :::::::::::::::::::::: 19 3.4.4 Copy Propagation :::::::::::::::::::::::::::::::::::::::: 20 3.4.5 Constant Propagation :::::::::::::::::::::::::::::::::::: 20 3.4.6 Dead Code Elimination::::::::::::::::::::::::::::::::::: 21 3.4.7 Loop-Invariant Code Motion ::::::::::::::::::::::::::::: 21 3.4.8 Strength Reduction :::::::::::::::::::::::::::::::::::::: 22 3.4.9 Induction Variable Elimination ::::::::::::::::::::::::::: 22 3.4.10 Loop Unrolling:::::::::::::::::::::::::::::::::::::::::: 23 3.4.11 Function Inlining:::::::::::::::::::::::::::::::::::::::: 25 3.4.12 Intrinsic Functions :::::::::::::::::::::::::::::::::::::: 27 3.4.13 Unused Object Elimination:::::::::::::::::::::::::::::: 27 3.4.14 Alias Analysis::::::::::::::::::::::::::::::::::::::::::: 28 3.4.15 Inter-Procedural Analysis ::::::::::::::::::::::::::::::: 29 3.4.16 Cross-Module Optimizations :::::::::::::::::::::::::::: 30 3.4.17 Instruction Scheduling :::::::::::::::::::::::::::::::::: 30 3.4.18 Target-Specific Optimizations ::::::::::::::::::::::::::: 31 3.4.19 Debugging Optimized Code ::::::::::::::::::::::::::::: 31 3.5 Extensions :::::::::::::::::::::::::::::::::::::::::::::::::::: 32 3.5.1 Pragmas ::::::::::::::::::::::::::::::::::::::::::::::::: 32 3.5.2 Register Parameters :::::::::::::::::::::::::::::::::::::: 33 3.5.3 Inline-Assembly Functions :::::::::::::::::::::::::::::::: 33 3.5.4 Variable Attributes::::::::::::::::::::::::::::::::::::::: 34 ii vbcc manual 3.5.5 Type Attributes :::::::::::::::::::::::::::::::::::::::::: 34 3.5.6 __typeof :::::::::::::::::::::::::::::::::::::::::::::::: 35 3.5.7 __alignof ::::::::::::::::::::::::::::::::::::::::::::::: 35 3.5.8 __offsetof :::::::::::::::::::::::::::::::::::::::::::::: 35 3.5.9 Specifying side-effects :::::::::::::::::::::::::::::::::::: 35 3.5.10 Automatic constructor/destructor functions ::::::::::::: 36 3.5.10.1 Predefined macros:::::::::::::::::::::::::::::::::: 36 3.6 Known Problems:::::::::::::::::::::::::::::::::::::::::::::: 36 3.7 Credits ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 37 4 M68k/Coldfire Backend::::::::::::::::::::::: 39 4.1 Additional options :::::::::::::::::::::::::::::::::::::::::::: 39 4.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 40 4.3 Small data :::::::::::::::::::::::::::::::::::::::::::::::::::: 41 4.4 Small code :::::::::::::::::::::::::::::::::::::::::::::::::::: 41 4.5 CPUs ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 4.6 FPUs ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 4.7 Math ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 42 4.8 Target-Specific Variable Attributes :::::::::::::::::::::::::::: 43 4.9 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 43 4.10 Stack :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 43 4.11 Stdarg ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 44 4.12 Known problems ::::::::::::::::::::::::::::::::::::::::::::: 44 5 PowerPC Backend::::::::::::::::::::::::::::: 45 5.1 Additional options for this version ::::::::::::::::::::::::::::: 45 5.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 5.3 Target-specific variable-attributes ::::::::::::::::::::::::::::: 47 5.4 Target-specific pragmas ::::::::::::::::::::::::::::::::::::::: 48 5.5 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 48 5.6 Stack ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 48 5.7 Stdarg :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 48 5.8 Known problems :::::::::::::::::::::::::::::::::::::::::::::: 50 6 DEC Alpha Backend :::::::::::::::::::::::::: 51 6.1 Additional options for this version ::::::::::::::::::::::::::::: 51 6.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 51 6.3 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 52 6.4 Stdarg :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 52 6.5 Known problems :::::::::::::::::::::::::::::::::::::::::::::: 52 7 i386 Backend::::::::::::::::::::::::::::::::::: 55 7.1 Additional options for this version ::::::::::::::::::::::::::::: 55 7.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 55 7.3 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 56 7.4 Stdarg :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 56 7.5 Known Problems:::::::::::::::::::::::::::::::::::::::::::::: 56 iii 8 c16x Backend :::::::::::::::::::::::::::::::::: 57 8.1 Additional options for this version ::::::::::::::::::::::::::::: 57 8.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 57 8.3 Target-specific variable-attributes ::::::::::::::::::::::::::::: 58 8.4 Target-specific type-attributes ::::::::::::::::::::::::::::::::: 59 8.5 Target-specific types :::::::::::::::::::::::::::::::::::::::::: 59 8.6 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 59 8.7 Stack ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 60 8.8 Stdarg :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 60 8.9 Known Problems:::::::::::::::::::::::::::::::::::::::::::::: 60 9 68hc12 Backend ::::::::::::::::::::::::::::::: 61 9.1 Additional options for this version ::::::::::::::::::::::::::::: 61 9.2 ABI :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 61 9.3 Target-specific variable-attributes ::::::::::::::::::::::::::::: 62 9.4 Predefined Macros :::::::::::::::::::::::::::::::::::::::::::: 62 9.5 Stack ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 62 9.6 Stdarg :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 62 9.7 Known Problems:::::::::::::::::::::::::::::::::::::::::::::: 62 10 VideoCore IV Backend :::::::::::::::::::::: 63 10.1 Additional options for this version:::::::::::::::::::::::::::: 63 10.2 ABI ::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 63 10.3 Target-specific variable-attributes :::::::::::::::::::::::::::: 64 10.4 Target-specific pragmas :::::::::::::::::::::::::::::::::::::: 64 10.5 Predefined Macros ::::::::::::::::::::::::::::::::::::::::::: 64 10.6 Stdarg ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 64 10.7 Known problems ::::::::::::::::::::::::::::::::::::::::::::: 64 11 Instruction Scheduler :::::::::::::::::::::::: 67 11.1 Introduction ::::::::::::::::::::::::::::::::::::::::::::::::: 67 11.2 Usage:::::::::::::::::::::::::::::::::::::::::::::::::::::::: 67 11.3 Known problems ::::::::::::::::::::::::::::::::::::::::::::: 67 12 C Library ::::::::::::::::::::::::::::::::::::: 69 12.1 Introduction ::::::::::::::::::::::::::::::::::::::::::::::::: 69 12.2 Legal :::::::::::::::::::::::::::::::::::::::::::::::::::::::: 69 12.3 Embedded Systems :::::::::::::::::::::::::::::::::::::::::: 70 12.3.1 Startup ::::::::::::::::::::::::::::::::::::::::::::::::: 70 12.3.2 Heap:::::::::::::::::::::::::::::::::::::::::::::::::::: 71 12.3.3 Input/Output ::::::::::::::::::::::::::::::::::::::::::: 71 12.3.4 Floating Point :::::::::::::::::::::::::::::::::::::::::: 71 12.3.5 Useless Functions ::::::::::::::::::::::::::::::::::::::: 72 12.3.6 Linking/Locating ::::::::::::::::::::::::::::::::::::::: 72 12.4 AmigaOS/68k ::::::::::::::::::::::::::::::::::::::::::::::: 72 12.4.1 Startup ::::::::::::::::::::::::::::::::::::::::::::::::: 73 iv vbcc manual 12.4.2 Floating point :::::::::::::::::::::::::::::::::::::::::: 73 12.4.3 Stack ::::::::::::::::::::::::::::::::::::::::::::::::::: 73 12.4.4 Small data model ::::::::::::::::::::::::::::::::::::::: 74 12.4.5 Restrictions ::::::::::::::::::::::::::::::::::::::::::::: 74 12.4.6 Minimal Startup :::::::::::::::::::::::::::::::::::::::: 74 12.4.7 Minimal Startup for resident programs :::::::::::::::::: 75 12.4.8 amiga.lib:::::::::::::::::::::::::::::::::::::::::::::::: 76 12.4.9 auto.lib ::::::::::::::::::::::::::::::::::::::::::::::::: 76 12.5 Kickstart1.x/68k ::::::::::::::::::::::::::::::::::::::::::::: 76 12.5.1 Startup ::::::::::::::::::::::::::::::::::::::::::::::::: 77 12.5.2 Floating point :::::::::::::::::::::::::::::::::::::::::: 77 12.5.3 Stack ::::::::::::::::::::::::::::::::::::::::::::::::::: 77 12.5.4 Small data model ::::::::::::::::::::::::::::::::::::::: 77 12.5.5 Restrictions ::::::::::::::::::::::::::::::::::::::::::::: 77 12.5.6 amiga.lib:::::::::::::::::::::::::::::::::::::::::::::::: 77 12.5.7 auto.lib
Recommended publications
  • Loop Pipelining with Resource and Timing Constraints
    UNIVERSITAT POLITÈCNICA DE CATALUNYA LOOP PIPELINING WITH RESOURCE AND TIMING CONSTRAINTS Autor: Fermín Sánchez October, 1995 1 1 1 1 1 1 1 1 2 1• SOFTWARE PIPELINING 1 1 1 2.1 INTRODUCTION 1 Software pipelining [ChaSl] comprises a family of techniques aimed at finding a pipelined schedule of the execution of loop iterations. The pipelined schedule represents a new loop body which may contain instructions belonging to different iterations. The sequential execution of the schedule takes less time than the sequential execution of the iterations of the loop as they were initially written. 1 In general, a pipelined loop schedule has the following characteristics1: • All the iterations (of the new loop) are executed in the same fashion. • The initiation interval (ÍÍ) between the issuing of two consecutive iterations is always the same. 1 Figure 2.1 shows an example of software pipelining a loop. The DDG representing the loop body to pipeline is presented in Figure 2.1(a). The loop must be executed ten times (with an iteration index i G [0,9]). Let us assume that all instructions in the loop are executed in a single cycle 1 and a new iteration may start every cycle (otherwise the dependence between instruction A from 1 We will assume here that the schedule contains a unique iteration of the loop. 1 15 1 1 I I 16 CHAPTER 2 I I time B,, Prol AO Q, BO A, I Q, B, A2 3<i<9 I Steady State D4 B7 I Epilogue Cy I D9 (a) (b) (c) I Figure 2.1 Software pipelining a loop (a) DDG representing a loop body (b) Parallel execution of the loop (c) New parallel loop body I iterations i and i+ 1 will not be honored).- With this assumption,-the loop can be executed in a I more parallel fashion than the sequential one, as shown in Figure 2.1(b).
    [Show full text]
  • DKB Kwikstart II Installation and User's Guide
    KwikStart II™ Kickstart Rom Expansion Board for the Amiga® 1000 Installation and User's Guide by DKB Software COPYRIGHT This manual is the Copyright © of DKB Software, Inc. All Rights Reserved. This document may not, in whole or in part, be copied, photocopied, reproduced, translated,or reduced to any electron­ ic medium or machine readable form, without prior consent, in writing, of DKB Software, Inc. MegAChip 2000, MultiStart II, BattDisk, SecureKey, KwikStart, KwikStart II, Insider, and Insider II are trademarks of DKB Software. Amiga is a registered trademark of Commodore-Amiga, Inc. AmigaDos, Kickstart, and Workbench are trademarks of Commodore-Amiga, Inc. Table of Contents 1. Introduction 1 2. Configuring the KwikStart II TM 2 Selecting the power up mode 2 3. Installation 3 Disassembling your Amiga • 3 Removing the PAL 4 Removing the disk drive 5 Removing the 68000 6 Installing the K wikStart II TM 6 Testing your system 8 Reassembling your Amiga• 9 4. Operation of the KwikStart II TM 10 5. Troubleshooting 11 PN: 00300801-01 1. Introduction. Congratulations on the purchase of your new KwikStart II™ ROM board for the Amiga® 1000 by DKB Software.The KwikStartII™ ROM board will pr ovide you with many benefits. KwikStart II™ is an add on board that puts thelatest Amiga® KickStart™ permanentlyin ROM (ReadOnly Memory) like in the A500,A2000 and A3000. This latest version of the KwikStart II™ provides you with the ability to install Kickstart™V2.0 as well as Vl.3 or Vl.2 in your Amiga® 1000. This is the easiest way for A 1000 owners to upgrade to 2.0.
    [Show full text]
  • Polyhedral Compilation As a Design Pattern for Compiler Construction
    Polyhedral Compilation as a Design Pattern for Compiler Construction PLISS, May 19-24, 2019 [email protected] Polyhedra? Example: Tiles Polyhedra? Example: Tiles How many of you read “Design Pattern”? → Tiles Everywhere 1. Hardware Example: Google Cloud TPU Architectural Scalability With Tiling Tiles Everywhere 1. Hardware Google Edge TPU Edge computing zoo Tiles Everywhere 1. Hardware 2. Data Layout Example: XLA compiler, Tiled data layout Repeated/Hierarchical Tiling e.g., BF16 (bfloat16) on Cloud TPU (should be 8x128 then 2x1) Tiles Everywhere Tiling in Halide 1. Hardware 2. Data Layout Tiled schedule: strip-mine (a.k.a. split) 3. Control Flow permute (a.k.a. reorder) 4. Data Flow 5. Data Parallelism Vectorized schedule: strip-mine Example: Halide for image processing pipelines vectorize inner loop https://halide-lang.org Meta-programming API and domain-specific language (DSL) for loop transformations, numerical computing kernels Non-divisible bounds/extent: strip-mine shift left/up redundant computation (also forward substitute/inline operand) Tiles Everywhere TVM example: scan cell (RNN) m = tvm.var("m") n = tvm.var("n") 1. Hardware X = tvm.placeholder((m,n), name="X") s_state = tvm.placeholder((m,n)) 2. Data Layout s_init = tvm.compute((1,n), lambda _,i: X[0,i]) s_do = tvm.compute((m,n), lambda t,i: s_state[t-1,i] + X[t,i]) 3. Control Flow s_scan = tvm.scan(s_init, s_do, s_state, inputs=[X]) s = tvm.create_schedule(s_scan.op) 4. Data Flow // Schedule to run the scan cell on a CUDA device block_x = tvm.thread_axis("blockIdx.x") 5. Data Parallelism thread_x = tvm.thread_axis("threadIdx.x") xo,xi = s[s_init].split(s_init.op.axis[1], factor=num_thread) s[s_init].bind(xo, block_x) Example: Halide for image processing pipelines s[s_init].bind(xi, thread_x) xo,xi = s[s_do].split(s_do.op.axis[1], factor=num_thread) https://halide-lang.org s[s_do].bind(xo, block_x) s[s_do].bind(xi, thread_x) print(tvm.lower(s, [X, s_scan], simple_mode=True)) And also TVM for neural networks https://tvm.ai Tiling and Beyond 1.
    [Show full text]
  • The AMIGA Sample of Isolated Galaxies III
    A&A 462, 507–523 (2007) Astronomy DOI: 10.1051/0004-6361:20066144 & c ESO 2007 Astrophysics The AMIGA sample of isolated galaxies III. IRAS data and infrared diagnostics U. Lisenfeld1,2, L. Verdes-Montenegro2 ,J.Sulentic3,S.Leon4,D.Espada2, G. Bergond2,5, E. García2, J. Sabater2, J. D. Santander-Vela2, and S. Verley2,6,7 1 Departamento de Física Teórica y del Cosmos, Facultad de Ciencias, Universidad de Granada, Spain e-mail: [email protected] 2 Instituto de Astrofísica de Andalucía (IAA/CSIC), Apdo. 3004, 18080 Granada, Spain 3 Department of Astronomy, University of Alabama, Tuscaloosa, USA 4 Instituto de Radioastronomía Milimétrica (IRAM), Avda. Divina Pastora 7, local 20, 18012 Granada, Spain 5 GEPI/CAI, Observatoire de Paris, 77 avenue Denfert-Rochereau, 75014 Paris, France 6 LERMA - Observatoire de Paris, 61 avenue de l’Observatoire, 75014 Paris, France 7 INAF-Osservatorio Astrofisico di Arcetri, Largo E. Fermi 5, 50125 Firenze, Italy Received 31 July 2006 / Accepted 26 September 2006 ABSTRACT Aims. We describe the mid- (MIR) and far- (FIR) infrared properties of a large (∼1000) sample of the most isolated galaxies in the local Universe. This sample is intended as a “nurture-free” zero point against which more environmentally influenced samples can be compared. Methods. We reprocess IRAS MIR/FIR survey data using the ADDSCAN/SCANPI utility for 1030 out of 1050 galaxies from the Catalogue of Isolated Galaxies (CIG) as part of the AMIGA project. We focus on diagnostics (FIR luminosity LFIR, R = log(LFIR/LB), and IRAS colours) thought to be sensitive to effects of environment or interaction.
    [Show full text]
  • Ebook - Informations About Operating Systems Version: August 15, 2006 | Download
    eBook - Informations about Operating Systems Version: August 15, 2006 | Download: www.operating-system.org AIX Internet: AIX AmigaOS Internet: AmigaOS AtheOS Internet: AtheOS BeIA Internet: BeIA BeOS Internet: BeOS BSDi Internet: BSDi CP/M Internet: CP/M Darwin Internet: Darwin EPOC Internet: EPOC FreeBSD Internet: FreeBSD HP-UX Internet: HP-UX Hurd Internet: Hurd Inferno Internet: Inferno IRIX Internet: IRIX JavaOS Internet: JavaOS LFS Internet: LFS Linspire Internet: Linspire Linux Internet: Linux MacOS Internet: MacOS Minix Internet: Minix MorphOS Internet: MorphOS MS-DOS Internet: MS-DOS MVS Internet: MVS NetBSD Internet: NetBSD NetWare Internet: NetWare Newdeal Internet: Newdeal NEXTSTEP Internet: NEXTSTEP OpenBSD Internet: OpenBSD OS/2 Internet: OS/2 Further operating systems Internet: Further operating systems PalmOS Internet: PalmOS Plan9 Internet: Plan9 QNX Internet: QNX RiscOS Internet: RiscOS Solaris Internet: Solaris SuSE Linux Internet: SuSE Linux Unicos Internet: Unicos Unix Internet: Unix Unixware Internet: Unixware Windows 2000 Internet: Windows 2000 Windows 3.11 Internet: Windows 3.11 Windows 95 Internet: Windows 95 Windows 98 Internet: Windows 98 Windows CE Internet: Windows CE Windows Family Internet: Windows Family Windows ME Internet: Windows ME Seite 1 von 138 eBook - Informations about Operating Systems Version: August 15, 2006 | Download: www.operating-system.org Windows NT 3.1 Internet: Windows NT 3.1 Windows NT 4.0 Internet: Windows NT 4.0 Windows Server 2003 Internet: Windows Server 2003 Windows Vista Internet: Windows Vista Windows XP Internet: Windows XP Apple - Company Internet: Apple - Company AT&T - Company Internet: AT&T - Company Be Inc. - Company Internet: Be Inc. - Company BSD Family Internet: BSD Family Cray Inc.
    [Show full text]
  • Arexx Users Reference Manual
    Copyright Notice ARexx software and documentation are Copyright ©1987 by William S. Hawes. No part of the software or documentation may be reproduced, transmitted, translated into other languages, posted to a network, or distributed in any way without the express written permission of the author. Disclaimer This product is offered for sale "as is" with no representation of fitness for any particular purpose. The user assumes all risks and responsibilities related to its use. The material within is believed to be accurate, but the author reserves the right to make changes to the software or documentation without notice. Distribution ARexx software and documentation are available from: William S. Hawes P.O. Box 308 Maynard, MA 01754 (508) 568-8695 Please direct orders or inquiries about this product to the above address. Site licenses are available; write for further information. About ... ARexx was developed on an Amiga 1000 computer with 512K bytes of memory and two floppy disk drives. The language prototype was developed in C using I,attice C, and the production version was written in assembly-language using the Metacomco Assembler. The documention was created using the TxEd editor, and was set in 'lEX using Amiga'lEX. This is a 100% Amiga product. Trademarks Amiga, Amiga WorkBench, and Intuition are trademarks of Commodore-Amiga, Inc. Table of Contents ARexx User's Reference Manual Introduction. · 1 1 Organization of this Document . · 1 1 Using this Manual .... .2 2 Typographic Conventions · 2 2 Future Directions · 2 Chapter 1. What is ARexx? · 3 1 Language Features . · 3 2 ARexx on the Amiga .
    [Show full text]
  • Research of Register Pressure Aware Loop Unrolling Optimizations for Compiler
    MATEC Web of Conferences 228, 03008 (2018) https://doi.org/10.1051/matecconf/201822803008 CAS 2018 Research of Register Pressure Aware Loop Unrolling Optimizations for Compiler Xuehua Liu1,2, Liping Ding1,3 , Yanfeng Li1,2 , Guangxuan Chen1,4 , Jin Du5 1Laboratory of Parallel Software and Computational Science, Institute of Software, Chinese Academy of Sciences, Beijing, China 2University of Chinese Academy of Sciences, Beijing, China 3Digital Forensics Lab, Institute of Software Application Technology, Guangzhou & Chinese Academy of Sciences, Guangzhou, China 4Zhejiang Police College, Hangzhou, China 5Yunnan Police College, Kunming, China Abstract. Register pressure problem has been a known problem for compiler because of the mismatch between the infinite number of pseudo registers and the finite number of hard registers. Too heavy register pressure may results in register spilling and then leads to performance degradation. There are a lot of optimizations, especially loop optimizations suffer from register spilling in compiler. In order to fight register pressure and therefore improve the effectiveness of compiler, this research takes the register pressure into account to improve loop unrolling optimization during the transformation process. In addition, a register pressure aware transformation is able to reduce the performance overhead of some fine-grained randomization transformations which can be used to defend against ROP attacks. Experiments showed a peak improvement of about 3.6% and an average improvement of about 1% for SPEC CPU 2006 benchmarks and a peak improvement of about 3% and an average improvement of about 1% for the LINPACK benchmark. 1 Introduction fundamental transformations, because it is not only performed individually at least twice during the Register pressure is the number of hard registers needed compilation process, it is also an important part of to store values in the pseudo registers at given program optimizations like vectorization, module scheduling and point [1] during the compilation process.
    [Show full text]
  • Truffle/C Interpreter
    JOHANNES KEPLER UNIVERSITAT¨ LINZ JKU Faculty of Engineering and Natural Sciences Truffle/C Interpreter Master’s Thesis submitted in partial fulfillment of the requirements for the academic degree Diplom-Ingenieur in the Master’s Program Computer Science Submitted by Manuel Rigger, BSc. At the Institut f¨urSystemsoftware Advisor o.Univ.-Prof. Dipl.-Ing. Dr.Dr.h.c. Hanspeter M¨ossenb¨ock Co-advisor Dipl.-Ing. Lukas Stadler Dipl.-Ing. Dr. Thomas W¨urthinger Xiamen, April 2014 Contents I Contents 1 Introduction 3 1.1 Motivation . .3 1.2 Goals and Scope . .4 1.3 From C to Java . .4 1.4 Structure of the Thesis . .6 2 State of the Art 9 2.1 Graal . .9 2.2 Truffle . 10 2.2.1 Rewriting and Specialization . 10 2.2.2 Truffle DSL . 11 2.2.3 Control Flow . 12 2.2.4 Profiling and Inlining . 12 2.2.5 Partial Evaluation and Compilation . 12 2.3 Clang . 13 3 Architecture 14 3.1 From Clang to Java . 15 3.2 Node Construction . 16 3.3 Runtime . 16 4 The Truffle/C File 17 4.1 Truffle/C File Format Goals . 17 4.2 Truffle/C File Format 1 . 19 4.2.1 Constant Pool . 19 4.2.2 Function Table . 20 4.2.3 Functions and Attributes . 20 4.3 Truffle/C File Considerations and Comparison . 21 4.3.1 Java Class File and Truffle/C File . 21 4.3.2 ELF and Truffle/C File . 22 4.4 Clang Modification Truffle/C File . 23 Contents II 5 Truffle/C Data Types 25 5.1 Data Type Hierarchy: Boxing, Upcasts and Downcasts .
    [Show full text]
  • CS153: Compilers Lecture 19: Optimization
    CS153: Compilers Lecture 19: Optimization Stephen Chong https://www.seas.harvard.edu/courses/cs153 Contains content from lecture notes by Steve Zdancewic and Greg Morrisett Announcements •HW5: Oat v.2 out •Due in 2 weeks •HW6 will be released next week •Implementing optimizations! (and more) Stephen Chong, Harvard University 2 Today •Optimizations •Safety •Constant folding •Algebraic simplification • Strength reduction •Constant propagation •Copy propagation •Dead code elimination •Inlining and specialization • Recursive function inlining •Tail call elimination •Common subexpression elimination Stephen Chong, Harvard University 3 Optimizations •The code generated by our OAT compiler so far is pretty inefficient. •Lots of redundant moves. •Lots of unnecessary arithmetic instructions. •Consider this OAT program: int foo(int w) { var x = 3 + 5; var y = x * w; var z = y - 0; return z * 4; } Stephen Chong, Harvard University 4 Unoptimized vs. Optimized Output .globl _foo _foo: •Hand optimized code: pushl %ebp movl %esp, %ebp _foo: subl $64, %esp shlq $5, %rdi __fresh2: movq %rdi, %rax leal -64(%ebp), %eax ret movl %eax, -48(%ebp) movl 8(%ebp), %eax •Function foo may be movl %eax, %ecx movl -48(%ebp), %eax inlined by the compiler, movl %ecx, (%eax) movl $3, %eax so it can be implemented movl %eax, -44(%ebp) movl $5, %eax by just one instruction! movl %eax, %ecx addl %ecx, -44(%ebp) leal -60(%ebp), %eax movl %eax, -40(%ebp) movl -44(%ebp), %eax Stephen Chong,movl Harvard %eax,University %ecx 5 Why do we need optimizations? •To help programmers… •They write modular, clean, high-level programs •Compiler generates efficient, high-performance assembly •Programmers don’t write optimal code •High-level languages make avoiding redundant computation inconvenient or impossible •e.g.
    [Show full text]
  • Amigaos 3.2 FAQ 47.1 (09.04.2021) English
    $VER: AmigaOS 3.2 FAQ 47.1 (09.04.2021) English Please note: This file contains a list of frequently asked questions along with answers, sorted by topics. Before trying to contact support, please read through this FAQ to determine whether or not it answers your question(s). Whilst this FAQ is focused on AmigaOS 3.2, it contains information regarding previous AmigaOS versions. Index of topics covered in this FAQ: 1. Installation 1.1 * What are the minimum hardware requirements for AmigaOS 3.2? 1.2 * Why won't AmigaOS 3.2 boot with 512 KB of RAM? 1.3 * Ok, I get it; 512 KB is not enough anymore, but can I get my way with less than 2 MB of RAM? 1.4 * How can I verify whether I correctly installed AmigaOS 3.2? 1.5 * Do you have any tips that can help me with 3.2 using my current hardware and software combination? 1.6 * The Help subsystem fails, it seems it is not available anymore. What happened? 1.7 * What are GlowIcons? Should I choose to install them? 1.8 * How can I verify the integrity of my AmigaOS 3.2 CD-ROM? 1.9 * My Greek/Russian/Polish/Turkish fonts are not being properly displayed. How can I fix this? 1.10 * When I boot from my AmigaOS 3.2 CD-ROM, I am being welcomed to the "AmigaOS Preinstallation Environment". What does this mean? 1.11 * What is the optimal ADF images/floppy disk ordering for a full AmigaOS 3.2 installation? 1.12 * LoadModule fails for some unknown reason when trying to update my ROM modules.
    [Show full text]
  • Chapter 1. Origins of Mac OS X
    1 Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems. 1 2 2 1 1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years.
    [Show full text]
  • Contents of Lecture 4: Declarations
    Contents of Lecture 4: Declarations Implicint int Storage class specifiers Type specifiers Enumeration specifiers Type qualifiers Jonas Skeppstedt ([email protected]) Lecture 4 2014 1 / 39 Now obsolete: implicit int Sometimes you can see code such as: main() // invalid { } or even: #include <stdio.h> count; // invalid float x; In earlier versions of C one could skip the type, which then became int, and is called implicit int. Calling a function before its declaration also set its return type to int. It’s invalid C so don’t use it — but compilers often allow it... Jonas Skeppstedt ([email protected]) Lecture 4 2014 2 / 39 Storage class specifiers Last lecture we discussed the different kinds of storage durations. Now we will see how to specify some of them explicitly. Dynamic (important) and temporary (less important) storage duration are not specified by the programmer using any particular syntax but defined by the standard. The storage class specifiers are: typedef extern static _Thread_local auto register Of these typedef does not refer to any kind of storage duration — instead it introduces another name of a type and not a new type: typedef int num_t; int* p; num_t* q; p = q; // valid since p and q have the same type. Jonas Skeppstedt ([email protected]) Lecture 4 2014 3 / 39 Storage class specifiers: static at file scope static int count; /∗ initialized to zero. ∗/ static void init(void) { /∗ Do some initializations ... ∗/ } Used to make an identifier invisible outside the source file With static at file scope, there is no risk of name conflicts with other files.
    [Show full text]