Skip to content

atayozcan/PixelCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixel Compiler

A simplified compiler for the Pixel image processing DSL, built with MLIR.

What It Does

Compiles .px scripts that process BMP images using operations like:

  • invert - Inverts colors
  • grayscale - Converts to grayscale
  • rotate - Rotates image by specified degrees

Building

./build.sh

Or manually:

mkdir build && cd build
cmake ..
make -j4

Usage

./compile.sh script.px

That's it! The compiler automatically:

  1. Parses your .px file
  2. Generates high-level MLIR (Pixel dialect)
  3. Lowers to LLVM dialect MLIR
  4. Generates LLVM IR
  5. Compiles to executable

Output Files

  • output_high_level.mlir - High-level Pixel dialect
  • output_low_level.mlir - Low-level LLVM dialect
  • output.ll - LLVM IR
  • pixel_program - Ready-to-run executable

Run the generated program:

./pixel_program

Example Script

# script.px
image img1 "input" -> "output" as bmp

operations img1:
  invert
  grayscale
  rotate 90

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors