sse.md (*sse2_maskmovdqu): Emit addr32 prefix when Pmode != word_mode.

* config/i386/sse.md (*sse2_maskmovdqu): Emit addr32 prefix
	when Pmode != word_mode.  Add length_address attribute.
	(sse3_monitor_<mode>): Merge from sse3_monitor and
	sse3_monitor64_<mode> insn patterns.  Emit addr32 prefix when
	Pmode != word_mode.  Update insn length attribute.
	* config/i386/i386.c (ix86_option_override_internal): Update
	ix86_gen_monitor selection for merged sse3_monitor insn.

From-SVN: r201708
This commit is contained in:
Uros Bizjak 2013-08-13 22:45:27 +02:00
parent 5ff3a1f733
commit 061eff6d92
3 changed files with 28 additions and 21 deletions

View File

@ -1,3 +1,13 @@
2013-08-13 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (*sse2_maskmovdqu): Emit addr32 prefix
when Pmode != word_mode. Add length_address attribute.
(sse3_monitor_<mode>): Merge from sse3_monitor and
sse3_monitor64_<mode> insn patterns. Emit addr32 prefix when
Pmode != word_mode. Update insn length attribute.
* config/i386/i386.c (ix86_option_override_internal): Update
ix86_gen_monitor selection for merged sse3_monitor insn.
2013-08-13 Julian Brown <julian@codesourcery.com>
* config/rs6000/rs6000.c (rs6000_legitimize_reload_address): Don't
@ -57,7 +67,7 @@
2013-08-13 David Malcolm <dmalcolm@redhat.com>
* config/i386/t-i386 (i386.o): Rename stray PIPELINE_H to
PASS_MANAGER_H
PASS_MANAGER_H.
2013-08-12 Paolo Carlini <paolo.carlini@oracle.com>

View File

@ -4170,24 +4170,19 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_leave = gen_leave_rex64;
if (Pmode == DImode)
{
ix86_gen_monitor = gen_sse3_monitor64_di;
ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di;
ix86_gen_tls_local_dynamic_base_64
= gen_tls_local_dynamic_base_64_di;
}
else
{
ix86_gen_monitor = gen_sse3_monitor64_si;
ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si;
ix86_gen_tls_local_dynamic_base_64
= gen_tls_local_dynamic_base_64_si;
}
}
else
{
ix86_gen_leave = gen_leave;
ix86_gen_monitor = gen_sse3_monitor;
}
ix86_gen_leave = gen_leave;
if (Pmode == DImode)
{
@ -4199,6 +4194,7 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di;
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi;
ix86_gen_probe_stack_range = gen_probe_stack_rangedi;
ix86_gen_monitor = gen_sse3_monitor_di;
}
else
{
@ -4210,6 +4206,7 @@ ix86_option_override_internal (bool main_args_p)
ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si;
ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi;
ix86_gen_probe_stack_range = gen_probe_stack_rangesi;
ix86_gen_monitor = gen_sse3_monitor_si;
}
#ifdef USE_IX86_CLD

View File

@ -7731,9 +7731,17 @@
(mem:V16QI (match_dup 0))]
UNSPEC_MASKMOV))]
"TARGET_SSE2"
"%vmaskmovdqu\t{%2, %1|%1, %2}"
{
/* We can't use %^ here due to ASM_OUTPUT_OPCODE processing
that requires %v to be at the beginning of the opcode name. */
if (Pmode != word_mode)
fputs ("\taddr32", asm_out_file);
return "%vmaskmovdqu\t{%2, %1|%1, %2}";
}
[(set_attr "type" "ssemov")
(set_attr "prefix_data16" "1")
(set (attr "length_address")
(symbol_ref ("Pmode != word_mode")))
;; The implicit %rdi operand confuses default length_vex computation.
(set (attr "length_vex")
(symbol_ref ("3 + REX_SSE_REGNO_P (REGNO (operands[2]))")))
@ -7781,26 +7789,18 @@
"mwait"
[(set_attr "length" "3")])
(define_insn "sse3_monitor"
[(unspec_volatile [(match_operand:SI 0 "register_operand" "a")
(match_operand:SI 1 "register_operand" "c")
(match_operand:SI 2 "register_operand" "d")]
UNSPECV_MONITOR)]
"TARGET_SSE3 && !TARGET_64BIT"
"monitor\t%0, %1, %2"
[(set_attr "length" "3")])
(define_insn "sse3_monitor64_<mode>"
(define_insn "sse3_monitor_<mode>"
[(unspec_volatile [(match_operand:P 0 "register_operand" "a")
(match_operand:SI 1 "register_operand" "c")
(match_operand:SI 2 "register_operand" "d")]
UNSPECV_MONITOR)]
"TARGET_SSE3 && TARGET_64BIT"
"TARGET_SSE3"
;; 64bit version is "monitor %rax,%rcx,%rdx". But only lower 32bits in
;; RCX and RDX are used. Since 32bit register operands are implicitly
;; zero extended to 64bit, we only need to set up 32bit registers.
"monitor"
[(set_attr "length" "3")])
"%^monitor"
[(set (attr "length")
(symbol_ref ("(Pmode != word_mode) + 3")))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;