diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-31 15:08:25 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-31 15:08:25 -0700 |
commit | c2f9f64eb2c23b74d5eacb59223088ba44f48519 (patch) | |
tree | 162fa089c725b7664c716087520a3ef0c0655da1 | |
parent | f40fac9b075ab3fa18619f9bbc49ea4867460d45 (diff) | |
download | gcc-c2f9f64eb2c23b74d5eacb59223088ba44f48519.zip gcc-c2f9f64eb2c23b74d5eacb59223088ba44f48519.tar.gz gcc-c2f9f64eb2c23b74d5eacb59223088ba44f48519.tar.bz2 |
(make_compound_operation): Handle the case (and (xor/ior (lshift...) (lshift...)) ...).
(make_compound_operation): Handle the case
(and (xor/ior (lshift...) (lshift...)) ...).
(make_field_assignment): In get_pos_from_mask call, only invert
bits in mode mask.
From-SVN: r5237
-rw-r--r-- | gcc/combine.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 777cce4..d833b59 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5296,6 +5296,21 @@ make_compound_operation (x, in_code) XEXP (SUBREG_REG (XEXP (x, 0)), 1), i, 1, 0, in_code == COMPARE); } + /* Same as previous, but for (xor/ior (lshift...) (lshift...)). */ + else if ((GET_CODE (XEXP (x, 0)) == XOR + || GET_CODE (XEXP (x, 0)) == IOR) + && GET_CODE (XEXP (XEXP (x, 0), 0)) == LSHIFTRT + && GET_CODE (XEXP (XEXP (x, 0), 1)) == LSHIFTRT + && (i = exact_log2 (INTVAL (XEXP (x, 1)) + 1)) >= 0) + { + /* Apply the distributive law, and then try to make extractions. */ + new = gen_rtx_combine (GET_CODE (XEXP (x, 0)), mode, + gen_rtx (AND, mode, XEXP (XEXP (x, 0), 0), + XEXP (x, 1)), + gen_rtx (AND, mode, XEXP (XEXP (x, 0), 1), + XEXP (x, 1))); + new = make_compound_operation (new, in_code); + } /* If we are have (and (rotate X C) M) and C is larger than the number of bits in M, this is an extraction. */ @@ -6100,7 +6115,7 @@ make_field_assignment (x) else return x; - pos = get_pos_from_mask (~c1, &len); + pos = get_pos_from_mask (c1 ^ GET_MODE_MASK (GET_MODE (dest)), &len); if (pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (dest)) || (GET_MODE_BITSIZE (GET_MODE (other)) <= HOST_BITS_PER_WIDE_INT && (c1 & nonzero_bits (other, GET_MODE (other))) != 0)) |