Skip to content

Commit 612f2c0

Browse files
committed
8357981: [PPC64] Remove old instructions from VM_Version::determine_features()
Reviewed-by: dbriemann, mbaesken
1 parent eb9badd commit 612f2c0

File tree

2 files changed

+4
-75
lines changed

2 files changed

+4
-75
lines changed

src/hotspot/cpu/ppc/vm_version_ppc.cpp

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -479,29 +479,10 @@ void VM_Version::determine_features() {
479479
// Emit code.
480480
void (*test)(address addr, uint64_t offset)=(void(*)(address addr, uint64_t offset))(void *)a->function_entry();
481481
uint32_t *code = (uint32_t *)a->pc();
482-
// Don't use R0 in ldarx.
483482
// Keep R3_ARG1 unmodified, it contains &field (see below).
484483
// Keep R4_ARG2 unmodified, it contains offset = 0 (see below).
485-
a->fsqrt(F3, F4); // code[0] -> fsqrt_m
486-
a->fsqrts(F3, F4); // code[1] -> fsqrts_m
487-
a->isel(R7, R5, R6, 0); // code[2] -> isel_m
488-
a->ldarx_unchecked(R7, R3_ARG1, R4_ARG2, 1); // code[3] -> lxarx_m
489-
a->cmpb(R7, R5, R6); // code[4] -> cmpb
490-
a->popcntb(R7, R5); // code[5] -> popcntb
491-
a->popcntw(R7, R5); // code[6] -> popcntw
492-
a->fcfids(F3, F4); // code[7] -> fcfids
493-
a->vand(VR0, VR0, VR0); // code[8] -> vand
494-
// arg0 of lqarx must be an even register, (arg1 + arg2) must be a multiple of 16
495-
a->lqarx_unchecked(R6, R3_ARG1, R4_ARG2, 1); // code[9] -> lqarx_m
496-
a->vcipher(VR0, VR1, VR2); // code[10] -> vcipher
497-
a->vpmsumb(VR0, VR1, VR2); // code[11] -> vpmsumb
498-
a->mfdscr(R0); // code[12] -> mfdscr
499-
a->lxvd2x(VSR0, R3_ARG1); // code[13] -> vsx
500-
a->ldbrx(R7, R3_ARG1, R4_ARG2); // code[14] -> ldbrx
501-
a->stdbrx(R7, R3_ARG1, R4_ARG2); // code[15] -> stdbrx
502-
a->vshasigmaw(VR0, VR1, 1, 0xF); // code[16] -> vshasig
503-
a->darn(R7); // code[17] -> darn
504-
a->brw(R5, R6); // code[18] -> brw
484+
a->darn(R7);
485+
a->brw(R5, R6);
505486
a->blr();
506487

507488
// Emit function to set one cache line to zero. Emit function descriptor and get pointer to it.
@@ -536,23 +517,6 @@ void VM_Version::determine_features() {
536517

537518
// determine which instructions are legal.
538519
int feature_cntr = 0;
539-
if (code[feature_cntr++]) features |= fsqrt_m;
540-
if (code[feature_cntr++]) features |= fsqrts_m;
541-
if (code[feature_cntr++]) features |= isel_m;
542-
if (code[feature_cntr++]) features |= lxarxeh_m;
543-
if (code[feature_cntr++]) features |= cmpb_m;
544-
if (code[feature_cntr++]) features |= popcntb_m;
545-
if (code[feature_cntr++]) features |= popcntw_m;
546-
if (code[feature_cntr++]) features |= fcfids_m;
547-
if (code[feature_cntr++]) features |= vand_m;
548-
if (code[feature_cntr++]) features |= lqarx_m;
549-
if (code[feature_cntr++]) features |= vcipher_m;
550-
if (code[feature_cntr++]) features |= vpmsumb_m;
551-
if (code[feature_cntr++]) features |= mfdscr_m;
552-
if (code[feature_cntr++]) features |= vsx_m;
553-
if (code[feature_cntr++]) features |= ldbrx_m;
554-
if (code[feature_cntr++]) features |= stdbrx_m;
555-
if (code[feature_cntr++]) features |= vshasig_m;
556520
if (code[feature_cntr++]) features |= darn_m;
557521
if (code[feature_cntr++]) features |= brw_m;
558522

src/hotspot/cpu/ppc/vm_version_ppc.hpp

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2025 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -32,46 +32,12 @@
3232
class VM_Version: public Abstract_VM_Version {
3333
protected:
3434
enum Feature_Flag {
35-
fsqrt,
36-
fsqrts,
37-
isel,
38-
lxarxeh,
39-
cmpb,
40-
popcntb,
41-
popcntw,
42-
fcfids,
43-
vand,
44-
lqarx,
45-
vcipher,
46-
vpmsumb,
47-
mfdscr,
48-
vsx,
49-
ldbrx,
50-
stdbrx,
51-
vshasig,
5235
darn,
5336
brw,
5437
num_features // last entry to count features
5538
};
5639
enum Feature_Flag_Set {
5740
unknown_m = 0,
58-
fsqrt_m = (1 << fsqrt ),
59-
fsqrts_m = (1 << fsqrts ),
60-
isel_m = (1 << isel ),
61-
lxarxeh_m = (1 << lxarxeh),
62-
cmpb_m = (1 << cmpb ),
63-
popcntb_m = (1 << popcntb),
64-
popcntw_m = (1 << popcntw),
65-
fcfids_m = (1 << fcfids ),
66-
vand_m = (1 << vand ),
67-
lqarx_m = (1 << lqarx ),
68-
vcipher_m = (1 << vcipher),
69-
vpmsumb_m = (1 << vpmsumb),
70-
mfdscr_m = (1 << mfdscr ),
71-
vsx_m = (1 << vsx ),
72-
ldbrx_m = (1 << ldbrx ),
73-
stdbrx_m = (1 << stdbrx ),
74-
vshasig_m = (1 << vshasig),
7541
darn_m = (1 << darn ),
7642
brw_m = (1 << brw ),
7743
all_features_m = (unsigned long)-1
@@ -101,7 +67,6 @@ class VM_Version: public Abstract_VM_Version {
10167

10268
static bool is_determine_features_test_running() { return _is_determine_features_test_running; }
10369
// CPU instruction support
104-
static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
10570
static bool has_darn() { return (_features & darn_m) != 0; }
10671
static bool has_brw() { return (_features & brw_m) != 0; }
10772

0 commit comments

Comments
 (0)