Scrub clams under cold running water to remove grit and sand. Discard any that don't close when tapped. Place clams in a large pot with 3 cups cold water. Cover, bring to a boil over medium-high heat, and steam until shells open; check frequently and remove clams with tongs as they open, allowing up to 5 minutes for littlenecks and about 1 minute for steamers. Discard any that don't open. Pour cooking liquid through a fine sieve and set aside.
Cook salt pork in a large pot over medium-low heat until crisp, about 20 minutes. Remove meat, drain on paper towels, and set aside to use as garnish. Add onions to rendered fat and cook over low heat until translucent, about 20 minutes.
Remove clams from shells. If using steamers, cut off and discard necks (the black part). Coarsely chop clams, cover, and set aside.
Add flour to onions, stir for 1 minute, then add potatoes, reserved clam cooking liquid, and enough water to cover. Increase heat to medium, cover, and simmer until potatoes are tender, about 20 minutes.
Add clams, milk, and cream to pot. Simmer (do not boil) until just heated through, about 5 minutes. (Clams will be rubbery if overcooked.) Stir in butter and season to taste with salt and pepper. Ladle into bowls and top with reserved salt pork.