I've been running per-gear boost control on my WRX for a few years now, since Eric Minehart pioneered the definition of those tables. Everything you need to know is here:
http://www.romraider.com/forum/viewt...hp?f=25&t=7048
The ECU calculates gear position from engine rpm and vehicle speed via a 2D table of thresholds.