http://www.englisch-hilfen.de/en/grammar/if_type3.htm

Use

It is impossible to fulfil a condition which is given in the if-clause.

Form

if clause main clause
Past Perfect would + have + past participle 
or
could + have + past participle 
or
might + have + past participle

Examples

If I had studied, I would have passed the exams.
If I had studied, I could have passed the exams.
If I had studied, I might have passed the exams.

The if-clause can be at the beginning or at the end of the sentence.

If I had studied, I would have passed the exams.
I would have passed the exams if I had studied.