Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/jit/jit-rules-x86-64.ins  view on Meta::CPAN

/*
 * jit-rules-x86-64.ins - Instruction selector for x86_64.
 *
 * Copyright (C) 2008  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/>.
 */
 
%regclass reg x86_64_reg
%regclass creg x86_64_creg
%regclass dreg x86_64_dreg
%regclass rreg x86_64_rreg
%regclass sreg x86_64_sreg
%regclass freg x86_64_freg
%regclass xreg x86_64_xreg
 
/*
 * Conversion opcodes.
 */

JIT_OP_TRUNC_SBYTE:
	[=reg, reg] -> {
		x86_64_movsx8_reg_reg_size(inst, $1, $2, 4);
	}

JIT_OP_TRUNC_UBYTE:
	[=reg, reg] -> {
		x86_64_movzx8_reg_reg_size(inst, $1, $2, 4);
	}

JIT_OP_TRUNC_SHORT:
	[=reg, reg] -> {
		x86_64_movsx16_reg_reg_size(inst, $1, $2, 4);
	}

JIT_OP_TRUNC_USHORT:
	[=reg, reg] -> {
		x86_64_movzx16_reg_reg_size(inst, $1, $2, 4);
	}

JIT_OP_TRUNC_INT:
	[=reg, reg] -> {
		if($1 != $2)
		{
			x86_64_mov_reg_reg_size(inst, $1, $2, 4);
		}
	}



( run in 1.012 second using v1.01-cache-2.11-cpan-2ed5026b665 )