• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2021-2022 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 PUSH_FP_REGS
35    subq $64, %rsp
36    movsd %xmm0, (%rsp)
37    movsd %xmm1, 8(%rsp)
38    movsd %xmm2, 16(%rsp)
39    movsd %xmm3, 24(%rsp)
40    movsd %xmm4, 32(%rsp)
41    movsd %xmm5, 40(%rsp)
42    movsd %xmm6, 48(%rsp)
43    movsd %xmm7, 56(%rsp)
44.endm
45
46.macro POP_FP_REGS
47    movsd (%rsp), %xmm0
48    movsd 8(%rsp), %xmm1
49    movsd 16(%rsp), %xmm2
50    movsd 24(%rsp), %xmm3
51    movsd 32(%rsp), %xmm4
52    movsd 40(%rsp), %xmm5
53    movsd 48(%rsp), %xmm6
54    movsd 56(%rsp), %xmm7
55    addq $64, %rsp
56.endm
57