29184
|
1 |
dnl Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
|
2 |
dnl DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
dnl
|
|
4 |
dnl This code is free software; you can redistribute it and/or modify it
|
|
5 |
dnl under the terms of the GNU General Public License version 2 only, as
|
|
6 |
dnl published by the Free Software Foundation.
|
|
7 |
dnl
|
|
8 |
dnl This code is distributed in the hope that it will be useful, but WITHOUT
|
|
9 |
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10 |
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
11 |
dnl version 2 for more details (a copy is included in the LICENSE file that
|
|
12 |
dnl accompanied this code).
|
|
13 |
dnl
|
|
14 |
dnl You should have received a copy of the GNU General Public License version
|
|
15 |
dnl 2 along with this work; if not, write to the Free Software Foundation,
|
|
16 |
dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
17 |
dnl
|
|
18 |
dnl Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
19 |
dnl or visit www.oracle.com if you need additional information or have any
|
|
20 |
dnl questions.
|
|
21 |
dnl
|
|
22 |
dnl
|
|
23 |
dnl Process this file with m4 ad_encode.m4 to generate the load/store
|
|
24 |
dnl patterns used in aarch64.ad.
|
|
25 |
dnl
|
|
26 |
define(choose, `loadStore($1, &MacroAssembler::$3, $2, $4,
|
|
27 |
$5, $6, $7, $8);dnl
|
|
28 |
|
|
29 |
%}')dnl
|
|
30 |
define(access, `
|
|
31 |
$3Register $1_reg = as_$3Register($$1$$reg);
|
|
32 |
$4choose(MacroAssembler(&cbuf), $1_reg,$2,$mem->opcode(),
|
|
33 |
as_Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp)')dnl
|
|
34 |
define(load,`
|
|
35 |
enc_class aarch64_enc_$2($1 dst, memory mem) %{dnl
|
|
36 |
access(dst,$2,$3)')dnl
|
|
37 |
load(iRegI,ldrsbw)
|
|
38 |
load(iRegI,ldrsb)
|
|
39 |
load(iRegI,ldrb)
|
|
40 |
load(iRegL,ldrb)
|
|
41 |
load(iRegI,ldrshw)
|
|
42 |
load(iRegI,ldrsh)
|
|
43 |
load(iRegI,ldrh)
|
|
44 |
load(iRegL,ldrh)
|
|
45 |
load(iRegI,ldrw)
|
|
46 |
load(iRegL,ldrw)
|
|
47 |
load(iRegL,ldrsw)
|
|
48 |
load(iRegL,ldr)
|
|
49 |
load(vRegF,ldrs,Float)
|
|
50 |
load(vRegD,ldrd,Float)
|
|
51 |
define(STORE,`
|
|
52 |
enc_class aarch64_enc_$2($1 src, memory mem) %{dnl
|
|
53 |
access(src,$2,$3,$4)')dnl
|
|
54 |
define(STORE0,`
|
|
55 |
enc_class aarch64_enc_$2`'0(memory mem) %{
|
|
56 |
MacroAssembler _masm(&cbuf);
|
|
57 |
choose(_masm,zr,$2,$mem->opcode(),
|
|
58 |
as_$3Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp)')dnl
|
|
59 |
STORE(iRegI,strb)
|
|
60 |
STORE0(iRegI,strb)
|
|
61 |
STORE(iRegI,strh)
|
|
62 |
STORE0(iRegI,strh)
|
|
63 |
STORE(iRegI,strw)
|
|
64 |
STORE0(iRegI,strw)
|
|
65 |
STORE(iRegL,str,,
|
|
66 |
`// we sometimes get asked to store the stack pointer into the
|
|
67 |
// current thread -- we cannot do that directly on AArch64
|
|
68 |
if (src_reg == r31_sp) {
|
|
69 |
MacroAssembler _masm(&cbuf);
|
|
70 |
assert(as_Register($mem$$base) == rthread, "unexpected store for sp");
|
|
71 |
__ mov(rscratch2, sp);
|
|
72 |
src_reg = rscratch2;
|
|
73 |
}
|
|
74 |
')
|
|
75 |
STORE0(iRegL,str)
|
|
76 |
STORE(vRegF,strs,Float)
|
|
77 |
STORE(vRegD,strd,Float)
|
|
78 |
|
|
79 |
enc_class aarch64_enc_strw_immn(immN src, memory mem) %{
|
|
80 |
MacroAssembler _masm(&cbuf);
|
|
81 |
address con = (address)$src$$constant;
|
|
82 |
// need to do this the hard way until we can manage relocs
|
|
83 |
// for 32 bit constants
|
|
84 |
__ movoop(rscratch2, (jobject)con);
|
|
85 |
if (con) __ encode_heap_oop_not_null(rscratch2);
|
|
86 |
choose(_masm,rscratch2,strw,$mem->opcode(),
|
|
87 |
as_Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp)
|
|
88 |
|
|
89 |
enc_class aarch64_enc_strw_immnk(immN src, memory mem) %{
|
|
90 |
MacroAssembler _masm(&cbuf);
|
|
91 |
address con = (address)$src$$constant;
|
|
92 |
// need to do this the hard way until we can manage relocs
|
|
93 |
// for 32 bit constants
|
|
94 |
__ movoop(rscratch2, (jobject)con);
|
|
95 |
__ encode_klass_not_null(rscratch2);
|
|
96 |
choose(_masm,rscratch2,strw,$mem->opcode(),
|
|
97 |
as_Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp)
|
|
98 |
|