Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/aarch64/vm/immediate_aarch64.hpp
32285 views
/*1* Copyright (c) 2013, Red Hat Inc.2* All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19*/2021#ifndef _IMMEDIATE_H22#define _IMMEDIATE_H2324#include <sys/types.h>2526/*27* functions to map backwards and forwards between logical or floating28* point immediates and their corresponding encodings. the mapping29* from encoding to immediate is required by the simulator. the reverse30* mapping is required by the OpenJDK assembler.31*32* a logical immediate value supplied to or returned from a map lookup33* is always 64 bits. this is sufficient for looking up 32 bit34* immediates or their encodings since a 32 bit immediate has the same35* encoding as the 64 bit immediate produced by concatenating the36* immediate with itself.37*38* a logical immediate encoding is 13 bits N:immr:imms (3 fields of39* widths 1:6:6 -- see the arm spec). they appear as bits [22:10] of a40* logical immediate instruction. encodings are supplied and returned41* as 32 bit values. if a given 13 bit immediate has no corresponding42* encoding then a map lookup will return 0xffffffff.43*/4445u_int64_t logical_immediate_for_encoding(u_int32_t encoding);46u_int32_t encoding_for_logical_immediate(u_int64_t immediate);47u_int64_t fp_immediate_for_encoding(u_int32_t imm8, int is_dp);48u_int32_t encoding_for_fp_immediate(float immediate);4950#endif // _IMMEDIATE_H515253