The present invention relates to pharmaceutical compositions of the poorly soluble drugs, and pharmaceutically acceptable salts thereof, in a controlled-release gastric retained oral dosage form. Such compositions are formulated so as to deliver the majority of the incorporated drug into the stomach and upper gastrointestinal tract, with restricted drug delivery in the lower gastrointestinal tract. The dosage forms have multiple layers including an active layer with a first swellable polymer with raltegravir incorporated therein and a non-active layer with a second swellable polymer having a similar molecular weight or a higher molecular weight as the swellable polymer in the active layer.