Character sums and intersection cohomology complexes associated to the space of square matrices