X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fbe%2Fsparc%2Fsparc_lower64.c;h=da627f7b2778d8e59482e0e5521bd9700987ad00;hb=0754bb717d5761ad49a36f0e29829ffac413d92e;hp=0e9e5b0c137bd1447874b814bb885bc2cc72ddd3;hpb=ed0e4ce9a109277e1a63f48f2aca7750f473bc6a;p=libfirm diff --git a/ir/be/sparc/sparc_lower64.c b/ir/be/sparc/sparc_lower64.c index 0e9e5b0c1..da627f7b2 100644 --- a/ir/be/sparc/sparc_lower64.c +++ b/ir/be/sparc/sparc_lower64.c @@ -1,20 +1,6 @@ /* - * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved. - * * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -25,6 +11,7 @@ #include "config.h" #include "bearch_sparc_t.h" +#include "error.h" #include "gen_sparc_new_nodes.h" #include "lower_dw.h" #include "ircons_t.h" @@ -105,6 +92,30 @@ static ir_entity *create_64_intrinsic_fkt(ir_type *method, const ir_op *op, name = mode_is_signed(imode) ? "__divdi3" : "__udivdi3"; } else if (op == op_Mod) { name = mode_is_signed(imode) ? "__moddi3" : "__umoddi3"; + } else if (op == op_Conv) { + if (mode_is_float(imode)) { + assert(get_mode_size_bits(omode) == 64); + if (get_mode_size_bits(imode) == 64) { + name = mode_is_signed(omode) ? "__fixdfdi" : "__fixunsdfdi"; + } else if (get_mode_size_bits(imode) == 32) { + name = mode_is_signed(omode) ? "__fixsfdi" : "__fixunssfdi"; + } else { + assert(get_mode_size_bits(imode) == 128); + panic("can't conver long double to long long yet"); + } + } else if (mode_is_float(omode)) { + assert(get_mode_size_bits(imode) == 64); + if (get_mode_size_bits(omode) == 64) { + name = mode_is_signed(imode) ? "__floatdidf" : "__floatundidf"; + } else if (get_mode_size_bits(omode) == 32) { + name = mode_is_signed(imode) ? "__floatdisf" : "__floatundisf"; + } else { + assert(get_mode_size_bits(omode) == 128); + panic("can't convert long long to long double yet"); + } + } else { + panic("can't lower 64bit Conv"); + } } else { panic("Can't lower unexpected 64bit operation %s", get_op_name(op)); }