Repository: swc-project/swc (rust)

Issue:
`es/minifier`: improve bitwise transforms
### Describe the feature

- [ ] [collapse empty shift into shorter bitwise operation (`a = b << 0`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUrCxUTAAAB00By4KAAAA&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (could be `a = b | 0;` or `a = b ^ 0;`) (doesn't apply to >>>)
- [ ] [remove redundant operations (`a = b ^ 0 | 0`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUohTMFCoUTAAAEBVg3gNAAAA&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (one of them is redundant)
- [ ] [truncate left/right shifting to 32 bits (`a = b << 64`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUrCxUTAzAQBT18TGCwAAAA%3D%3D&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (equivalent: `1 << 0`, `1 << 32`, `1 << 64`)
- [ ] [truncate floating point for numbers in bitwise operations (`a = b << 8.16563`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUrCxUbDQMzQzNTMGAIE2C6YQAAAA&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (`8.16563` is always truncated to `8`)
- [ ] [collapse bitwise shift into multiplication (`a = b * 4 << 1 | 0`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUtBSMFGwsVEwVKhRMAAA7JHAEBIAAAA%3D&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (could be `a = 8 * b | 0;`)
- [ ] [unroll multiplication into bitwise shift (`a = b * 65536 | 0, a = b * 100 | 0`)](https://play.swc.rs/?version=1.11.13&code=H4sIAAAAAAAAA0tUsFVIUtBSMDM1NTZTqFEw4EqEihgaGID4AHTZRIkhAAAA&config=H4sIAAAAAAAAA32US3LbMAyG9zmFR%2Bts00UP0F3PwKFFUGYqEhoCdKzJ%2BO4F9bCdGMxOxAcI5I%2FH58vh0L1T3%2F0%2BfMqnHCabCfLtLBaaE9uLWDqeJ6A%2Bh4m7150yVeTtSLCYrivp2OYBuEYBvW3u3YhIsLtvthhS8PNjwh7jlIHowSZW%2BV%2BJkLiaORd4fUQZPxT7EXEEm34gxpIJiWGArHj1OI52IjBnq%2BMoagVCLUOFhcGZKeOk8uQCB0wixTN1YJ3p0YGCQoaewxm0MMklYYnkdV9lvmMHxzIMS4m%2FRcPZjsWykhMuS0Hkts%2FshIHY%2BLKI8D3jChsSrFDXNniTgUtWEr5jSI2ofwDy%2FtESJRtBu9Di4aWXWtH%2Bx8iQvLQrzwqX3tYemWAQSU0IXtG1CgOZg1bLDK70UIXt21SXgYIDA95Ln2j0I3B%2F0lLW%2BUavACmu1e6%2F2k1r%2FjZcR6FN%2F8gDWe2szSFaPjUhzfGI2gTtwcAndG0uFWBs0iyL4TI1cUkOpB%2FAaR6FNHsdTjaMZlyW41M%2FyETID80w4vG%2BGDaH623pRpuG%2B4Sve%2Fdlc%2BgiurLAbaPXqq57%2BFd3d9q37q2Nu0B%2F98gl6fU%2FUub13x0GAAA%3D) (could be `a = b << 16, a = b * 5 << 2;` which save the `| 0`)

You should probably decide whether to use `| 0` or `^ 0`. They are equivalent and uniformity will help compression.

### Babel plugin or link to the feature description

_No response_

### Additional context

_No response_

Pull request description:
feat(es/minifier): Optimize number to int
<!-- Note: CI script will automatically rebase your PR so please do not rebase unless required -->

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**Description:**

Closes #10281 
**BREAKING CHANGE:**

<!--
If this PR introduces a breaking change, it must contain a notice for it to be included in the CHANGELOG. Add description or remove entirely if not breaking.

You may need to update `MIGRATION.md` for the breaking changes.
-->

**Related issue (if exists):**


Patch:
diff --git a/.changeset/famous-dragons-divide.md b/.changeset/famous-dragons-divide.md
new file mode 100644
index 0000000000..3422a23c41
--- /dev/null
+++ b/.changeset/famous-dragons-divide.md
@@ -0,0 +1,6 @@
+---
+swc_ecma_minifier: minor
+swc_core: minor
+---
+
+feat(es/minifier): Optimize number to int
diff --git a/crates/swc_ecma_minifier/src/compress/pure/mod.rs b/crates/swc_ecma_minifier/src/compress/pure/mod.rs
index 9d2e49dfa7..ca0fa7f46d 100644
--- a/crates/swc_ecma_minifier/src/compress/pure/mod.rs
+++ b/crates/swc_ecma_minifier/src/compress/pure/mod.rs
@@ -612,6 +612,8 @@ impl VisitMut for Pure<'_> {
         }
 
         self.eval_member_expr(e);
+
+        self.optimize_to_int(e);
     }
 
     fn visit_mut_expr_or_spreads(&mut self, nodes: &mut Vec<ExprOrSpread>) {
diff --git a/crates/swc_ecma_minifier/src/compress/pure/numbers.rs b/crates/swc_ecma_minifier/src/compress/pure/numbers.rs
index 8f36e009fe..39fa395782 100644
--- a/crates/swc_ecma_minifier/src/compress/pure/numbers.rs
+++ b/crates/swc_ecma_minifier/src/compress/pure/numbers.rs
@@ -1,4 +1,4 @@
-use swc_common::{util::take::Take, EqIgnoreSpan, DUMMY_SP};
+use swc_common::{util::take::Take, EqIgnoreSpan, Spanned, DUMMY_SP};
 use swc_ecma_ast::*;
 use swc_ecma_utils::num_from_str;
 
@@ -138,4 +138,109 @@ impl Pure<'_> {
             _ => (),
         }
     }
+
+    pub(super) fn optimize_to_int(&mut self, e: &mut Expr) {
+        let span = e.span();
+
+        match e {
+            Expr::Bin(bin) => match (bin.op, &mut *bin.left, &mut *bin.right) {
+                (op!("|"), Expr::Bin(bin_inner), Expr::Lit(Lit::Num(n)))
+                | (op!("|"), Expr::Lit(Lit::Num(n)), Expr::Bin(bin_inner))
+                    if matches!(
+                        bin_inner.op,
+                        op!("<<") | op!(">>") | op!(">>>") | op!("|") | op!("^") | op!("&")
+                    ) && n.value == 0.0 =>
+                {
+                    report_change!("numbers: Turn '(a & b) | 0' into 'a & b'");
+                    self.changed = true;
+
+                    let value = bin_inner.take();
+
+                    *bin = BinExpr { span, ..value };
+                }
+
+                (
+                    op!("|"),
+                    Expr::Unary(u @ UnaryExpr { op: op!("~"), .. }),
+                    Expr::Lit(Lit::Num(Number { value: 0.0, .. })),
+                )
+                | (
+                    op!("|"),
+                    Expr::Lit(Lit::Num(Number { value: 0.0, .. })),
+                    Expr::Unary(u @ UnaryExpr { op: op!("~"), .. }),
+                ) => {
+                    report_change!("numbers: Turn '~a | 0' into '~a'");
+                    self.changed = true;
+
+                    let value = u.take();
+
+                    *e = Expr::Unary(value);
+                }
+
+                (
+                    op!("<<") | op!(">>") | op!("^"),
+                    _,
+                    Expr::Lit(Lit::Num(Number { value: 0.0, .. })),
+                ) => {
+                    report_change!("numbers: Turn 'a << 0' into 'a | 0'");
+                    self.changed = true;
+                    bin.op = op!("|");
+                }
+                (
+                    op!("&"),
+                    _,
+                    Expr::Lit(Lit::Num(
+                        n @ Number {
+                            value: 4294967295.0, // 2^32 - 1
+                            ..
+                        },
+                    )),
+                )
+                | (
+                    op!("&"),
+                    Expr::Lit(Lit::Num(
+                        n @ Number {
+                            value: 4294967295.0, // 2^32 - 1
+                            ..
+                        },
+                    )),
+                    _,
+                ) => {
+                    report_change!("numbers: Turn 'a & 0XFFFFFFFF' into 'a | 0'");
+                    self.changed = true;
+                    bin.op = op!("|");
+                    n.value = 0.0;
+                    n.raw = None;
+                }
+
+                _ => (),
+            },
+
+            Expr::Assign(
+                a @ AssignExpr {
+                    op: op!("<<=") | op!(">>=") | op!(">>>=") | op!("|=") | op!("^=") | op!("&="),
+                    ..
+                },
+            ) => {
+                if let Expr::Bin(BinExpr {
+                    op: op!("|"),
+                    left,
+                    right,
+                    ..
+                }) = &mut *a.right
+                {
+                    if let (e, Expr::Lit(Lit::Num(Number { value: 0.0, .. })))
+                    | (Expr::Lit(Lit::Num(Number { value: 0.0, .. })), e) =
+                        (&mut **left, &mut **right)
+                    {
+                        report_change!("numbers: Turn 'a |= b | 0' into 'a |= b'");
+                        self.changed = true;
+                        let value = e.take();
+                        *a.right = value;
+                    }
+                }
+            }
+            _ => (),
+        }
+    }
 }


Test patch:
diff --git a/crates/swc_ecma_minifier/tests/benches-full/d3.js b/crates/swc_ecma_minifier/tests/benches-full/d3.js
index 72eda3e7ca..ae94b8a618 100644
--- a/crates/swc_ecma_minifier/tests/benches-full/d3.js
+++ b/crates/swc_ecma_minifier/tests/benches-full/d3.js
@@ -3207,7 +3207,7 @@ function(global, factory) {
                 for(// Special case for the first row (y = -1, t2 = t3 = 0).
                 x = y = -1, cases[(t1 = values[0] >= value) << 1].forEach(stitch); ++x < dx - 1;)cases[(t0 = t1) | (t1 = values[x + 1] >= value) << 1].forEach(stitch);
                 // General case for the intermediate rows.
-                for(cases[t1 << 0].forEach(stitch); ++y < dy - 1;){
+                for(cases[0 | t1].forEach(stitch); ++y < dy - 1;){
                     for(x = -1, cases[(t1 = values[y * dx + dx] >= value) << 1 | (t2 = values[y * dx] >= value) << 2].forEach(stitch); ++x < dx - 1;)t0 = t1, t1 = values[y * dx + dx + x + 1] >= value, t3 = t2, cases[t0 | t1 << 1 | (t2 = values[y * dx + x + 1] >= value) << 2 | t3 << 3].forEach(stitch);
                     cases[t1 | t2 << 3].forEach(stitch);
                 }
diff --git a/crates/swc_ecma_minifier/tests/benches-full/three.js b/crates/swc_ecma_minifier/tests/benches-full/three.js
index b587dfd438..64426ca264 100644
--- a/crates/swc_ecma_minifier/tests/benches-full/three.js
+++ b/crates/swc_ecma_minifier/tests/benches-full/three.js
@@ -1683,15 +1683,15 @@ function(global, factory) {
         }
         var _proto = Layers.prototype;
         return _proto.set = function(channel) {
-            this.mask = 1 << channel | 0;
+            this.mask = 1 << channel;
         }, _proto.enable = function(channel) {
-            this.mask |= 1 << channel | 0;
+            this.mask |= 1 << channel;
         }, _proto.enableAll = function() {
             this.mask = -1;
         }, _proto.toggle = function(channel) {
-            this.mask ^= 1 << channel | 0;
+            this.mask ^= 1 << channel;
         }, _proto.disable = function(channel) {
-            this.mask &= ~(1 << channel | 0);
+            this.mask &= ~(1 << channel);
         }, _proto.disableAll = function() {
             this.mask = 0;
         }, _proto.test = function(layers) {
@@ -2356,7 +2356,7 @@ function(global, factory) {
         }, _proto.convertLinearToSRGB = function() {
             return this.copyLinearToSRGB(this), this;
         }, _proto.getHex = function() {
-            return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0;
+            return 255 * this.r << 16 ^ 255 * this.g << 8 ^ (255 * this.b | 0);
         }, _proto.getHexString = function() {
             return ('000000' + this.getHex().toString(16)).slice(-6);
         }, _proto.getHSL = function(target) {
@@ -6337,7 +6337,7 @@ function(global, factory) {
         ]), 3));
         var fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical), scope = this;
         function getDepthMaterialVariant(useMorphing, useSkinning, useInstancing) {
-            var index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2, material = _depthMaterials[index];
+            var index = 0 | useMorphing | useSkinning << 1 | useInstancing << 2, material = _depthMaterials[index];
             return void 0 === material && (material = new MeshDepthMaterial({
                 depthPacking: 3201,
                 morphTargets: useMorphing,
@@ -6345,7 +6345,7 @@ function(global, factory) {
             }), _depthMaterials[index] = material), material;
         }
         function getDistanceMaterialVariant(useMorphing, useSkinning, useInstancing) {
-            var index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2, material = _distanceMaterials[index];
+            var index = 0 | useMorphing | useSkinning << 1 | useInstancing << 2, material = _distanceMaterials[index];
             return void 0 === material && (material = new MeshDistanceMaterial({
                 morphTargets: useMorphing,
                 skinning: useSkinning
diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10281/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/10281/input.js
new file mode 100644
index 0000000000..d6b96bdbfa
--- /dev/null
+++ b/crates/swc_ecma_minifier/tests/fixture/issues/10281/input.js
@@ -0,0 +1,13 @@
+export function bitwise1(a, b) {
+    return (a & b) | 0;
+}
+
+export function bitwise2(a) {
+    return ~a | 0;
+}
+
+export function bitwise3(a, b) {
+    a ^= b | 0;
+
+    console.log(a | b, a & b);
+}
diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/10281/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/10281/output.js
new file mode 100644
index 0000000000..259052a12c
--- /dev/null
+++ b/crates/swc_ecma_minifier/tests/fixture/issues/10281/output.js
@@ -0,0 +1,9 @@
+export function bitwise1(a, b) {
+    return a & b;
+}
+export function bitwise2(a) {
+    return ~a;
+}
+export function bitwise3(a, b) {
+    console.log((a ^= b) | b, a & b);
+}
diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/3256/2/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/3256/2/output.js
index 4a4516a82e..432be310b2 100644
--- a/crates/swc_ecma_minifier/tests/fixture/issues/3256/2/output.js
+++ b/crates/swc_ecma_minifier/tests/fixture/issues/3256/2/output.js
@@ -1,6 +1,6 @@
 // real life example taken from https://github.com/nodeca/pako/blob/master/lib/zlib/adler32.js#L26
 export default ((adler, buf, len, pos)=>{
-    let s1 = 0xffff & adler | 0, s2 = adler >>> 16 & 0xffff | 0, n = 0;
+    let s1 = 0xffff & adler, s2 = adler >>> 16 & 0xffff, n = 0;
     for(; 0 !== len;){
         // Set limit ~ twice less than 5552, to keep
         // s2 in 31-bits, because we force signed ints.
@@ -10,5 +10,5 @@ export default ((adler, buf, len, pos)=>{
         while (--n)
         s1 %= 65521, s2 %= 65521;
     }
-    return s1 | s2 << 16 | 0;
+    return s1 | s2 << 16;
 });
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js
index 84769ac89f..da467ce117 100644
--- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js
+++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js
@@ -6821,7 +6821,7 @@
                     checkInt(this, value, offset, byteLength, limit - 1, -limit);
                 }
                 var i = 0, mul = 1, sub = 0;
-                for(this[offset] = 0xff & value; ++i < byteLength && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i - 1] && (sub = 1), this[offset + i] = (value / mul >> 0) - sub & 0xff;
+                for(this[offset] = 0xff & value; ++i < byteLength && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i - 1] && (sub = 1), this[offset + i] = (value / mul | 0) - sub & 0xff;
                 return offset + byteLength;
             }, Buffer.prototype.writeIntBE = function(value, offset, byteLength, noAssert) {
                 if (value *= 1, offset >>>= 0, !noAssert) {
@@ -6829,7 +6829,7 @@
                     checkInt(this, value, offset, byteLength, limit - 1, -limit);
                 }
                 var i = byteLength - 1, mul = 1, sub = 0;
-                for(this[offset + i] = 0xff & value; --i >= 0 && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i + 1] && (sub = 1), this[offset + i] = (value / mul >> 0) - sub & 0xff;
+                for(this[offset + i] = 0xff & value; --i >= 0 && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i + 1] && (sub = 1), this[offset + i] = (value / mul | 0) - sub & 0xff;
                 return offset + byteLength;
             }, Buffer.prototype.writeInt8 = function(value, offset, noAssert) {
                 return value *= 1, offset >>>= 0, noAssert || checkInt(this, value, offset, 1, 0x7f, -128), value < 0 && (value = 0xff + value + 1), this[offset] = 0xff & value, offset + 1;
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js
index 9377efaab0..15f608ae73 100644
--- a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js
+++ b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js
@@ -600,7 +600,7 @@
                             checkInt(this, e, r, t, n - 1, -n);
                         }
                         var i = 0, o = 1, u = 0;
-                        for(this[r] = 255 & e; ++i < t && (o *= 256);)e < 0 && 0 === u && 0 !== this[r + i - 1] && (u = 1), this[r + i] = (e / o >> 0) - u & 255;
+                        for(this[r] = 255 & e; ++i < t && (o *= 256);)e < 0 && 0 === u && 0 !== this[r + i - 1] && (u = 1), this[r + i] = (e / o | 0) - u & 255;
                         return r + t;
                     }, Buffer.prototype.writeIntBE = function(e, r, t, f) {
                         if (e *= 1, r >>>= 0, !f) {
@@ -608,7 +608,7 @@
                             checkInt(this, e, r, t, n - 1, -n);
                         }
                         var i = t - 1, o = 1, u = 0;
-                        for(this[r + i] = 255 & e; --i >= 0 && (o *= 256);)e < 0 && 0 === u && 0 !== this[r + i + 1] && (u = 1), this[r + i] = (e / o >> 0) - u & 255;
+                        for(this[r + i] = 255 & e; --i >= 0 && (o *= 256);)e < 0 && 0 === u && 0 !== this[r + i + 1] && (u = 1), this[r + i] = (e / o | 0) - u & 255;
                         return r + t;
                     }, Buffer.prototype.writeInt8 = function(e, r, t) {
                         return e *= 1, r >>>= 0, t || checkInt(this, e, r, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[r] = 255 & e, r + 1;
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js
index f0e1df9bfd..ad4b7373f4 100644
--- a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js
+++ b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js
@@ -9868,10 +9868,10 @@
                     return n;
                 }
                 return function(r, s) {
-                    var c = a(s = s || {}, "async", !1), f = {}, p = a(s, e, !1), d = {}, h = a(s, t, "\u00AD"), y = r.patterns.map(l), g = a(s, n, 5) >> 0, v = a(s, "html", !1), b = h + g;
+                    var c = a(s = s || {}, "async", !1), f = {}, p = a(s, e, !1), d = {}, h = a(s, t, "\u00AD"), y = r.patterns.map(l), g = 0 | a(s, n, 5), v = a(s, "html", !1), b = h + g;
                     if (d[b] = u(r, h), f[b] = o(d[b]), c && !("Promise" in i)) throw Error("Failed to create hyphenator: Could not find global Promise object, needed for hyphenator to work in async mode");
                     return function(i, l) {
-                        var s = a(l = l || {}, e, p), b = a(l, t, h), m = a(l, n, g) >> 0, D = b + m;
+                        var s = a(l = l || {}, e, p), b = a(l, t, h), m = 0 | a(l, n, g), D = b + m;
                         return d[D] || (d[D] = u(r, b)), f[D] || (f[D] = o(d[D])), function(e, t, r, n, i, o, a, u) {
                             var l, s, c, f, p, d, h = "", y = (l = RegExp.prototype.test.bind(/\s/), f = 0, [
                                 function() {
@@ -19083,13 +19083,13 @@
                     },
                     796: function(e) {
                         e.exports = function(e, t, r, n) {
-                            for(var i = 65535 & e | 0, o = e >>> 16 & 65535 | 0, a = 0; 0 !== r;){
+                            for(var i = 65535 & e, o = e >>> 16 & 65535, a = 0; 0 !== r;){
                                 a = r > 2e3 ? 2e3 : r, r -= a;
                                 do o = o + (i = i + t[n++] | 0) | 0;
                                 while (--a)
                                 i %= 65521, o %= 65521;
                             }
-                            return i | o << 16 | 0;
+                            return i | o << 16;
                         };
                     },
                     234: function(e) {
@@ -19851,7 +19851,7 @@
                                             if (0 === b) break t;
                                             b--, D += p[h++] << w, w += 8;
                                         }
-                                        if (D !== (4294967295 & f.total)) {
+                                        if (D !== (0 | f.total)) {
                                             e.msg = "incorrect length check", f.mode = 30;
                                             break;
                                         }
@@ -20028,7 +20028,7 @@
                             if (0 === e ? (R = M = f, b = 19) : 1 === e ? (R = i, I -= 257, M = o, N -= 257, b = 256) : (R = a, M = u, b = -1), F = 0, x = 0, _ = S, v = c, T = k, O = 0, y = -1, g = (P = 1 << k) - 1, 1 === e && P > 852 || 2 === e && P > 592) return 1;
                             for(;;){
                                 m = _ - O, f[x] < b ? (D = 0, w = f[x]) : f[x] > b ? (D = M[N + f[x]], w = R[I + f[x]]) : (D = 96, w = 0), d = 1 << _ - O, S = h = 1 << T;
-                                do s[v + (F >> O) + (h -= d)] = m << 24 | D << 16 | w | 0;
+                                do s[v + (F >> O) + (h -= d)] = m << 24 | D << 16 | w;
                                 while (0 !== h)
                                 for(d = 1 << _ - 1; F & d;)d >>= 1;
                                 if (0 !== d ? (F &= d - 1, F += d) : F = 0, x++, 0 == --j[_]) {
@@ -20038,7 +20038,7 @@
                                 if (_ > k && (F & g) !== y) {
                                     for(0 === O && (O = k), v += S, C = 1 << (T = _ - O); T + O < A && !((C -= j[T + O]) <= 0);)T++, C <<= 1;
                                     if (P += 1 << T, 1 === e && P > 852 || 2 === e && P > 592) return 1;
-                                    s[y = F & g] = k << 24 | T << 16 | v - c | 0;
+                                    s[y = F & g] = k << 24 | T << 16 | v - c;
                                 }
                             }
                             return 0 !== F && (s[v + F] = _ - O << 24 | 4194304), p.bits = k, 0;
@@ -20839,7 +20839,7 @@
                             D(this, e, t, r, i - 1, -i);
                         }
                         var o = 0, a = 1, u = 0;
-                        for(this[t] = 255 & e; ++o < r && (a *= 256);)e < 0 && 0 === u && 0 !== this[t + o - 1] && (u = 1), this[t + o] = (e / a >> 0) - u & 255;
+                        for(this[t] = 255 & e; ++o < r && (a *= 256);)e < 0 && 0 === u && 0 !== this[t + o - 1] && (u = 1), this[t + o] = (e / a | 0) - u & 255;
                         return t + r;
                     }, u.prototype.writeIntBE = function(e, t, r, n) {
                         if (e *= 1, t >>>= 0, !n) {
@@ -20847,7 +20847,7 @@
                             D(this, e, t, r, i - 1, -i);
                         }
                         var o = r - 1, a = 1, u = 0;
-                        for(this[t + o] = 255 & e; --o >= 0 && (a *= 256);)e < 0 && 0 === u && 0 !== this[t + o + 1] && (u = 1), this[t + o] = (e / a >> 0) - u & 255;
+                        for(this[t + o] = 255 & e; --o >= 0 && (a *= 256);)e < 0 && 0 === u && 0 !== this[t + o + 1] && (u = 1), this[t + o] = (e / a | 0) - u & 255;
                         return t + r;
                     }, u.prototype.writeInt8 = function(e, t, r) {
                         return e *= 1, t >>>= 0, r || D(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1;
diff --git a/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js b/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js
index c12f87a4af..953177054e 100644
--- a/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js
+++ b/crates/swc_ecma_minifier/tests/fixture/next/wrap-contracts/output.js
@@ -11356,7 +11356,7 @@
                     checkInt(this, value, offset, byteLength, limit - 1, -limit);
                 }
                 let i = 0, mul = 1, sub = 0;
-                for(this[offset] = 0xFF & value; ++i < byteLength && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i - 1] && (sub = 1), this[offset + i] = (value / mul >> 0) - sub & 0xFF;
+                for(this[offset] = 0xFF & value; ++i < byteLength && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i - 1] && (sub = 1), this[offset + i] = (value / mul | 0) - sub & 0xFF;
                 return offset + byteLength;
             }, Buffer.prototype.writeIntBE = function(value, offset, byteLength, noAssert) {
                 if (value *= 1, offset >>>= 0, !noAssert) {
@@ -11364,7 +11364,7 @@
                     checkInt(this, value, offset, byteLength, limit - 1, -limit);
                 }
                 let i = byteLength - 1, mul = 1, sub = 0;
-                for(this[offset + i] = 0xFF & value; --i >= 0 && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i + 1] && (sub = 1), this[offset + i] = (value / mul >> 0) - sub & 0xFF;
+                for(this[offset + i] = 0xFF & value; --i >= 0 && (mul *= 0x100);)value < 0 && 0 === sub && 0 !== this[offset + i + 1] && (sub = 1), this[offset + i] = (value / mul | 0) - sub & 0xFF;
                 return offset + byteLength;
             }, Buffer.prototype.writeInt8 = function(value, offset, noAssert) {
                 return value *= 1, offset >>>= 0, noAssert || checkInt(this, value, offset, 1, 0x7f, -128), value < 0 && (value = 0xff + value + 1), this[offset] = 0xff & value, offset + 1;
@@ -16407,7 +16407,7 @@
                             else for(i = this.start; index < length && i < 64; ++index)(code = message.charCodeAt(index)) < 0x80 ? blocks[i >> 2] |= code << SHIFT[3 & i++] : (code < 0x800 ? blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[3 & i++] : (code < 0xd800 || code >= 0xe000 ? blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[3 & i++] : (code = 0x10000 + ((0x3ff & code) << 10 | 0x3ff & message.charCodeAt(++index)), blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[3 & i++], blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[3 & i++]), blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[3 & i++]), blocks[i >> 2] |= (0x80 | 0x3f & code) << SHIFT[3 & i++]);
                             this.lastByteIndex = i, this.bytes += i - this.start, i >= 64 ? (this.block = blocks[16], this.start = i - 64, this.hash(), this.hashed = !0) : this.start = i;
                         }
-                        return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
+                        return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 | 0, this.bytes = this.bytes % 4294967296), this;
                     }
                 }, Sha256.prototype.finalize = function() {
                     if (!this.finalized) {
@@ -16418,9 +16418,9 @@
                 }, Sha256.prototype.hash = function() {
                     var j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc, a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, h = this.h7, blocks = this.blocks;
                     for(j = 16; j < 64; ++j)s0 = (// rightrotate
-                    (t1 = blocks[j - 15]) >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3, s1 = ((t1 = blocks[j - 2]) >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10, blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0;
-                    for(j = 0, bc = b & c; j < 64; j += 4)this.first ? (this.is224 ? (ab = 300032, h = (t1 = blocks[0] - 1413257819) - 150054599 << 0, d = t1 + 24177077 << 0) : (ab = 704751109, h = (t1 = blocks[0] - 210244248) - 1521486534 << 0, d = t1 + 143694565 << 0), this.first = !1) : (s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10), s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7), maj = (ab = a & b) ^ a & c ^ bc, t1 = h + s1 + (ch = e & f ^ ~e & g) + K[j] + blocks[j], t2 = s0 + maj, h = d + t1 << 0, d = t1 + t2 << 0), s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10), s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7), maj = (da = d & a) ^ d & b ^ ab, t1 = g + s1 + (ch = h & e ^ ~h & f) + K[j + 1] + blocks[j + 1], t2 = s0 + maj, g = c + t1 << 0, s0 = ((c = t1 + t2 << 0) >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10), s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7), maj = (cd = c & d) ^ c & a ^ da, t1 = f + s1 + (ch = g & h ^ ~g & e) + K[j + 2] + blocks[j + 2], t2 = s0 + maj, f = b + t1 << 0, s0 = ((b = t1 + t2 << 0) >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10), s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7), maj = (bc = b & c) ^ b & d ^ cd, t1 = e + s1 + (ch = f & g ^ ~f & h) + K[j + 3] + blocks[j + 3], t2 = s0 + maj, e = a + t1 << 0, a = t1 + t2 << 0;
-                    this.h0 = this.h0 + a << 0, this.h1 = this.h1 + b << 0, this.h2 = this.h2 + c << 0, this.h3 = this.h3 + d << 0, this.h4 = this.h4 + e << 0, this.h5 = this.h5 + f << 0, this.h6 = this.h6 + g << 0, this.h7 = this.h7 + h << 0;
+                    (t1 = blocks[j - 15]) >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3, s1 = ((t1 = blocks[j - 2]) >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10, blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 | 0;
+                    for(j = 0, bc = b & c; j < 64; j += 4)this.first ? (this.is224 ? (ab = 300032, h = (t1 = blocks[0] - 1413257819) - 150054599 | 0, d = t1 + 24177077 | 0) : (ab = 704751109, h = (t1 = blocks[0] - 210244248) - 1521486534 | 0, d = t1 + 143694565 | 0), this.first = !1) : (s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10), s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7), maj = (ab = a & b) ^ a & c ^ bc, t1 = h + s1 + (ch = e & f ^ ~e & g) + K[j] + blocks[j], t2 = s0 + maj, h = d + t1 | 0, d = t1 + t2 | 0), s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10), s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7), maj = (da = d & a) ^ d & b ^ ab, t1 = g + s1 + (ch = h & e ^ ~h & f) + K[j + 1] + blocks[j + 1], t2 = s0 + maj, g = c + t1 | 0, s0 = ((c = t1 + t2 | 0) >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10), s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7), maj = (cd = c & d) ^ c & a ^ da, t1 = f + s1 + (ch = g & h ^ ~g & e) + K[j + 2] + blocks[j + 2], t2 = s0 + maj, f = b + t1 | 0, s0 = ((b = t1 + t2 | 0) >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10), s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7), maj = (bc = b & c) ^ b & d ^ cd, t1 = e + s1 + (ch = f & g ^ ~f & h) + K[j + 3] + blocks[j + 3], t2 = s0 + maj, e = a + t1 | 0, a = t1 + t2 | 0;
+                    this.h0 = this.h0 + a | 0, this.h1 = this.h1 + b | 0, this.h2 = this.h2 + c | 0, this.h3 = this.h3 + d | 0, this.h4 = this.h4 + e | 0, this.h5 = this.h5 + f | 0, this.h6 = this.h6 + g | 0, this.h7 = this.h7 + h | 0;
                 }, Sha256.prototype.hex = function() {
                     this.finalize();
                     var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7, hex = HEX_CHARS[h0 >> 28 & 0x0F] + HEX_CHARS[h0 >> 24 & 0x0F] + HEX_CHARS[h0 >> 20 & 0x0F] + HEX_CHARS[h0 >> 16 & 0x0F] + HEX_CHARS[h0 >> 12 & 0x0F] + HEX_CHARS[h0 >> 8 & 0x0F] + HEX_CHARS[h0 >> 4 & 0x0F] + HEX_CHARS[0x0F & h0] + HEX_CHARS[h1 >> 28 & 0x0F] + HEX_CHARS[h1 >> 24 & 0x0F] + HEX_CHARS[h1 >> 20 & 0x0F] + HEX_CHARS[h1 >> 16 & 0x0F] + HEX_CHARS[h1 >> 12 & 0x0F] + HEX_CHARS[h1 >> 8 & 0x0F] + HEX_CHARS[h1 >> 4 & 0x0F] + HEX_CHARS[0x0F & h1] + HEX_CHARS[h2 >> 28 & 0x0F] + HEX_CHARS[h2 >> 24 & 0x0F] + HEX_CHARS[h2 >> 20 & 0x0F] + HEX_CHARS[h2 >> 16 & 0x0F] + HEX_CHARS[h2 >> 12 & 0x0F] + HEX_CHARS[h2 >> 8 & 0x0F] + HEX_CHARS[h2 >> 4 & 0x0F] + HEX_CHARS[0x0F & h2] + HEX_CHARS[h3 >> 28 & 0x0F] + HEX_CHARS[h3 >> 24 & 0x0F] + HEX_CHARS[h3 >> 20 & 0x0F] + HEX_CHARS[h3 >> 16 & 0x0F] + HEX_CHARS[h3 >> 12 & 0x0F] + HEX_CHARS[h3 >> 8 & 0x0F] + HEX_CHARS[h3 >> 4 & 0x0F] + HEX_CHARS[0x0F & h3] + HEX_CHARS[h4 >> 28 & 0x0F] + HEX_CHARS[h4 >> 24 & 0x0F] + HEX_CHARS[h4 >> 20 & 0x0F] + HEX_CHARS[h4 >> 16 & 0x0F] + HEX_CHARS[h4 >> 12 & 0x0F] + HEX_CHARS[h4 >> 8 & 0x0F] + HEX_CHARS[h4 >> 4 & 0x0F] + HEX_CHARS[0x0F & h4] + HEX_CHARS[h5 >> 28 & 0x0F] + HEX_CHARS[h5 >> 24 & 0x0F] + HEX_CHARS[h5 >> 20 & 0x0F] + HEX_CHARS[h5 >> 16 & 0x0F] + HEX_CHARS[h5 >> 12 & 0x0F] + HEX_CHARS[h5 >> 8 & 0x0F] + HEX_CHARS[h5 >> 4 & 0x0F] + HEX_CHARS[0x0F & h5] + HEX_CHARS[h6 >> 28 & 0x0F] + HEX_CHARS[h6 >> 24 & 0x0F] + HEX_CHARS[h6 >> 20 & 0x0F] + HEX_CHARS[h6 >> 16 & 0x0F] + HEX_CHARS[h6 >> 12 & 0x0F] + HEX_CHARS[h6 >> 8 & 0x0F] + HEX_CHARS[h6 >> 4 & 0x0F] + HEX_CHARS[0x0F & h6];
@@ -16774,7 +16774,7 @@
                         else for(i = this.start; index < length && i < 128; ++index)(code = message.charCodeAt(index)) < 0x80 ? blocks[i >> 2] |= code << SHIFT[3 & i++] : (code < 0x800 ? blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[3 & i++] : (code < 0xd800 || code >= 0xe000 ? blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[3 & i++] : (code = 0x10000 + ((0x3ff & code) << 10 | 0x3ff & message.charCodeAt(++index)), blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[3 & i++], blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[3 & i++]), blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[3 & i++]), blocks[i >> 2] |= (0x80 | 0x3f & code) << SHIFT[3 & i++]);
                         this.lastByteIndex = i, this.bytes += i - this.start, i >= 128 ? (this.block = blocks[32], this.start = i - 128, this.hash(), this.hashed = !0) : this.start = i;
                     }
-                    return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
+                    return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 | 0, this.bytes = this.bytes % 4294967296), this;
                 }, Sha512.prototype.finalize = function() {
                     if (!this.finalized) {
                         this.finalized = !0;
diff --git a/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/assign/output.js b/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/assign/output.js
index 171b03053d..307810464f 100644
--- a/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/assign/output.js
+++ b/crates/swc_ecma_minifier/tests/terser/compress/pure_funcs/assign/output.js
@@ -2,5 +2,5 @@ var a;
 function f(b) {
     a = foo();
     b *= 4 + foo();
-    c >>= 0 | foo();
+    c >>= foo();
 }