The prime minister is considering meeting a 3% defence-spending target five years earlier than planned, the BBC learns.