blob: 6f5de968d3837026390223bdc835ba00ac572204 [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
philippe3ef45eb2014-02-12 00:02:05 +000016* Integration with the built in GDB server:
17 - basically works but breakpoints are causing crashes due to missing
philippe7c2800a2014-02-12 20:48:18 +000018 unchainXDirect_ARM64 needed by LibVEX_UnChain.
19 Use --vgdb=full to bypass the problem.
philippe3ef45eb2014-02-12 00:02:05 +000020 - still to do:
philippe7c2800a2014-02-12 20:48:18 +000021 arm64 xml register description files (allowing shadow registers
22 to be looked at).
philippe3ef45eb2014-02-12 00:02:05 +000023 ptrace invoker : currently disabled for both arm and arm64
24 cpsr transfer to/from gdb to be looked at (see also arm equivalent code)
sewardj383d5d32014-01-13 11:50:17 +000025
26There has been extensive testing of the baseline simulation of integer
27and FP instructions. Memcheck is also believed to work, at least for
28small examples. Other tools appear to at least not crash when running
29/bin/date.
30
31
32Building
33~~~~~~~~
34
35You could probably build it directly on a target OS, using the normal
36non-cross scheme
37
38 ./autogen.sh ; ./configure --prefix=.. ; make ; make install
39
40Development so far was however done by cross compiling, viz:
41
42 export CC=aarch64-linux-gnu-gcc
43 export LD=aarch64-linux-gnu-ld
44 export AR=aarch64-linux-gnu-ar
45
46 ./autogen.sh
47 ./configure --prefix=`pwd`/Inst --host=aarch64-unknown-linux \
48 --enable-only64bit
49 make -j4
50 make -j4 install
51
52Doing this assumes that the install path (`pwd`/Inst) is valid on
53both host and target, which isn't normally the case. To avoid
54this limitation, do instead:
55
56 ./configure --prefix=/install/path/on/target \
57 --host=aarch64-unknown-linux \
58 --enable-only64bit
59 make -j4
60 make -j4 install DESTDIR=/a/temp/dir/on/host
61 # and then copy the contents of DESTDIR to the target.
62
63See README.android for more examples of cross-compile building.
64
65
66Implementation tidying-up/TODO notes
67~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sewardjf0c12502014-01-12 12:54:00 +000068
69UnwindStartRegs -- what should that contain?
70
71
sewardjf0c12502014-01-12 12:54:00 +000072vki-arm64-linux.h: vki_sigaction_base
sewardjf0c12502014-01-12 12:54:00 +000073I really don't think that __vki_sigrestore_t sa_restorer
74should be present. Adding it surely puts sa_mask at a wrong
75offset compared to (kernel) reality. But not having it causes
76compilation of m_signals.c to fail in hard to understand ways,
77so adding it temporarily.
78
79
80m_trampoline.S: what's the unexecutable-insn value? 0xFFFFFFFF
81is there at the moment, but 0x00000000 is probably what it should be.
82Also, fix indentation/tab-vs-space stuff
83
84
85./include/vki/vki-arm64-linux.h: uses __uint128_t. Should change
86it to __vki_uint128_t, but what's the defn of that?
87
88
sewardjf0c12502014-01-12 12:54:00 +000089m_debuginfo/priv_storage.h: need proper defn of DiCfSI
90
91
92readdwarf.c: is this correct?
93#elif defined(VGP_arm64_linux)
94# define FP_REG 29 //???
95# define SP_REG 31 //???
96# define RA_REG_DEFAULT 30 //???
97
98
99vki-arm64-linux.h:
100re linux-3.10.5/include/uapi/asm-generic/sembuf.h
101I'd say the amd64 version has padding it shouldn't have. Check?
102
103
sewardjf0c12502014-01-12 12:54:00 +0000104syswrap-linux.c run_a_thread_NORETURN assembly sections
105seems like tst->os_state.exitcode has word type
106in which case the ppc64_linux use of lwz to read it, is wrong
107
108
sewardjf0c12502014-01-12 12:54:00 +0000109syswrap-linux.c ML_(do_fork_clone)
110assuming that VGP_arm64_linux is the same as VGP_arm_linux here
111
112
sewardjf0c12502014-01-12 12:54:00 +0000113dispatch-arm64-linux.S: FIXME: set up FP control state before
114entering generated code. Also fix screwy indentation.
115
sewardj383d5d32014-01-13 11:50:17 +0000116
sewardjf0c12502014-01-12 12:54:00 +0000117dispatcher-ery general: what's a good (predictor-friendly) way to
118branch to a register?
119
120
sewardjf0c12502014-01-12 12:54:00 +0000121in vki-arm64-scnums.h
122//#if __BITS_PER_LONG == 64 && !defined(__SYSCALL_COMPAT)
123Probably want to reenable that and clean up accordingly
124
125
sewardjf0c12502014-01-12 12:54:00 +0000126putIRegXXorZR: figure out a way that the computed value is actually
127used, so as to keep any memory reads that might generate it, alive.
128(else the simulation can lose exceptions). At least, for writes to
129the zero register generated by loads .. or .. can anything other
130integer instructions, that write to a register, cause exceptions?
131
132
sewardjf0c12502014-01-12 12:54:00 +0000133loads/stores: generate stack alignment checks as necessary
134
135
sewardjf0c12502014-01-12 12:54:00 +0000136fix barrier insns: ISB, DMB
137
138
sewardjf0c12502014-01-12 12:54:00 +0000139fix atomic loads/stores
140
141
sewardjf0c12502014-01-12 12:54:00 +0000142FMADD/FMSUB/FNMADD/FNMSUB: generate and use the relevant fused
143IROps so as to avoid double rounding
144
145
sewardjf0c12502014-01-12 12:54:00 +0000146ARM64Instr_Call getRegUsage: re-check relative to what
147getAllocableRegs_ARM64 makes available
148
149
sewardjf0c12502014-01-12 12:54:00 +0000150Make dispatch-arm64-linux.S save any callee-saved Q regs
151I think what is required is to save D8-D15 and nothing more than that.
152
153
sewardjf0c12502014-01-12 12:54:00 +0000154wrapper for __NR3264_fstat -- correct?
155
156
sewardj383d5d32014-01-13 11:50:17 +0000157PRE(sys_clone): get rid of references to vki_modify_ldt_t and the
158definition of it in vki-arm64-linux.h. Ditto for 32 bit arm.
sewardjf0c12502014-01-12 12:54:00 +0000159
160
161sigframe-arm64-linux.c: build_sigframe: references to nonexistent
162siguc->uc_mcontext.trap_no, siguc->uc_mcontext.error_code have been
163replaced by zero. Also in synth_ucontext.
164
165
sewardjf0c12502014-01-12 12:54:00 +0000166m_debugger.c:
167uregs.pstate = LibVEX_GuestARM64_get_nzcv(vex); /* is this correct? */
168Is that remotely correct?
169
170
sewardjf0c12502014-01-12 12:54:00 +0000171host_arm64_defs.c: emit_ARM64INstr:
172ARM64in_VDfromX and ARM64in_VQfromXX: use simple top-half zeroing
173MOVs to vector registers instead of INS Vd.D[0], Xreg, to avoid false
174dependencies on the top half of the register. (Or at least check
sewardj383d5d32014-01-13 11:50:17 +0000175the semantics of INS Vd.D[0] to see if it zeroes out the top.)
sewardjf0c12502014-01-12 12:54:00 +0000176
177
178preferredVectorSubTypeFromSize: review perf effects and decide
179on a types-for-subparts policy
180
181
sewardjf0c12502014-01-12 12:54:00 +0000182fold_IRExpr_Unop: add a reduction rule for this
1831Sto64(CmpNEZ64( Or64(GET:I64(1192),GET:I64(1184)) ))
184vis 1Sto64(CmpNEZ64(x)) --> CmpwNEZ64(x)
185
186
sewardjf0c12502014-01-12 12:54:00 +0000187check insn selection for memcheck-only primops:
188Left64 CmpwNEZ64 V128to64 V128HIto64 1Sto64 CmpNEZ64 CmpNEZ32
189widen_z_8_to_64 1Sto32 Left32 32HLto64 CmpwNEZ32 CmpNEZ8
190
191
sewardjf0c12502014-01-12 12:54:00 +0000192isel: get rid of various cases where zero is put into a register
193and just use xzr instead. Especially for CmpNEZ64/32. And for
194writing zeroes into the CC thunk fields.
195
196
sewardjf0c12502014-01-12 12:54:00 +0000197/* Keep this list in sync with that in iselNext below */
198/* Keep this list in sync with that for Ist_Exit above */
199uh .. they are not in sync
200
201
sewardjf0c12502014-01-12 12:54:00 +0000202very stupid:
203imm64 x23, 0xFFFFFFFFFFFFFFA0
20417 F4 9F D2 F7 FF BF F2 F7 FF DF F2 F7 FF FF F2
205
206
sewardjf0c12502014-01-12 12:54:00 +0000207valgrind.h: fix VALGRIND_ALIGN_STACK/VALGRIND_RESTORE_STACK,
208also add CFI annotations
sewardjfdaf9e42014-01-13 00:18:51 +0000209
210
sewardjfdaf9e42014-01-13 00:18:51 +0000211could possibly bring r29 into use, which be useful as it is
212callee saved
sewardj383d5d32014-01-13 11:50:17 +0000213
214
215ubfm/sbfm etc: special case cases that are simple shifts, as iropt
216can't always simplify the general-case IR to a shift in such cases.
sewardj1cd6c902014-02-05 11:02:34 +0000217
218
219LDP,STP (immediate, simm7) (FP&VEC)
220should zero out hi parts of dst registers in the LDP case
221
222
223DUP insns: use Iop_Dup8x16, Iop_Dup16x8, Iop_Dup32x4
224rather than doing it "by hand"
225
226
227Any place where ZeroHI64ofV128 is used in conjunction with
228FP vector IROps: find a way to make sure that arithmetic on
229the upper half of the values is "harmless."
230
231
232math_MINMAXV: use real Iop_Cat{Odd,Even}Lanes ops rather than
233inline scalar code