Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: test/cctest/test-disasm-a64.cc

Issue 181253002: A64: Make the Decoder a template (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-assembler-a64.cc ('k') | test/cctest/test-fuzz-a64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 16 matching lines...) Expand all
27 27
28 #include <stdio.h> 28 #include <stdio.h>
29 #include <cstring> 29 #include <cstring>
30 #include "cctest.h" 30 #include "cctest.h"
31 31
32 #include "v8.h" 32 #include "v8.h"
33 33
34 #include "macro-assembler.h" 34 #include "macro-assembler.h"
35 #include "a64/assembler-a64.h" 35 #include "a64/assembler-a64.h"
36 #include "a64/macro-assembler-a64.h" 36 #include "a64/macro-assembler-a64.h"
37 #include "a64/decoder-a64-inl.h"
37 #include "a64/disasm-a64.h" 38 #include "a64/disasm-a64.h"
38 #include "a64/utils-a64.h" 39 #include "a64/utils-a64.h"
39 40
40 using namespace v8::internal; 41 using namespace v8::internal;
41 42
42 #define TEST_(name) TEST(DISASM_##name) 43 #define TEST_(name) TEST(DISASM_##name)
43 44
44 #define EXP_SIZE (256) 45 #define EXP_SIZE (256)
45 #define INSTR_SIZE (1024) 46 #define INSTR_SIZE (1024)
46 #define SET_UP_CLASS(ASMCLASS) \ 47 #define SET_UP_CLASS(ASMCLASS) \
47 InitializeVM(); \ 48 InitializeVM(); \
48 Isolate* isolate = Isolate::Current(); \ 49 Isolate* isolate = Isolate::Current(); \
49 HandleScope scope(isolate); \ 50 HandleScope scope(isolate); \
50 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \ 51 byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \
51 uint32_t encoding = 0; \ 52 uint32_t encoding = 0; \
52 ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \ 53 ASMCLASS* assm = new ASMCLASS(isolate, buf, INSTR_SIZE); \
53 Decoder* decoder = new Decoder(); \ 54 Decoder<DispatchingDecoderVisitor>* decoder = \
54 Disassembler* disasm = new Disassembler(); \ 55 new Decoder<DispatchingDecoderVisitor>(); \
56 Disassembler* disasm = new Disassembler(); \
55 decoder->AppendVisitor(disasm) 57 decoder->AppendVisitor(disasm)
56 58
57 #define SET_UP() SET_UP_CLASS(Assembler) 59 #define SET_UP() SET_UP_CLASS(Assembler)
58 60
59 #define COMPARE(ASM, EXP) \ 61 #define COMPARE(ASM, EXP) \
60 assm->Reset(); \ 62 assm->Reset(); \
61 assm->ASM; \ 63 assm->ASM; \
62 assm->GetCode(NULL); \ 64 assm->GetCode(NULL); \
63 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \ 65 decoder->Decode(reinterpret_cast<Instruction*>(buf)); \
64 encoding = *reinterpret_cast<uint32_t*>(buf); \ 66 encoding = *reinterpret_cast<uint32_t*>(buf); \
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)"); 1754 COMPARE(Dsb(FullSystem, BarrierOther), "dsb sy (0b1100)");
1753 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)"); 1755 COMPARE(Dsb(InnerShareable, BarrierOther), "dsb sy (0b1000)");
1754 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)"); 1756 COMPARE(Dsb(NonShareable, BarrierOther), "dsb sy (0b0100)");
1755 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)"); 1757 COMPARE(Dsb(OuterShareable, BarrierOther), "dsb sy (0b0000)");
1756 1758
1757 // ISB 1759 // ISB
1758 COMPARE(Isb(), "isb"); 1760 COMPARE(Isb(), "isb");
1759 1761
1760 CLEANUP(); 1762 CLEANUP();
1761 } 1763 }
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-a64.cc ('k') | test/cctest/test-fuzz-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698