Deleted Added
full compact
xray_trampoline_mips.S (341825) xray_trampoline_mips.S (353358)
1//===-- xray_trampoline_mips.s ----------------------------------*- ASM -*-===//
2//
1//===-- xray_trampoline_mips.s ----------------------------------*- ASM -*-===//
2//
3// The LLVM Compiler Infrastructure
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
4//
6//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of XRay, a dynamic runtime instrumentation system.
11//
12// This implements the MIPS-specific assembler for the trampolines.
13//
14//===----------------------------------------------------------------------===//
15
16 .text
17 .file "xray_trampoline_mips.S"
18 .globl __xray_FunctionEntry
19 .p2align 2
20 .type __xray_FunctionEntry,@function
21__xray_FunctionEntry:
22 .cfi_startproc
23 .set noreorder
24 .cpload $t9
25 .set reorder
26 // Save argument registers before doing any actual work
27 .cfi_def_cfa_offset 36
28 addiu $sp, $sp, -36
29 sw $ra, 32($sp)
30 .cfi_offset 31, -4
31 sw $a3, 28($sp)
32 sw $a2, 24($sp)
33 sw $a1, 20($sp)
34 sw $a0, 16($sp)
35 sdc1 $f14, 8($sp)
36 sdc1 $f12, 0($sp)
37
38 la $t9, _ZN6__xray19XRayPatchedFunctionE
39 lw $t9, 0($t9)
40
41 beqz $t9, FunctionEntry_restore
42
43 // a1=0 means that we are tracing an entry event
44 move $a1, $zero
45 // Function ID is in t0 (the first parameter).
46 move $a0, $t0
47 jalr $t9
48
49FunctionEntry_restore:
50 // Restore argument registers
51 ldc1 $f12, 0($sp)
52 ldc1 $f14, 8($sp)
53 lw $a0, 16($sp)
54 lw $a1, 20($sp)
55 lw $a2, 24($sp)
56 lw $a3, 28($sp)
57 lw $ra, 32($sp)
58 addiu $sp, $sp, 36
59 jr $ra
60FunctionEntry_end:
61 .size __xray_FunctionEntry, FunctionEntry_end-__xray_FunctionEntry
62 .cfi_endproc
63
64 .text
65 .globl __xray_FunctionExit
66 .p2align 2
67 .type __xray_FunctionExit,@function
68__xray_FunctionExit:
69 .cfi_startproc
70 .set noreorder
71 .cpload $t9
72 .set reorder
73 // Save return registers before doing any actual work.
74 .cfi_def_cfa_offset 36
75 addiu $sp, $sp, -36
76 sw $ra, 32($sp)
77 .cfi_offset 31, -4
78 sw $a1, 28($sp)
79 sw $a0, 24($sp)
80 sw $v1, 20($sp)
81 sw $v0, 16($sp)
82 sdc1 $f2, 8($sp)
83 sdc1 $f0, 0($sp)
84
85 la $t9, _ZN6__xray19XRayPatchedFunctionE
86 lw $t9, 0($t9)
87
88 beqz $t9, FunctionExit_restore
89
90 // a1=1 means that we are tracing an exit event
91 li $a1, 1
92 // Function ID is in t0 (the first parameter).
93 move $a0, $t0
94 jalr $t9
95
96FunctionExit_restore:
97 // Restore return registers
98 ldc1 $f0, 0($sp)
99 ldc1 $f2, 8($sp)
100 lw $v0, 16($sp)
101 lw $v1, 20($sp)
102 lw $a0, 24($sp)
103 lw $a1, 28($sp)
104 lw $ra, 32($sp)
105 addiu $sp, $sp, 36
106 jr $ra
107
108FunctionExit_end:
109 .size __xray_FunctionExit, FunctionExit_end-__xray_FunctionExit
110 .cfi_endproc
7//===----------------------------------------------------------------------===//
8//
9// This file is a part of XRay, a dynamic runtime instrumentation system.
10//
11// This implements the MIPS-specific assembler for the trampolines.
12//
13//===----------------------------------------------------------------------===//
14
15 .text
16 .file "xray_trampoline_mips.S"
17 .globl __xray_FunctionEntry
18 .p2align 2
19 .type __xray_FunctionEntry,@function
20__xray_FunctionEntry:
21 .cfi_startproc
22 .set noreorder
23 .cpload $t9
24 .set reorder
25 // Save argument registers before doing any actual work
26 .cfi_def_cfa_offset 36
27 addiu $sp, $sp, -36
28 sw $ra, 32($sp)
29 .cfi_offset 31, -4
30 sw $a3, 28($sp)
31 sw $a2, 24($sp)
32 sw $a1, 20($sp)
33 sw $a0, 16($sp)
34 sdc1 $f14, 8($sp)
35 sdc1 $f12, 0($sp)
36
37 la $t9, _ZN6__xray19XRayPatchedFunctionE
38 lw $t9, 0($t9)
39
40 beqz $t9, FunctionEntry_restore
41
42 // a1=0 means that we are tracing an entry event
43 move $a1, $zero
44 // Function ID is in t0 (the first parameter).
45 move $a0, $t0
46 jalr $t9
47
48FunctionEntry_restore:
49 // Restore argument registers
50 ldc1 $f12, 0($sp)
51 ldc1 $f14, 8($sp)
52 lw $a0, 16($sp)
53 lw $a1, 20($sp)
54 lw $a2, 24($sp)
55 lw $a3, 28($sp)
56 lw $ra, 32($sp)
57 addiu $sp, $sp, 36
58 jr $ra
59FunctionEntry_end:
60 .size __xray_FunctionEntry, FunctionEntry_end-__xray_FunctionEntry
61 .cfi_endproc
62
63 .text
64 .globl __xray_FunctionExit
65 .p2align 2
66 .type __xray_FunctionExit,@function
67__xray_FunctionExit:
68 .cfi_startproc
69 .set noreorder
70 .cpload $t9
71 .set reorder
72 // Save return registers before doing any actual work.
73 .cfi_def_cfa_offset 36
74 addiu $sp, $sp, -36
75 sw $ra, 32($sp)
76 .cfi_offset 31, -4
77 sw $a1, 28($sp)
78 sw $a0, 24($sp)
79 sw $v1, 20($sp)
80 sw $v0, 16($sp)
81 sdc1 $f2, 8($sp)
82 sdc1 $f0, 0($sp)
83
84 la $t9, _ZN6__xray19XRayPatchedFunctionE
85 lw $t9, 0($t9)
86
87 beqz $t9, FunctionExit_restore
88
89 // a1=1 means that we are tracing an exit event
90 li $a1, 1
91 // Function ID is in t0 (the first parameter).
92 move $a0, $t0
93 jalr $t9
94
95FunctionExit_restore:
96 // Restore return registers
97 ldc1 $f0, 0($sp)
98 ldc1 $f2, 8($sp)
99 lw $v0, 16($sp)
100 lw $v1, 20($sp)
101 lw $a0, 24($sp)
102 lw $a1, 28($sp)
103 lw $ra, 32($sp)
104 addiu $sp, $sp, 36
105 jr $ra
106
107FunctionExit_end:
108 .size __xray_FunctionExit, FunctionExit_end-__xray_FunctionExit
109 .cfi_endproc