My race day warm up for a standard XC race is very basic, and is adjusted to the length and importance of my race. The shorter the race, the longer the warm up.
For an important race, I will be in the saddle a minimum of 1 hr before start. I have 3 segments to the warm up. Loosen up, tempo and intensity. First, I'll roll around a bit to loosen up. Then bring it up to tempo for atleast 15 minutes. Finally, I will find an uphill and force my heartrate above 150. Repeat that 3 times, the last time holding a bit longer. Keep rolling as much as possible until the start.
This can be difficult at certain races because of availability terrain. The trainer probably would work more accurately, but I HATE trainers, and would rather get out on the trails and find a real hill.
As far as regular rides, I try to generally treat my body the same way.