Implemented #6980: extended pad to support padl

If desired length is negative, the padding takes place to the left of the input