  We investigate mass-dependent galaxy evolution based on a large sample of
(more than 50,000) K-band selected galaxies in a multi-wavelength catalog of
the Subaru/XMM-Newton Deep Survey (SXDS) and the UKIRT Infrared Deep Sky Survey
(UKIDSS)/Ultra Deep Survey (UDS). We employ the optical to near-infrared
photometry to determine photometric redshifts of these galaxies. Then, we
estimate the stellar mass of our sample galaxies using a standard fitting
procedure. From the sample galaxies, we obtain the stellar mass function of
galaxies and the cosmic stellar mass density up to z<4. Our results are
consistent with previous studies and we find a considerable number of low-mass
galaxies (M<10^{10.5}) at the redshift range 3<z<4. The stellar-mass dependent
correlation functions of our sample galaxies show clear evolution and they
connect to that in the local universe consistently. Also, the massive galaxies
show strong clustering throughout our studied redshift range. The correlation
length of massive galaxies rapidly decreases from z=4 to 2. We also find some
high mass density regions of massive galaxies at 1.4<z<2.5 in our sample, which
may be candidate progenitors of the present-day clusters of galaxies. At this
redshift range, massive star-forming galaxies are the dominant population
making up the structures and the passively evolving galaxies show stronger
clustering and they may have formed earlier than those star-forming galaxies.
