Don't mean to argue in my second post on forum but there is a S38 engine that came in the i believe e28 or e34 m5's. Zimmie you were right the first time man.
M5 S38 6 cylinder 315 HP 250 km/h 1988 - 1992
M5 S38 6 cylinder 340 HP 250 km/h 1992 - 1995