src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorInstruction.java
author dlong
Thu, 14 Nov 2019 12:21:00 -0800
changeset 59095 03fbcd06b4c0
permissions -rw-r--r--
8233841: Update Graal Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
59095
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     1
/*
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     4
 *
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     7
 * published by the Free Software Foundation.
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     8
 *
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    13
 * accompanied this code).
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    14
 *
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    18
 *
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    21
 * questions.
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    22
 */
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    23
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    24
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    25
package org.graalvm.compiler.lir.amd64.vector;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    26
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    27
import org.graalvm.compiler.asm.amd64.AVXKind.AVXSize;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    28
import org.graalvm.compiler.lir.LIRInstructionClass;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    29
import org.graalvm.compiler.lir.amd64.AMD64LIRInstruction;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    30
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    31
public abstract class AMD64VectorInstruction extends AMD64LIRInstruction {
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    32
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    33
    public static final LIRInstructionClass<AMD64VectorInstruction> TYPE = LIRInstructionClass.create(AMD64VectorInstruction.class);
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    34
    protected final AVXSize size;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    35
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    36
    public AMD64VectorInstruction(LIRInstructionClass<? extends AMD64VectorInstruction> c, AVXSize size) {
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    37
        super(c);
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    38
        this.size = size;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    39
    }
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    40
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    41
    @Override
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    42
    public boolean needsClearUpperVectorRegisters() {
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    43
        return size == AVXSize.YMM || size == AVXSize.ZMM;
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    44
    }
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    45
03fbcd06b4c0 8233841: Update Graal
dlong
parents:
diff changeset
    46
}