Blog
-
Stage 3: Improving Clone Detection
Introduction At this point in the project, I managed to develop a GCC GIMPLE pass that analyzes the code for function clones (based on their base name), analyzes if the clones are significantly similar, and outputs a diagnostic dump. This clone analysis is done thanks to a function signature that gets generated, and compared. Currently,…
-
Stage 2.3: Comparing Clones
Introduction Now that my pass correctly identifies clones by comparing base names (Stage 2.2), it’s time to implement logic to see if the clones are significantly the same. To check if the functions are the same, I will have to implement strong logic to compare the functions based on significant logic (ignoring inconsistant, or unimportant…
-
Stage 2.2: Identifying Clones
Introduction After implementing a basic dummy pass in Stage 1, and exploring the different concepts that will be involved in Stage 2, it’s time to experiment with the pass. This post will tackle accomplishing the first requirement, identifying function clones. The goal: Identify function clones, by comparing base names. Understanding the Flow Looking at the…
-
Stage 2.1: Requirement Analysis, FMV
Introduction Stage 2 of this project, will introduce some new concepts and goals. Previously, I created a dummy gcc pass, that simply counts and outputs the number of functions, Basic Blocks (BB), and GIMPLE statements in the code. This pass doesn’t perform any optimizations, or even significant observations, or assortations about the code – it…
-
Stage 1.2: Improving the Custom GCC Pass
Introduction In my previous post, I described how I got started contributing to gcc, by creating a new pass and adding it to the pass manager. The goal of this blog post, it to improve the newly-created dummy pass, to satisfy the following requirements: So far, requirements #1 & 2 are complete – the dummy…
-
Stage 1.1: Creating a Custom GCC Pass
Introduction This is Stage 1 of the project, where I will be working on creating compiler optimizations for gcc. The purpose of this stage, is to practice with creating GCC Passes. GCC Pass GCC is a multi-stage compiler which translates high-level source code, into machine code. The process of compilation has many stages, which can…
-
GCC Compiler – Building the Source Code
As part of the Software Portability & Optimization course, we will learn how to contribute and write compiler optimizations in the form of passes. For this lab, I will simply install and build the source code, on two different machines x86 & aarch64. Building the GCC Source Code Installing the Source from Official GCC git…
-
6502 Maze Game
Introduction After learning a lot about assembly, getting familiar with the instructions for the 6502 8bit processor, and experimenting with different exercises – it is time to create something of my own. For this lab, I chose to create a maze game. The process of figuring out how to make everything work, in the little…
-
6502 Math & Bouncing Graphic
Introduction Previously, I got to experiment with analyzing and modifying assembly code for the 6502 processor, and learned about common instructions, and what they do. Now, it is time to experiment with more complex logic, flow and mathematical operations. I was provided with an implementation of a subroutine DRAW, which draws a certain 5×5 image…
-
6502 Assembly Code – Experiments
Experimenting with 6502 assembly code, coloring the bitmap display. Logical Shift Right, Arithmetic Shift Left, and more….. Introduction After analysis, optimization, modifications…. It is time to experiment with some new instructions, learn new instructions and understand what shifts are, and how they affect the program! Experiment 1: tya instruction What does adding the tya instruction…