First user login function: Security and efficency opinions
Hashing

Let's start with the correct solution for hashing passwords: use bcrypt; PHP offers it with password_hash.

It's secure, and it's really easy to use (it's just a simple function call, and it manages salts etc for you).

What is wrong with your approach: 


simple sha512 is way too fast; it's still better than plaintext, but it's really not the correct approach.
you don't have a per-user salt.
you don't even have a per-site salt. pass_salt doesn't serve any purpose, the check will always match as you are using it wrong and are thus still open to rainbow attacks etc (it should be something like $password = hash('SHA512', $password . $salt);, but again, site-salts are not enough).


Misc


your comment talks about encryption, but you are never encrypting, only hashing.
putting spaces around -&gt; is unusual and leads to harder to read code.
don't die in functions, it makes it impossible for the calling code to recover. Just throw an exception.
pass the connection to the function instead of including it to make your function easier to reuse and test.


Apart from these minor issues and the very weak hashing, your code looks good to me.