1 //===------------- divmodqi4.S - sint8 div & mod --------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // https://gcc.gnu.org/wiki/avr-gcc#Exceptions_to_the_Calling_Convention, the
11 // prototype is `struct {sint8, sint8} __divmodqi4(sint8, sint8)`.
12 // The sint8 quotient is returned via R24, and the sint8 remainder is returned
13 // via R25, while registers R23/Rtmp and bit T in SREG are clobbered.
15 //===----------------------------------------------------------------------===//
27 .type __divmodqi4, @function
37 rcall __udivmodqi4 ; Call __udivmodqi4 to do real calculation.
44 ret ; Return quotient via R24 and remainder via R25.