depends
a long cage (shimano or sram) should cover any chainring/casette combo
some mediums might cover certain (closer) chainring/casette combos
eg 42-32-22 with a 12-27T casette
check the tooth capacity of the rear mech. An slx GS 9spd is 35T iirc, whereas an XT 9spd GS is only 33T (not max casette sprocket, difference between small-small and big-big combo)
Not sure about sram
if you never want to use ‘wrong’ combinations like big ring-big sprocket and small ring-small sprocket and set the chain length to suit, then you could use a mech with a smaller tooth capactity
At one point (2008) Specialized were selling at least the ‘WSD’ Stumpjumper FSR with 44-32-22/11-34T chainring/casettes with medium cage (Sram) rear mechs. (website lists so too). So small-small combos meant the mech wasn’t taking the slack