The Supreme Court did uphold a patent on a software-controlled rubber-curing machine in 1981, but its ruling emphasized that this was because the patent covered a physical machine that happened to have a software component, rather than claiming a software technique by itself.
FORBES: As Supreme Court Software Patent Ban Turns 40, It's Time To Stop Ignoring It