Concentration-pressure isotherms were measured together with the optical transmission in polycrystalline Gd and GdMg thin-film switchable mirrors. Formation plateaus in GdMg alloys, corresponding to gadolinium dihydride and trihydride as well as magnesium dihydride have been found. From these, the formation enthalpies could be calculated. These results show that the GdMg alloys are phase separated. From the onset of the transmission we conclude that the formation of gadolinium trihydride is the final stage in the switching process. (C) 2002 American Institute of Physics.