• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16.macro PUSH_GENERAL_REGS
17    pushq %r9
18    pushq %r8
19    pushq %rcx
20    pushq %rdx
21    pushq %rsi
22    pushq %rdi
23.endm
24
25.macro POP_GENERAL_REGS
26    popq %rdi
27    popq %rsi
28    popq %rdx
29    popq %rcx
30    popq %r8
31    popq %r9
32.endm
33
34.macro RELOAD_GENERAL_REGS
35    movq 0(%rsp), %rdi
36    movq 8(%rsp), %rsi
37    movq 16(%rsp), %rdx
38    movq 24(%rsp), %rcx
39    movq 32(%rsp), %r8
40    movq 40(%rsp), %r9
41.endm
42
43.macro PUSH_FP_REGS
44    subq $64, %rsp
45    movsd %xmm0, (%rsp)
46    movsd %xmm1, 8(%rsp)
47    movsd %xmm2, 16(%rsp)
48    movsd %xmm3, 24(%rsp)
49    movsd %xmm4, 32(%rsp)
50    movsd %xmm5, 40(%rsp)
51    movsd %xmm6, 48(%rsp)
52    movsd %xmm7, 56(%rsp)
53.endm
54
55.macro POP_FP_REGS
56    movsd (%rsp), %xmm0
57    movsd 8(%rsp), %xmm1
58    movsd 16(%rsp), %xmm2
59    movsd 24(%rsp), %xmm3
60    movsd 32(%rsp), %xmm4
61    movsd 40(%rsp), %xmm5
62    movsd 48(%rsp), %xmm6
63    movsd 56(%rsp), %xmm7
64    addq $64, %rsp
65.endm
66