v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test-assembler-arm64.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <limits>
#include "v8.h"
#include "macro-assembler.h"
#include "arm64/simulator-arm64.h"
#include "arm64/decoder-arm64-inl.h"
#include "arm64/disasm-arm64.h"
#include "arm64/utils-arm64.h"
#include "cctest.h"
#include "test-utils-arm64.h"
Include dependency graph for test-assembler-arm64.cc:

Go to the source code of this file.

Macros

#define __   masm.
 
#define BUF_SIZE   8192
 
#define SETUP()   SETUP_SIZE(BUF_SIZE)
 
#define INIT_V8()   CcTest::InitializeVM(); \
 
#define SETUP_SIZE(buf_size)
 
#define RESET()   __ Reset();
 
#define START_AFTER_RESET()
 
#define START()
 
#define RUN()
 
#define END()
 
#define TEARDOWN()   delete[] buf;
 
#define ASSERT_EQUAL_NZCV(expected)   CHECK(EqualNzcv(expected, core.flags_nzcv()))
 
#define ASSERT_EQUAL_REGISTERS(expected)   CHECK(EqualRegisters(&expected, &core))
 
#define ASSERT_EQUAL_32(expected, result)   CHECK(Equal32(static_cast<uint32_t>(expected), &core, result))
 
#define ASSERT_EQUAL_FP32(expected, result)   CHECK(EqualFP32(expected, &core, result))
 
#define ASSERT_EQUAL_64(expected, result)   CHECK(Equal64(expected, &core, result))
 
#define ASSERT_EQUAL_FP64(expected, result)   CHECK(EqualFP64(expected, &core, result))
 
#define ASSERT_LITERAL_POOL_SIZE(expected)   ((void) 0)
 

Enumerations

enum  PushPopMethod { PushPopByFour, PushPopRegList }
 

Functions

 TEST (stack_ops)
 
 TEST (mvn)
 
 TEST (mov)
 
 TEST (mov_imm_w)
 
 TEST (mov_imm_x)
 
 TEST (orr)
 
 TEST (orr_extend)
 
 TEST (bitwise_wide_imm)
 
 TEST (orn)
 
 TEST (orn_extend)
 
 TEST (and_)
 
 TEST (and_extend)
 
 TEST (ands)
 
 TEST (bic)
 
 TEST (bic_extend)
 
 TEST (bics)
 
 TEST (eor)
 
 TEST (eor_extend)
 
 TEST (eon)
 
 TEST (eon_extend)
 
 TEST (mul)
 
 TEST (smull)
 
 TEST (madd)
 
 TEST (msub)
 
 TEST (smulh)
 
 TEST (smaddl_umaddl)
 
 TEST (smsubl_umsubl)
 
 TEST (div)
 
 TEST (rbit_rev)
 
 TEST (clz_cls)
 
 TEST (label)
 
 TEST (branch_at_start)
 
 TEST (adr)
 
 TEST (branch_cond)
 
 TEST (branch_to_reg)
 
 TEST (compare_branch)
 
 TEST (test_branch)
 
 TEST (far_branch_backward)
 
 TEST (far_branch_simple_veneer)
 
 TEST (far_branch_veneer_link_chain)
 
 TEST (far_branch_veneer_broken_link_chain)
 
 TEST (branch_type)
 
 TEST (ldr_str_offset)
 
 TEST (ldr_str_wide)
 
 TEST (ldr_str_preindex)
 
 TEST (ldr_str_postindex)
 
 TEST (load_signed)
 
 TEST (load_store_regoffset)
 
 TEST (load_store_float)
 
 TEST (load_store_double)
 
 TEST (ldp_stp_float)
 
 TEST (ldp_stp_double)
 
 TEST (ldp_stp_offset)
 
 TEST (ldnp_stnp_offset)
 
 TEST (ldp_stp_preindex)
 
 TEST (ldp_stp_postindex)
 
 TEST (ldp_sign_extend)
 
 TEST (ldur_stur)
 
 TEST (add_sub_imm)
 
 TEST (add_sub_wide_imm)
 
 TEST (add_sub_shifted)
 
 TEST (add_sub_extended)
 
 TEST (add_sub_negative)
 
 TEST (add_sub_zero)
 
 TEST (claim_drop_zero)
 
 TEST (neg)
 
 TEST (adc_sbc_shift)
 
 TEST (adc_sbc_extend)
 
 TEST (adc_sbc_wide_imm)
 
 TEST (flags)
 
 TEST (cmp_shift)
 
 TEST (cmp_extend)
 
 TEST (ccmp)
 
 TEST (ccmp_wide_imm)
 
 TEST (ccmp_shift_extend)
 
 TEST (csel)
 
 TEST (csel_imm)
 
 TEST (lslv)
 
 TEST (lsrv)
 
 TEST (asrv)
 
 TEST (rorv)
 
 TEST (bfm)
 
 TEST (sbfm)
 
 TEST (ubfm)
 
 TEST (extr)
 
 TEST (fmov_imm)
 
 TEST (fmov_reg)
 
 TEST (fadd)
 
 TEST (fsub)
 
 TEST (fmul)
 
 TEST (fmadd_fmsub_double)
 
 TEST (fmadd_fmsub_float)
 
 TEST (fmadd_fmsub_double_nans)
 
 TEST (fmadd_fmsub_float_nans)
 
 TEST (fdiv)
 
 TEST (fmax_fmin_d)
 
 TEST (fmax_fmin_s)
 
 TEST (fccmp)
 
 TEST (fcmp)
 
 TEST (fcsel)
 
 TEST (fneg)
 
 TEST (fabs)
 
 TEST (fsqrt)
 
 TEST (frinta)
 
 TEST (frintn)
 
 TEST (frintz)
 
 TEST (fcvt_ds)
 
 TEST (fcvt_sd)
 
 TEST (fcvtas)
 
 TEST (fcvtau)
 
 TEST (fcvtms)
 
 TEST (fcvtmu)
 
 TEST (fcvtns)
 
 TEST (fcvtnu)
 
 TEST (fcvtzs)
 
 TEST (fcvtzu)
 
 TEST (scvtf_ucvtf_double)
 
 TEST (scvtf_ucvtf_float)
 
 TEST (system_mrs)
 
 TEST (system_msr)
 
 TEST (system_nop)
 
 TEST (zero_dest)
 
 TEST (zero_dest_setflags)
 
 TEST (register_bit)
 
 TEST (stack_pointer_override)
 
 TEST (peek_poke_simple)
 
 TEST (peek_poke_unaligned)
 
 TEST (peek_poke_endianness)
 
 TEST (peek_poke_mixed)
 
 TEST (push_pop_jssp_simple_32)
 
 TEST (push_pop_jssp_simple_64)
 
 TEST (push_pop_fp_jssp_simple_32)
 
 TEST (push_pop_fp_jssp_simple_64)
 
 TEST (push_pop_jssp_mixed_methods_64)
 
 TEST (push_pop_jssp_mixed_methods_32)
 
 TEST (push_pop_jssp_wx_overlap)
 
 TEST (push_pop_csp)
 
 TEST (push_queued)
 
 TEST (pop_queued)
 
 TEST (jump_both_smi)
 
 TEST (jump_either_smi)
 
 TEST (noreg)
 
 TEST (isvalid)
 
 TEST (cpureglist_utils_x)
 
 TEST (cpureglist_utils_w)
 
 TEST (cpureglist_utils_d)
 
 TEST (cpureglist_utils_s)
 
 TEST (cpureglist_utils_empty)
 
 TEST (printf)
 
 TEST (printf_no_preserve)
 
 TEST (copyfields)
 
 TEST (smi_abs)
 
 TEST (blr_lr)
 
 TEST (barriers)
 
 TEST (process_nan_double)
 
 TEST (process_nan_float)
 
 TEST (process_nans_double)
 
 TEST (process_nans_float)
 
 TEST (default_nan_float)
 
 TEST (default_nan_double)
 
 TEST (call_no_relocation)
 
 TEST (abs)
 
 TEST (pool_size)
 

Macro Definition Documentation

#define __   masm.

Definition at line 105 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_32 (   expected,
  result 
)    CHECK(Equal32(static_cast<uint32_t>(expected), &core, result))

Definition at line 215 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_64 (   expected,
  result 
)    CHECK(Equal64(expected, &core, result))

Definition at line 221 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_FP32 (   expected,
  result 
)    CHECK(EqualFP32(expected, &core, result))

Definition at line 218 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_FP64 (   expected,
  result 
)    CHECK(EqualFP64(expected, &core, result))

Definition at line 224 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_NZCV (   expected)    CHECK(EqualNzcv(expected, core.flags_nzcv()))

Definition at line 209 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_EQUAL_REGISTERS (   expected)    CHECK(EqualRegisters(&expected, &core))

Definition at line 212 of file test-assembler-arm64.cc.

Referenced by TEST().

#define ASSERT_LITERAL_POOL_SIZE (   expected)    ((void) 0)

Definition at line 231 of file test-assembler-arm64.cc.

#define BUF_SIZE   8192

Definition at line 107 of file test-assembler-arm64.cc.

#define END ( )
Value:
core.Dump(&masm); \
__ PopCalleeSavedRegisters(); \
__ Ret(); \
__ GetCode(NULL);
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
#define __

Definition at line 198 of file test-assembler-arm64.cc.

Referenced by HistogramTimer::Stop(), and TEST().

#define INIT_V8 ( )    CcTest::InitializeVM(); \

Definition at line 110 of file test-assembler-arm64.cc.

Referenced by TEST().

#define RESET ( )    __ Reset();

Definition at line 179 of file test-assembler-arm64.cc.

Referenced by TEST().

#define RUN ( )
Value:
CPU::FlushICache(buf, masm.SizeOfGeneratedCode()); \
{ \
void (*test_function)(void); \
memcpy(&test_function, &buf, sizeof(buf)); \
test_function(); \
}

Definition at line 190 of file test-assembler-arm64.cc.

Referenced by TEST().

#define SETUP ( )    SETUP_SIZE(BUF_SIZE)

Definition at line 108 of file test-assembler-arm64.cc.

Referenced by TEST().

#define SETUP_SIZE (   buf_size)
Value:
Isolate* isolate = Isolate::Current(); \
HandleScope scope(isolate); \
ASSERT(isolate != NULL); \
byte* buf = new byte[buf_size]; \
MacroAssembler masm(isolate, buf, buf_size); \
RegisterDump core; \
CPU::SetUp();
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
unsigned char byte
Definition: disasm.h:33
#define ASSERT(condition)
Definition: checks.h:329
uint8_t byte
Definition: globals.h:185

Definition at line 170 of file test-assembler-arm64.cc.

Referenced by TEST().

#define START ( )
Value:
RESET(); \
#define RESET()
#define START_AFTER_RESET()

Definition at line 186 of file test-assembler-arm64.cc.

Referenced by HistogramTimer::Start(), and TEST().

#define START_AFTER_RESET ( )
Value:
__ SetStackPointer(csp); \
__ PushCalleeSavedRegisters();
#define __

Definition at line 182 of file test-assembler-arm64.cc.

Referenced by TEST().

#define TEARDOWN ( )    delete[] buf;

Definition at line 204 of file test-assembler-arm64.cc.

Referenced by TEST().

Enumeration Type Documentation

Enumerator
PushPopByFour 
PushPopRegList 

Definition at line 8185 of file test-assembler-arm64.cc.

Function Documentation

TEST ( stack_ops  )

Definition at line 236 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, v8::internal::SXTB, and TEARDOWN.

TEST ( mov_imm_w  )

Definition at line 414 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( mov_imm_x  )

Definition at line 442 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( bitwise_wide_imm  )

Definition at line 578 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( mul  )

Definition at line 1077 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( smull  )

Definition at line 1147 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( madd  )

Definition at line 1158 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( msub  )

Definition at line 1228 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( smulh  )

Definition at line 1298 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( smaddl_umaddl  )

Definition at line 1347 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( smsubl_umsubl  )

Definition at line 1383 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( div  )

Definition at line 1419 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( rbit_rev  )

Definition at line 1502 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( clz_cls  )

Definition at line 1531 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( label  )
TEST ( branch_at_start  )
TEST ( adr  )

Definition at line 1643 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( branch_to_reg  )
TEST ( compare_branch  )

Definition at line 1828 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, v8::internal::B, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( test_branch  )

Definition at line 1901 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, v8::internal::B, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ldr_str_offset  )

Definition at line 2338 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ldr_str_wide  )
TEST ( ldr_str_preindex  )
TEST ( ldr_str_postindex  )
TEST ( load_signed  )

Definition at line 2548 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( load_store_regoffset  )
TEST ( ldp_stp_offset  )

Definition at line 2780 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ldnp_stnp_offset  )

Definition at line 2835 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ldp_stp_preindex  )
TEST ( ldp_stp_postindex  )
TEST ( ldp_sign_extend  )

Definition at line 3000 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ldur_stur  )

Definition at line 3021 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( add_sub_imm  )

Definition at line 3226 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( add_sub_wide_imm  )

Definition at line 3283 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( add_sub_shifted  )
TEST ( add_sub_negative  )

Definition at line 3442 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( add_sub_zero  )

Definition at line 3488 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, CHECK_EQ, CHECK_NE, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( claim_drop_zero  )

Definition at line 3526 of file test-assembler-arm64.cc.

References __, CHECK_EQ, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( adc_sbc_wide_imm  )

Definition at line 3897 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( lslv  )
TEST ( lsrv  )
TEST ( asrv  )
TEST ( rorv  )
TEST ( bfm  )

Definition at line 4657 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( sbfm  )

Definition at line 4698 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( ubfm  )

Definition at line 4761 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( extr  )

Definition at line 4818 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( fmadd_fmsub_double  )

Definition at line 5111 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( fmadd_fmsub_float  )

Definition at line 5179 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( fmax_fmin_d  )
TEST ( fmax_fmin_s  )
TEST ( scvtf_ucvtf_double  )

Definition at line 7374 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( scvtf_ucvtf_float  )

Definition at line 7531 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( zero_dest_setflags  )
TEST ( stack_pointer_override  )

Definition at line 7893 of file test-assembler-arm64.cc.

References __, CHECK, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( peek_poke_simple  )

Definition at line 7916 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, Clobber(), END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( peek_poke_unaligned  )

Definition at line 7983 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, Clobber(), END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( peek_poke_endianness  )

Definition at line 8063 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( peek_poke_mixed  )
TEST ( push_pop_jssp_simple_32  )
TEST ( push_pop_jssp_simple_64  )
TEST ( push_pop_fp_jssp_simple_32  )
TEST ( push_pop_fp_jssp_simple_64  )
TEST ( push_pop_jssp_mixed_methods_64  )

Definition at line 8648 of file test-assembler-arm64.cc.

References INIT_V8, and v8::internal::kXRegSizeInBits.

TEST ( push_pop_jssp_mixed_methods_32  )

Definition at line 8656 of file test-assembler-arm64.cc.

References INIT_V8, and v8::internal::kWRegSizeInBits.

TEST ( push_pop_jssp_wx_overlap  )

Definition at line 8865 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( push_pop_csp  )

Definition at line 8883 of file test-assembler-arm64.cc.

References __, ASSERT, ASSERT_EQUAL_32, ASSERT_EQUAL_64, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( jump_both_smi  )

Definition at line 9122 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, v8::internal::B, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( jump_either_smi  )

Definition at line 9195 of file test-assembler-arm64.cc.

References __, ASSERT_EQUAL_64, v8::internal::B, END, INIT_V8, RUN, SETUP, START, and TEARDOWN.

TEST ( noreg  )

Definition at line 9268 of file test-assembler-arm64.cc.

References CHECK.

TEST ( isvalid  )
TEST ( copyfields  )

Definition at line 9873 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( smi_abs  )

Definition at line 9918 of file test-assembler-arm64.cc.

References INIT_V8.

TEST ( blr_lr  )
TEST ( process_nans_double  )
TEST ( process_nans_float  )
TEST ( default_nan_float  )
TEST ( default_nan_double  )