comparison gcc/doc/match-and-simplify.texi @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 @c Copyright (C) 2014-2018 Free Software Foundation, Inc. 1 @c Copyright (C) 2014-2020 Free Software Foundation, Inc.
2 @c Free Software Foundation, Inc. 2 @c Free Software Foundation, Inc.
3 @c This is part of the GCC manual. 3 @c This is part of the GCC manual.
4 @c For copying conditions, see the file gcc.texi. 4 @c For copying conditions, see the file gcc.texi.
5 5
6 @node Match and Simplify 6 @node Match and Simplify
291 (for opc (plus minus) 291 (for opc (plus minus)
292 (simplify... 292 (simplify...
293 @end smallexample 293 @end smallexample
294 294
295 In this example the pattern will be repeated four times with 295 In this example the pattern will be repeated four times with
296 @code{opa, opb, opc} being @code{plus, minus, plus}, 296 @code{opa, opb, opc} being @code{plus, minus, plus};
297 @code{plus, minus, minus}, @code{minus, plus, plus}, 297 @code{plus, minus, minus}; @code{minus, plus, plus};
298 @code{minus, plus, minus}. 298 @code{minus, plus, minus}.
299 299
300 To avoid repeating operator lists in @code{for} you can name 300 To avoid repeating operator lists in @code{for} you can name
301 them via 301 them via
302 302
378 @code{(eq (convert@? @@1) (convert@? @@2))} will result in two 378 @code{(eq (convert@? @@1) (convert@? @@2))} will result in two
379 patterns only. If you want to match all four combinations you 379 patterns only. If you want to match all four combinations you
380 have access to two additional conditional converts as in 380 have access to two additional conditional converts as in
381 @code{(eq (convert1@? @@1) (convert2@? @@2))}. 381 @code{(eq (convert1@? @@1) (convert2@? @@2))}.
382 382
383 The support for @code{?} marking extends to all unary operations
384 including predicates you declare yourself with @code{match}.
385
383 Predicates available from the GCC middle-end need to be made 386 Predicates available from the GCC middle-end need to be made
384 available explicitely via @code{define_predicates}: 387 available explicitely via @code{define_predicates}:
385 388
386 @smallexample 389 @smallexample
387 (define_predicates 390 (define_predicates