blob: ddb25873e486143b98c6f412189547de3c29fbf8 [file] [log] [blame]
sewardjf0c12502014-01-12 12:54:00 +00001
sewardj383d5d32014-01-13 11:50:17 +00002Status
3~~~~~~
sewardjf0c12502014-01-12 12:54:00 +00004
sewardj383d5d32014-01-13 11:50:17 +00005As of Jan 2014 the trunk contains a port to AArch64 ARMv8 -- loosely,
6the 64-bit ARM architecture. Currently it supports integer and FP
sewardjfc073c32014-01-15 14:30:24 +00007instructions and can run almost anything generated by gcc-4.8.2 -O2.
sewardj383d5d32014-01-13 11:50:17 +00008The port is under active development.
sewardjf0c12502014-01-12 12:54:00 +00009
sewardj383d5d32014-01-13 11:50:17 +000010Current limitations, as of mid-Jan 2014.
sewardjf0c12502014-01-12 12:54:00 +000011
sewardj383d5d32014-01-13 11:50:17 +000012* threaded apps won't work, due to inadequate sys_clone() support.
13
14* almost no support of vector (SIMD) instructions
15
16* Integration with the built in GDB server doesn't work yet.
17
18There has been extensive testing of the baseline simulation of integer
19and FP instructions. Memcheck is also believed to work, at least for
20small examples. Other tools appear to at least not crash when running
21/bin/date.
22
23
24Building
25~~~~~~~~
26
27You could probably build it directly on a target OS, using the normal
28non-cross scheme
29
30 ./autogen.sh ; ./configure --prefix=.. ; make ; make install
31
32Development so far was however done by cross compiling, viz:
33
34 export CC=aarch64-linux-gnu-gcc
35 export LD=aarch64-linux-gnu-ld
36 export AR=aarch64-linux-gnu-ar
37
38 ./autogen.sh
39 ./configure --prefix=`pwd`/Inst --host=aarch64-unknown-linux \
40 --enable-only64bit
41 make -j4
42 make -j4 install
43
44Doing this assumes that the install path (`pwd`/Inst) is valid on
45both host and target, which isn't normally the case. To avoid
46this limitation, do instead:
47
48 ./configure --prefix=/install/path/on/target \
49 --host=aarch64-unknown-linux \
50 --enable-only64bit
51 make -j4
52 make -j4 install DESTDIR=/a/temp/dir/on/host
53 # and then copy the contents of DESTDIR to the target.
54
55See README.android for more examples of cross-compile building.
56
57
58Implementation tidying-up/TODO notes
59~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjf0c12502014-01-12 12:54:00 +000060
61UnwindStartRegs -- what should that contain?
62
63
sewardjf0c12502014-01-12 12:54:00 +000064vki-arm64-linux.h: vki_sigaction_base
sewardjf0c12502014-01-12 12:54:00 +000065I really don't think that __vki_sigrestore_t sa_restorer
66should be present. Adding it surely puts sa_mask at a wrong
67offset compared to (kernel) reality. But not having it causes
68compilation of m_signals.c to fail in hard to understand ways,
69so adding it temporarily.
70
71
72m_trampoline.S: what's the unexecutable-insn value? 0xFFFFFFFF
73is there at the moment, but 0x00000000 is probably what it should be.
74Also, fix indentation/tab-vs-space stuff
75
76
77./include/vki/vki-arm64-linux.h: uses __uint128_t. Should change
78it to __vki_uint128_t, but what's the defn of that?
79
80
sewardjf0c12502014-01-12 12:54:00 +000081m_debuginfo/priv_storage.h: need proper defn of DiCfSI
82
83
84readdwarf.c: is this correct?
85#elif defined(VGP_arm64_linux)
86# define FP_REG 29 //???
87# define SP_REG 31 //???
88# define RA_REG_DEFAULT 30 //???
89
90
91vki-arm64-linux.h:
92re linux-3.10.5/include/uapi/asm-generic/sembuf.h
93I'd say the amd64 version has padding it shouldn't have. Check?
94
95
sewardjf0c12502014-01-12 12:54:00 +000096syswrap-linux.c run_a_thread_NORETURN assembly sections
97seems like tst->os_state.exitcode has word type
98in which case the ppc64_linux use of lwz to read it, is wrong
99
100
sewardjf0c12502014-01-12 12:54:00 +0000101syswrap-linux.c ML_(do_fork_clone)
102assuming that VGP_arm64_linux is the same as VGP_arm_linux here
103
104
sewardjf0c12502014-01-12 12:54:00 +0000105dispatch-arm64-linux.S: FIXME: set up FP control state before
106entering generated code. Also fix screwy indentation.
107
sewardj383d5d32014-01-13 11:50:17 +0000108
sewardjf0c12502014-01-12 12:54:00 +0000109dispatcher-ery general: what's a good (predictor-friendly) way to
110branch to a register?
111
112
sewardjf0c12502014-01-12 12:54:00 +0000113in vki-arm64-scnums.h
114//#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
115Probably want to reenable that and clean up accordingly
116
117
sewardjf0c12502014-01-12 12:54:00 +0000118putIRegXXorZR: figure out a way that the computed value is actually
119used, so as to keep any memory reads that might generate it, alive.
120(else the simulation can lose exceptions). At least, for writes to
121the zero register generated by loads .. or .. can anything other
122integer instructions, that write to a register, cause exceptions?
123
124
sewardjf0c12502014-01-12 12:54:00 +0000125loads/stores: generate stack alignment checks as necessary
126
127
sewardjf0c12502014-01-12 12:54:00 +0000128fix barrier insns: ISB, DMB
129
130
sewardjf0c12502014-01-12 12:54:00 +0000131fix atomic loads/stores
132
133
sewardjf0c12502014-01-12 12:54:00 +0000134FMADD/FMSUB/FNMADD/FNMSUB: generate and use the relevant fused
135IROps so as to avoid double rounding
136
137
sewardjf0c12502014-01-12 12:54:00 +0000138ARM64Instr_Call getRegUsage: re-check relative to what
139getAllocableRegs_ARM64 makes available
140
141
sewardjf0c12502014-01-12 12:54:00 +0000142Make dispatch-arm64-linux.S save any callee-saved Q regs
143I think what is required is to save D8-D15 and nothing more than that.
144
145
sewardjf0c12502014-01-12 12:54:00 +0000146wrapper for __NR3264_fstat -- correct?
147
148
sewardj383d5d32014-01-13 11:50:17 +0000149PRE(sys_clone): get rid of references to vki_modify_ldt_t and the
150definition of it in vki-arm64-linux.h. Ditto for 32 bit arm.
sewardjf0c12502014-01-12 12:54:00 +0000151
152
153sigframe-arm64-linux.c: build_sigframe: references to nonexistent
154siguc->uc_mcontext.trap_no, siguc->uc_mcontext.error_code have been
155replaced by zero. Also in synth_ucontext.
156
157
sewardjf0c12502014-01-12 12:54:00 +0000158m_debugger.c:
159uregs.pstate = LibVEX_GuestARM64_get_nzcv(vex); /* is this correct? */
160Is that remotely correct?
161
162
sewardjf0c12502014-01-12 12:54:00 +0000163host_arm64_defs.c: emit_ARM64INstr:
164ARM64in_VDfromX and ARM64in_VQfromXX: use simple top-half zeroing
165MOVs to vector registers instead of INS Vd.D[0], Xreg, to avoid false
166dependencies on the top half of the register. (Or at least check
sewardj383d5d32014-01-13 11:50:17 +0000167the semantics of INS Vd.D[0] to see if it zeroes out the top.)
sewardjf0c12502014-01-12 12:54:00 +0000168
169
170preferredVectorSubTypeFromSize: review perf effects and decide
171on a types-for-subparts policy
172
173
sewardjf0c12502014-01-12 12:54:00 +0000174fold_IRExpr_Unop: add a reduction rule for this
1751Sto64(CmpNEZ64( Or64(GET:I64(1192),GET:I64(1184)) ))
176vis 1Sto64(CmpNEZ64(x)) --> CmpwNEZ64(x)
177
178
sewardjf0c12502014-01-12 12:54:00 +0000179check insn selection for memcheck-only primops:
180Left64 CmpwNEZ64 V128to64 V128HIto64 1Sto64 CmpNEZ64 CmpNEZ32
181widen_z_8_to_64 1Sto32 Left32 32HLto64 CmpwNEZ32 CmpNEZ8
182
183
sewardjf0c12502014-01-12 12:54:00 +0000184isel: get rid of various cases where zero is put into a register
185and just use xzr instead. Especially for CmpNEZ64/32. And for
186writing zeroes into the CC thunk fields.
187
188
sewardjf0c12502014-01-12 12:54:00 +0000189/* Keep this list in sync with that in iselNext below */
190/* Keep this list in sync with that for Ist_Exit above */
191uh .. they are not in sync
192
193
sewardjf0c12502014-01-12 12:54:00 +0000194very stupid:
195imm64 x23, 0xFFFFFFFFFFFFFFA0
19617 F4 9F D2 F7 FF BF F2 F7 FF DF F2 F7 FF FF F2
197
198
sewardjf0c12502014-01-12 12:54:00 +0000199valgrind.h: fix VALGRIND_ALIGN_STACK/VALGRIND_RESTORE_STACK,
200also add CFI annotations
sewardjfdaf9e42014-01-13 00:18:51 +0000201
202
sewardjfdaf9e42014-01-13 00:18:51 +0000203could possibly bring r29 into use, which be useful as it is
204callee saved
sewardj383d5d32014-01-13 11:50:17 +0000205
206
207ubfm/sbfm etc: special case cases that are simple shifts, as iropt
208can't always simplify the general-case IR to a shift in such cases.
sewardj1cd6c902014-02-05 11:02:34 +0000209
210
211LDP,STP (immediate, simm7) (FP&VEC)
212should zero out hi parts of dst registers in the LDP case
213
214
215DUP insns: use Iop_Dup8x16, Iop_Dup16x8, Iop_Dup32x4
216rather than doing it "by hand"
217
218
219Any place where ZeroHI64ofV128 is used in conjunction with
220FP vector IROps: find a way to make sure that arithmetic on
221the upper half of the values is "harmless."
222
223
224math_MINMAXV: use real Iop_Cat{Odd,Even}Lanes ops rather than
225inline scalar code