summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2012-07-16 17:39:29 +0000
committermatt <matt@NetBSD.org>2012-07-16 17:39:29 +0000
commitc9e275800ab66c4672d3e9a4bf68f20b613c2f46 (patch)
treea84eb8bea315555577a30535287872e095cac865 /gnu
parentab95dbb65a5f9c57079d7966130f2f82dbab2155 (diff)
Fix ffssi2 again.
Use a UNSPEC for the internal ffs. use (match_dup 1) since Z will be set if it is 0 just as if tst:SI was done. This can let gcc produce better code if you code appropriately.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/gcc4/gcc/config/vax/builtins.md14
-rw-r--r--gnu/dist/gcc4/gcc/config/vax/vax.md2
2 files changed, 12 insertions, 4 deletions
diff --git a/gnu/dist/gcc4/gcc/config/vax/builtins.md b/gnu/dist/gcc4/gcc/config/vax/builtins.md
index 4219ac7a226..bad1cb2378d 100644
--- a/gnu/dist/gcc4/gcc/config/vax/builtins.md
+++ b/gnu/dist/gcc4/gcc/config/vax/builtins.md
@@ -25,7 +25,7 @@
"
{
rtx label = gen_label_rtx ();
- emit_insn (gen_ffssi2_internal (operands[0], operands[1], operands[1]));
+ emit_insn (gen_unspec_ffssi2 (operands[0], operands[1]));
emit_jump_insn (gen_bne (label));
emit_insn (gen_negsi2 (operands[0], const1_rtx));
emit_label (label);
@@ -33,9 +33,15 @@
DONE;
}")
-(define_insn "ffssi2_internal"
+;;
+;; Set cc0 to match argument 1 since if it is 0, Z will be set just as
+;; if a tst:SI was performed. If we did a match_dup 0, that wouldn't be
+;; right since 0 will be set to (0+32) [the position (relative to the base)
+;; of a bit one position to the left of the specified field].
+;;
+(define_insn "unspec_ffssi2"
[(set (match_operand:SI 0 "nonimmediate_operand" "=g")
- (ffs:SI (match_operand:SI 1 "general_operand" "nrQ")))
- (set (cc0) (ffs:SI (match_operand:SI 2 "general_operand" "1")))]
+ (unspec:SI [(match_operand:SI 1 "general_operand" "nrQ")] VUNSPEC_FFS))
+ (set (cc0) (match_dup 1))]
""
"ffs $0,$32,%1,%0")
diff --git a/gnu/dist/gcc4/gcc/config/vax/vax.md b/gnu/dist/gcc4/gcc/config/vax/vax.md
index ff94bd10585..12e8b8dfec3 100644
--- a/gnu/dist/gcc4/gcc/config/vax/vax.md
+++ b/gnu/dist/gcc4/gcc/config/vax/vax.md
@@ -34,6 +34,8 @@
[(VUNSPEC_BLOCKAGE 0) ; `blockage' insn to prevent scheduling across an
; insn in the code.
(VUNSPEC_SYNC_ISTREAM 1) ; sequence of insns to sync the I-stream
+ (VUNSPEC_FFS 2) ; internal FFS for the expand
+ (VUNSPEC_FFC 3) ; internal FFC for the expand
(VAX_AP_REGNUM 12) ; Register 12 contains the argument pointer
(VAX_FP_REGNUM 13) ; Register 13 contains the frame pointer
(VAX_SP_REGNUM 14) ; Register 14 contains the stack pointer