So it's a gerund if you call it a gerund but it isn't if you don't? How many legs does a horse have if you call the tail a leg?

And, does the gerund -ing ending have the same origin as the present progressive -ing ending?