Build SkOpts_crc32 on ARM64
Builds Skia with the SkOpts_crc32 optimization on ARM64, aligning with
Chromium's //skia/BUILD.gn.
Bug: pdfium:1874
Change-Id: I6e26da99d8c8a3dd9b96790093bb5bf270813c5e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/100611
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: K. Moon <kmoon@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index 6eae4bb..bbcc765 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -410,7 +410,14 @@
visibility = [ ":skia" ]
}
-# Separated out so it can be compiled with different flags for SSE.
+# Bits that involve special vector-y hardware.
+if (current_cpu == "arm64") {
+ skia_source_set("skia_opts_crc32") {
+ sources = skia_opts.crc32_sources
+ cflags = [ "-march=armv8-a+crc" ]
+ visibility = [ ":skia_opts" ]
+ }
+}
if (current_cpu == "x86" || current_cpu == "x64") {
skia_source_set("skia_opts_sse3") {
sources = skia_opts.ssse3_sources
@@ -498,7 +505,7 @@
}
}
} else if (current_cpu == "arm64") {
- # Conditional and empty body needed to avoid assert() below.
+ deps = [ ":skia_opts_crc32" ]
} else if (current_cpu == "mipsel" || current_cpu == "mips64el") {
cflags += [ "-fomit-frame-pointer" ]
} else {