Retirement tax questions

Is the $3000 max deduction for investment losses per year directly off of the tax you owe or is it $3000 deducted off of your gross income?