Tax implications for moving IRA money with pre-tax and post-tax contribution

I have an IRA account that has pre-tax as well as post-tax contributions. I was thinking of consolidating and rolling my pre-tax IRA amount into my current 401k and the post-tax into the Roth IRA. Does the IRS allow such a thing?

 

P.S. Turbotax generated a Form 8606 for me last year, which doesn't look at each transaction but just net annual movements.