Many jurisdictions have laws against carrying blades longer than X (it varies) and any reasonable definition of a sword would fall under that category.
In the US at least automatic weapons are nominally legal at the federal level after hefty tax stamps and background checks but states / local jurisdictions can and do regulate more / outright ban them.
That's just moving the goalposts. Nothing in there says it's illegal to own any of those things. You just might not be able to carry a sword (there are carve outs for reenactments in most places btw) and you might have to move or pay more for automatic weapons.