Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/attic/jit-rules-alpha.ins  view on Meta::CPAN

/*
 * jit-rules-alpha.ins - Instruction selector for alpha.
 *
 * Copyright (C) 2006  Southern Storm Software, Pty Ltd.
 *
 * This file is part of the libjit library.
 *
 * The libjit library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * The libjit library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with the libjit library.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

%inst_type alpha_inst

%regclass reg alpha_reg
%regclass lreg alpha_reg
%regclass freg alpha_freg

/*
 * Conversion opcodes.
 */

JIT_OP_TRUNC_SBYTE:
	[reg] -> {
		alpha_slli(inst,$1,56,$1);
		alpha_srai(inst,$1,56,$1);
	}

JIT_OP_TRUNC_UBYTE:
	[reg] -> {
		_alpha_li8(inst,ALPHA_AT,0xff);
		alpha_and(inst,$1,ALPHA_AT,$1);
	}

JIT_OP_TRUNC_SHORT:
	[reg] -> {
		alpha_slli(inst,$1,56,$1);
		alpha_srai(inst,$1,56,$1);
	}

JIT_OP_TRUNC_USHORT:
	[reg] -> {
		alpha_slli(inst,$1,56,$1);
		alpha_srli(inst,$1,56,$1);
	}

/*
 * TODO: JIT_OP_NFLOAT_TO_FLOAT32 JIT_OP_NFLOAT_TO_FLOAT64
 * TODO: JIT_OP_FLOAT32_TO_NFLOAT JIT_OP_FLOAT64_TO_NFLOAT
 *
 * Requires floating-point opcodes
 */



( run in 2.227 seconds using v1.01-cache-2.11-cpan-13bb782fe5a )