src/cpu/ppc/vm/vm_version_ppc.cpp

changeset 6515
71a71b0bc844
parent 6511
31e80afe3fed
child 6680
78bbf4d43a14
     1.1 --- a/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Feb 20 14:44:33 2014 +0100
     1.2 +++ b/src/cpu/ppc/vm/vm_version_ppc.cpp	Thu Mar 20 11:03:06 2014 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  /*
     1.5   * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 - * Copyright 2012, 2013 SAP AG. All rights reserved.
     1.7 + * Copyright 2012, 2014 SAP AG. All rights reserved.
     1.8   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.9   *
    1.10   * This code is free software; you can redistribute it and/or modify it
    1.11 @@ -402,6 +402,9 @@
    1.12    CodeBuffer cb("detect_cpu_features", code_size, 0);
    1.13    MacroAssembler* a = new MacroAssembler(&cb);
    1.14  
    1.15 +  // Must be set to true so we can generate the test code.
    1.16 +  _features = VM_Version::all_features_m;
    1.17 +
    1.18    // Emit code.
    1.19    void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->function_entry();
    1.20    uint32_t *code = (uint32_t *)a->pc();
    1.21 @@ -409,14 +412,15 @@
    1.22    // Keep R3_ARG1 unmodified, it contains &field (see below).
    1.23    // Keep R4_ARG2 unmodified, it contains offset = 0 (see below).
    1.24    a->fsqrt(F3, F4);                            // code[0] -> fsqrt_m
    1.25 -  a->isel(R7, R5, R6, 0);                      // code[1] -> isel_m
    1.26 -  a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[2] -> lxarx_m
    1.27 -  a->cmpb(R7, R5, R6);                         // code[3] -> bcmp
    1.28 -  //a->mftgpr(R7, F3);                         // code[4] -> mftgpr
    1.29 -  a->popcntb(R7, R5);                          // code[5] -> popcntb
    1.30 -  a->popcntw(R7, R5);                          // code[6] -> popcntw
    1.31 -  a->fcfids(F3, F4);                           // code[7] -> fcfids
    1.32 -  a->vand(VR0, VR0, VR0);                      // code[8] -> vand
    1.33 +  a->fsqrts(F3, F4);                           // code[1] -> fsqrts_m
    1.34 +  a->isel(R7, R5, R6, 0);                      // code[2] -> isel_m
    1.35 +  a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m
    1.36 +  a->cmpb(R7, R5, R6);                         // code[4] -> bcmp
    1.37 +  //a->mftgpr(R7, F3);                         // code[5] -> mftgpr
    1.38 +  a->popcntb(R7, R5);                          // code[6] -> popcntb
    1.39 +  a->popcntw(R7, R5);                          // code[7] -> popcntw
    1.40 +  a->fcfids(F3, F4);                           // code[8] -> fcfids
    1.41 +  a->vand(VR0, VR0, VR0);                      // code[9] -> vand
    1.42    a->blr();
    1.43  
    1.44    // Emit function to set one cache line to zero. Emit function descriptor and get pointer to it.
    1.45 @@ -426,6 +430,7 @@
    1.46  
    1.47    uint32_t *code_end = (uint32_t *)a->pc();
    1.48    a->flush();
    1.49 +  _features = VM_Version::unknown_m;
    1.50  
    1.51    // Print the detection code.
    1.52    if (PrintAssembly) {
    1.53 @@ -450,6 +455,7 @@
    1.54    // determine which instructions are legal.
    1.55    int feature_cntr = 0;
    1.56    if (code[feature_cntr++]) features |= fsqrt_m;
    1.57 +  if (code[feature_cntr++]) features |= fsqrts_m;
    1.58    if (code[feature_cntr++]) features |= isel_m;
    1.59    if (code[feature_cntr++]) features |= lxarxeh_m;
    1.60    if (code[feature_cntr++]) features |= cmpb_m;

mercurial