From 0bb6c81b1c3076cdfccd82bb382c4450643a1ee0 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 31 Oct 1994 16:18:02 -0500 Subject: [PATCH] (movsf... (movsf, movdf, movxf): If we are moving floating point constants to a non-memory location that aren't 0 or 1, assume we need the pic register if -fpic. From-SVN: r8372 --- gcc/config/i386/i386.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 89dca039416..a4cfff591f5 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1080,6 +1080,18 @@ emit_insn ((*genfunc) (operands[0], operands[1])); DONE; } + + /* If we are loading a floating point constant that isn't 0 or 1 into a register, + indicate we need the pic register loaded. This could be optimized into stores + of constants if the target eventually moves to memory, but better safe than + sorry. */ + if (flag_pic + && GET_CODE (operands[0]) != MEM + && GET_CODE (operands[1]) == CONST_DOUBLE + && !standard_80387_constant_p (operands[1])) + { + current_function_uses_pic_offset_table = 1; + } }") (define_insn "movsf_push_nomove" @@ -1249,6 +1261,18 @@ emit_insn ((*genfunc) (operands[0], operands[1])); DONE; } + + /* If we are loading a floating point constant that isn't 0 or 1 into a register, + indicate we need the pic register loaded. This could be optimized into stores + of constants if the target eventually moves to memory, but better safe than + sorry. */ + if (flag_pic + && GET_CODE (operands[0]) != MEM + && GET_CODE (operands[1]) == CONST_DOUBLE + && !standard_80387_constant_p (operands[1])) + { + current_function_uses_pic_offset_table = 1; + } }") (define_insn "movdf_push_nomove" @@ -1408,6 +1432,18 @@ emit_insn ((*genfunc) (operands[0], operands[1])); DONE; } + + /* If we are loading a floating point constant that isn't 0 or 1 into a register, + indicate we need the pic register loaded. This could be optimized into stores + of constants if the target eventually moves to memory, but better safe than + sorry. */ + if (flag_pic + && GET_CODE (operands[0]) != MEM + && GET_CODE (operands[1]) == CONST_DOUBLE + && !standard_80387_constant_p (operands[1])) + { + current_function_uses_pic_offset_table = 1; + } }") -- 2.30.2