[FastISel][X86] Refactor the code to get the X86 condition from a helper function. NFC.

Make use of helper functions to simplify the branch and compare instruction
selection in FastISel. Also add test cases for compare and conditonal branch.