Posts

Project Stage 3: Tidy & Wrap

Introduction In this stage, I aimed to address the feedback provided by the professor and resolve the errors encountered in the previous stages of the GCC pass project. However, despite my efforts, I have faced significant challenges that have hindered my progress. Process and Steps Taken Building and Testing the Demo Pass - I started by building and testing the provided demo pass to understand its functionality. - However, I encountered several issues during this process, which are detailed below. Modifying the Pass 1. Adding Diagnostic Dumps :    - I attempted to modify the pass to include diagnostic dumps to demonstrate its execution.    - Example code snippet:      ```cpp      if (dump_file)        {          fprintf (dump_file, "===== Dummy Pass Diagnostic Dump =====\n");        }      ``` 2. Iterating Through Code Being Compiled :    - I updat...

Project Stage 2: Clone-Pruning Analysis Pass

  Project Stage 2 Goal In Stage 2 of my project, the goal was to create a pass for the GCC compiler that would analyze the program and identify cloned functions. It would then compare these cloned functions to check if they are very similar, and decide whether they should be removed (pruned) or kept. The decision would be shown in the GCC diagnostic dump as either "PRUNE" or "NOPRUNE." Step 1: Creating the Dummy Pass I started by creating a simple dummy pass that would only output basic messages. This was to make sure everything was working properly before I added more complex logic. Step 2: Iterating Through the Program Code Once the dummy pass was working, I moved on to the next step. This involved writing logic to go through the functions in the program being compiled. GCC uses an intermediate representation called GIMPLE, and I used this to read through and prepare the functions for the next steps. Step 3: Identifying Cloned Functions In this step, I added the l...

Project Stage 1- GCC Build & Dump on AArch64

Image
  Goal  The primary objective of my project is to develop a working proof-of-concept prototype for the function-pruning component of Automatic Function Multi-Versioning (AFMV) within the GNU Compiler Collection (GCC) specifically designed for AArch64 systems. This initiative aims to build upon existing functionalities and enhance the efficiency of the compiler. A significant aspect of this project is to familiarize myself with the process of building GCC on AArch64 architecture. By engaging in this project on the aarch64-002 server, I hope to gain hands-on experience and become comfortable with the intricacies involved in the build process. Understanding the steps required to successfully compile and configure GCC on this platform will provide me with invaluable insights into compiler development and operation. I have followed the project instructions outlined in SPO600 2024 Fall Project to guide my work. Steps to Build GCC 1.  Clone the GCC Repository:  Firstly, I...

SPO600 LAB 1

Image
6502 Assembly Language Lab Hello! My name is Harleen Singh, and this post is about my experiments with 6502 assembly language as part of the SPO600 course.  Bitmap Code The first task was to run the following code to fill the display with yellow using the 6502 processor: Here is the code which was given to us in Lab 1 instructions. lda #$00 ; set a pointer in memory location $40 to point to $0200 sta $40 ; ... low byte ($00) goes in address $40 lda #$02 sta $41 ; ... high byte ($02) goes into address $41 lda #$07 ; colour number ldy #$00 ; set index to 0 loop: sta ($40),y ; set pixel colour at the address (pointer)+Y iny ; increment index bne loop ; continue until done the page (256 pixels) inc $41 ; increment the page ldx $41 ; get the current page number cpx #$06 ; compare with 6 bne loop ; continue until done all pages Calculating Performance To calculate the execution time for my code running on a 1 MHz clock, I broke it down into two parts: the inn...