{"id":3186,"date":"2026-08-07T14:27:25","date_gmt":"2026-08-07T05:27:25","guid":{"rendered":"https:\/\/bokumin.org\/blog\/?p=3186"},"modified":"2026-08-07T14:27:26","modified_gmt":"2026-08-07T05:27:26","slug":"freebsd-ports%e3%81%a7cputypenative%e3%82%92%e8%a9%a6%e3%81%99gmplibargon2","status":"publish","type":"post","link":"https:\/\/bokumin.org\/blog\/2026\/08\/07\/freebsd-ports%e3%81%a7cputypenative%e3%82%92%e8%a9%a6%e3%81%99gmplibargon2\/","title":{"rendered":"FreeBSD ports\u3067CPUTYPE=native\u3092\u8a66\u3059(GMP,libargon2)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Tuning FreeBSD ports with CPUTYPE=native: GMP vs libargon2<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">FreeBSD\u306epkg\u3067\u5165\u308b\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u57fa\u672c\u7684\u306b\u6c4e\u7528amd64\u30bf\u30fc\u30b2\u30c3\u30c8(\u3060\u3044\u305f\u3044SSE2\u301cx86-64-v2\u7a0b\u5ea6)\u5411\u3051\u306b<code>-O2<\/code>\u3067\u30d3\u30eb\u30c9\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u624b\u5143\u306e\u30b5\u30fc\u30d0\u306fAVX2\u3084AES-NI\u306a\u3069\u3092\u3061\u3083\u3093\u3068\u7a4d\u3093\u3067\u3044\u308bCPU\u306a\u306e\u306b\u3001\u305d\u306e\u6069\u6075\u3092\u53d7\u3051\u305a\u306b\u3044\u308b\u306e\u306f\u3082\u3063\u305f\u3044\u306a\u3044\u306a\u3068\u601d\u3044\u3001ports\u3067\u518d\u69cb\u7bc9\u3057\u3066<code>CPUTYPE=native<\/code>\u3092\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5168\u90e8\u3092ports\u5316\u3059\u308b\u306e\u306f\u30d3\u30eb\u30c9\u6642\u9593\u7684\u306b\u5272\u306b\u5408\u308f\u306a\u3044\u306e\u3067\u3001\u8a08\u7b97\u96c6\u7d04\u7cfb\u3067\u6069\u6075\u304c\u51fa\u3084\u3059\u305d\u3046\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u30922\u3064\u3060\u3051\u9078\u3093\u3067\u691c\u8a3c\u3057\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u79c1\u306e\u74b0\u5883\u306e\u4f9d\u5b58\u95a2\u4fc2\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>math\/gmp<\/code> \u2014 \u591a\u500d\u9577\u6f14\u7b97\u30e9\u30a4\u30d6\u30e9\u30ea\u3002gcc14 \/ mpfr \/ mpc \u304c\u4f9d\u5b58<\/li>\n\n\n\n<li><code>security\/libargon2<\/code> \u2014 \u30d1\u30b9\u30ef\u30fc\u30c9\u30cf\u30c3\u30b7\u30e5\u95a2\u6570Argon2\u306e\u5b9f\u88c5\u3002php83\u304c\u4f9d\u5b58<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u74b0\u5883<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>FreeBSD amd64 14.4<\/li>\n\n\n\n<li>CPU: Intel(R) Xeon(R) CPU E5-2650L v4 @ 1.70GHz(Broadwell\u4e16\u4ee3\u300128\u30b9\u30ec\u30c3\u30c9)<\/li>\n\n\n\n<li>\u5bfe\u5fdc\u3059\u308b\u62e1\u5f35\u547d\u4ee4: AVX2, FMA, BMI1\/BMI2, ADX, AES-NI, PCLMULQDQ, RDSEED, F16C(SHA-NI\u306f\u975e\u642d\u8f09)<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>hw.model: Intel(R) Xeon(R) CPU E5-2650L v4 @ 1.70GHz\nhw.ncpu: 28<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">hw.model:<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Intel<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">R<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #CE9178\">Xeon<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">R<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #CE9178\">CPU<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">E5-2650L<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">v4<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">@<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1.70<\/span><span style=\"color: #CE9178\">GHz<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">hw.ncpu:<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">28<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Structured Extended Features=0x21cbfbb&lt;FSGSBASE,TSCADJ,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,PQM,NFPUSG,PQE,RDSEED,ADX,SMAP,PROCTRACE><\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">Structured<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Extended<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Features=<\/span><span style=\"color: #B5CEA8\">0x21cbfbb<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #CE9178\">FSGSBASE,TSCADJ,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,PQM,NFPUSG,PQE,RDSEED,ADX,SMAP,PROCTRAC<\/span><span style=\"color: #D4D4D4\">E&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\/etc\/make.conf\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6765\u306fnative\u3060\u3051\u3067\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5ff5\u306e\u70ba\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>CPUTYPE=native\nCFLAGS+= -O2 -pipe\nMAKE_JOBS_NUMBER=4<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">CPUTYPE<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">native<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">CFLAGS<\/span><span style=\"color: #D4D4D4\">+= <\/span><span style=\"color: #DCDCAA\">-O2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-pipe<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">MAKE_JOBS_NUMBER<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #B5CEA8\">4<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d3\u30eb\u30c9<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cd \/usr\/ports\/math\/gmp\nmake install clean\n\ncd \/usr\/ports\/security\/libargon2\nmake install clean<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">cd<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/usr\/ports\/math\/gmp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">make<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">install<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">clean<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">cd<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/usr\/ports\/security\/libargon2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">make<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">install<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">clean<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">native\u6700\u9069\u5316\u304c\u5b9f\u969b\u306b\u52b9\u3044\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30f3\u30d1\u30a4\u30e9\u304c\u3069\u306e\u62e1\u5f35\u547d\u4ee4\u3092\u524d\u63d0\u306b\u30b3\u30fc\u30c9\u751f\u6210\u3059\u308b\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3092\u307e\u305a\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cc -march=native -dM -E - &lt;\/dev\/null | grep -E \"AVX2|FMA|BMI2|ADX|__AES__\"\n\n#define __ADX__ 1\n#define __AES__ 1\n#define __AVX2__ 1\n#define __BMI2__ 1\n#define __FMA__ 1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">cc<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-march=native<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-dM<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-E<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">-<\/span><span style=\"color: #D4D4D4\"> &lt;<\/span><span style=\"color: #CE9178\">\/dev\/null<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">grep<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-E<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;AVX2|FMA|BMI2|ADX|__AES__&quot;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#define __ADX__ 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#define __AES__ 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#define __AVX2__ 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#define __BMI2__ 1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#define __FMA__ 1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">ports\u5074\u306eCFLAGS\u306b\u3082\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>make -V CFLAGS\n\n-O2 -pipe -O2 -pipe -march=native  -fstack-protector-strong -fno-strict-aliasing<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">make<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-V<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">CFLAGS<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">-O2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-pipe<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-O2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-pipe<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-march=native<\/span><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">-fstack-protector-strong<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-fno-strict-aliasing<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u203b <code>-O2 -pipe<\/code>\u304c2\u56de\u91cd\u8907\u3057\u3066\u3044\u308b\u306e\u306f\u3001ports\u6a19\u6e96\u306e\u30d5\u30e9\u30b0\u3068<code>\/etc\/make.conf<\/code>\u5074\u306e\u8a2d\u5b9a\u304c\u4e21\u65b9\u8f09\u3063\u3066\u3044\u308b\u3060\u3051\u3067\u5b9f\u5bb3\u306f\u3042\u308a\u307e\u305b\u3093<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u65b9\u6cd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">GMP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">3,000,000\u306e\u968e\u4e57\u3092\u8a08\u7b97\u3059\u308b\u3060\u3051\u306e\u5c0f\u3055\u306aC\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3001\u76f4\u63a5<code>libgmp<\/code>\u3092\u547c\u3073\u51fa\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>#include &lt;gmp.h>\n#include &lt;stdio.h>\n#include &lt;time.h>\n\nint main(void) {\n    mpz_t f;\n    mpz_init(f);\n\n    struct timespec t0, t1;\n    clock_gettime(CLOCK_MONOTONIC, &amp;t0);\n    mpz_fac_ui(f, 3000000);\n    clock_gettime(CLOCK_MONOTONIC, &amp;t1);\n\n    double elapsed = (t1.tv_sec - t0.tv_sec) + (t1.tv_nsec - t0.tv_nsec) \/ 1e9;\n    printf(\"%.3f sec (%zu row)\\n\", elapsed, mpz_sizeinbase(f, 10));\n\n    mpz_clear(f);\n    return 0;\n}\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">#include &lt;gmp.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#include &lt;stdio.h&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">#include &lt;time.h&gt;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">main<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">void<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #CE9178\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">mpz_t<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">f<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">mpz_init(f<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">struct<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">timespec<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">t0,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">t1<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">clock_gettime(CLOCK_MONOTONIC,<\/span><span style=\"color: #D4D4D4\"> &amp;<\/span><span style=\"color: #DCDCAA\">t0<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">mpz_fac_ui(f,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">3000000<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">clock_gettime(CLOCK_MONOTONIC,<\/span><span style=\"color: #D4D4D4\"> &amp;<\/span><span style=\"color: #DCDCAA\">t1<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">double<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">elapsed<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">=<\/span><span style=\"color: #D4D4D4\"> (t1.tv_sec <\/span><span style=\"color: #CE9178\">-<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">t0.tv_sec<\/span><span style=\"color: #D4D4D4\">) + (<\/span><span style=\"color: #DCDCAA\">t1.tv_nsec<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">-<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">t0.tv_nsec<\/span><span style=\"color: #D4D4D4\">) \/ 1e9;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">printf<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">&quot;%.3f sec (%zu row)\\n&quot;<\/span><span style=\"color: #DCDCAA\">,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">elapsed,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">mpz_sizeinbase<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">f,<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">10<\/span><span style=\"color: #D4D4D4\">));<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">mpz_clear(f<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cc -O2 -I\/usr\/local\/include -L\/usr\/local\/lib bench_gmp.c -lgmp -o bench_gmp<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">cc<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-O2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-I\/usr\/local\/include<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-L\/usr\/local\/lib<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">bench_gmp.c<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-lgmp<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-o<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">bench_gmp<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">libargon2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">port\u304c\u5165\u308c\u3066\u304f\u308c\u308bCLI\u30c4\u30fc\u30eb<code>argon2<\/code>\u3092\u305d\u306e\u307e\u307e\u4f7f\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>echo -n \"test-password\" | argon2 saltsaltsalt12 -t 50 -m 16 -p 4 -id<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-n<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;test-password&quot;<\/span><span style=\"color: #D4D4D4\"> | <\/span><span style=\"color: #DCDCAA\">argon2<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">saltsaltsalt12<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-t<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">50<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-m<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">16<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-p<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">4<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-id<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>argon2<\/code>\u30b3\u30de\u30f3\u30c9\u306f\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u30cf\u30c3\u30b7\u30e5\u5024\u30fb\u30a8\u30f3\u30b3\u30fc\u30c9\u6e08\u307f\u6587\u5b57\u5217\u306b\u52a0\u3048\u3066\u6240\u8981\u79d2\u6570\u307e\u3067\u51fa\u529b\u3057\u3066\u304f\u308c\u308b\u305f\u3081\u3001\u5225\u9014<code>time<\/code>\u306a\u3069\u3067\u8a08\u6e2c\u7528\u306b\u30e9\u30c3\u30d7\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3069\u3061\u3089\u3082\u3001<code>CPUTYPE=native<\/code>\u3067\u30d3\u30eb\u30c9\u3057\u305f\u72b6\u614b\u3068\u3001<code>make CPUTYPE= reinstall clean<\/code>\u3067\u4e00\u6642\u7684\u306b\u6c4e\u7528\u30d3\u30eb\u30c9\u3078\u5dee\u3057\u66ff\u3048\u305f\u72b6\u614b\u3092\u5207\u308a\u66ff\u3048\u3066\u8a08\u6e2c\u3057\u3066\u3044\u307e\u3059\u3002\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306esoname\u306f\u5909\u308f\u3089\u306a\u3044\u305f\u3081\u3001\u30d9\u30f3\u30c1\u7528\u30d0\u30a4\u30ca\u30ea\u81ea\u4f53\u3092\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GMP\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u7d50\u679c<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30d3\u30eb\u30c9<\/th><th>\u5b9f\u884c\u6642\u9593<\/th><\/tr><\/thead><tbody><tr><td>native(<code>-march=native<\/code>)<\/td><td>0.946\u79d2<\/td><\/tr><tr><td>\u6c4e\u7528(<code>CPUTYPE=<\/code>)<\/td><td>0.950\u79d2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u307b\u307c\u540c\u3058\u3002\u3080\u3057\u308d\u6c4e\u7528\u306e\u65b9\u304c\u308f\u305a\u304b\u306b\u9045\u3044\u304f\u3089\u3044\u3067\u3001\u5b9f\u8cea\u8aa4\u5dee\u306e\u7bc4\u56f2\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u306a\u305c\u5dee\u304c\u51fa\u306a\u304b\u3063\u305f\u306e\u304b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">GMP\u306e<code>configure<\/code>\u306f\u3001ports\u5074\u304b\u3089\u6e21\u3055\u308c\u308b<code>CFLAGS<\/code>\u3068\u306f\u5225\u306b\u3001<strong>\u81ea\u5206\u81ea\u8eab\u3067\u30db\u30b9\u30c8CPU\u3092\u691c\u51fa\u3057\u3066\u4f7f\u7528\u3059\u308b\u30a2\u30bb\u30f3\u30d6\u30ea\u5b9f\u88c5\u3092\u9078\u3076\u4ed5\u7d44\u307f<\/strong>\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002GMP\u306e<code>configure.ac<\/code>\u3092\u898b\u308b\u3068\u3001CPU\u4e16\u4ee3\u3054\u3068\u306b\u4f7f\u3046mpn\u30a2\u30bb\u30f3\u30d6\u30ea\u306e\u30d1\u30b9\u304c\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u3066\u3001Broadwell\u7cfb\u306eCPU\u3067\u3042\u308c\u3070<code>x86_64\/coreibwl<\/code>\u3068\u3044\u3046\u5c02\u7528\u5b9f\u88c5\u304c\u81ea\u52d5\u7684\u306b\u9078\u3070\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u9078\u629e\u306f<code>-march=native<\/code>\u306e\u6709\u7121\u306b\u95a2\u4fc2\u306a\u304f\u884c\u308f\u308c\u308b\u305f\u3081\u3001\u4e57\u7b97\u51e6\u7406\u306e\u5fc3\u81d3\u90e8(<code>mpn_mul<\/code>\u306a\u3069)\u306f\u6700\u521d\u304b\u3089\u6700\u9069\u5316\u6e08\u307f\u3060\u3063\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>grep -rn \"coreibwl\" mpn\/x86_64\/fat\/fat.c\n\nmpn\/x86_64\/fat\/fat.c:381:\t      CPUVEC_SETUP_coreibwl;\nmpn\/x86_64\/fat\/fat.c:396:\t      CPUVEC_SETUP_coreibwl;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">grep<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-rn<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;coreibwl&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">mpn\/x86_64\/fat\/fat.c<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">mpn\/x86_64\/fat\/fat.c:381:<\/span><span style=\"color: #D4D4D4\">\t      <\/span><span style=\"color: #CE9178\">CPUVEC_SETUP_coreibwl<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">mpn\/x86_64\/fat\/fat.c:396:<\/span><span style=\"color: #D4D4D4\">\t      <\/span><span style=\"color: #CE9178\">CPUVEC_SETUP_coreibwl<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>x86_64\/fat<\/code>\u306fGMP\u306e\u300cfat\u30d3\u30eb\u30c9\u300d\u3068\u547c\u3070\u308c\u308b\u4ed5\u7d44\u307f\u3067\u3001\u7279\u5b9aCPU\u3092\u6307\u5b9a\u305b\u305a\u306b\u6c4e\u7528\u30bf\u30fc\u30b2\u30c3\u30c8\u5411\u3051\u306b\u30d3\u30eb\u30c9\u3057\u305f\u5834\u5408\u3001\u5b9f\u884c\u30d0\u30a4\u30ca\u30ea\u304c\u8d77\u52d5\u6642\u306bCPUID\u547d\u4ee4\u3067\u30db\u30b9\u30c8CPU\u3092\u5224\u5b9a\u3057\u3001<code>coreibwl<\/code>\u3092\u542b\u3080\u8907\u6570\u306e\u6700\u9069\u5316\u6e08\u307f\u5b9f\u88c5\u304b\u3089\u9069\u5207\u306a\u3082\u306e\u3092\u52d5\u7684\u306b\u9078\u629e\u3057\u307e\u3059\u3002FreeBSD\u306epkg\u304c\u914d\u5e03\u3059\u308bGMP\u30d0\u30a4\u30ca\u30ea\u306f\u307e\u3055\u306b\u3053\u306e\u6c4e\u7528\u30bf\u30fc\u30b2\u30c3\u30c8\u5411\u3051\u30d3\u30eb\u30c9\u306b\u3042\u305f\u308b\u305f\u3081\u3001<code>CPUTYPE=native<\/code>\u3092\u6307\u5b9a\u3057\u306a\u304f\u3066\u3082\u3001\u5b9f\u884c\u6642\u306bBroadwell\u5411\u3051\u306e<code>coreibwl<\/code>\u5b9f\u88c5\u3078\u81ea\u52d5\u7684\u306b\u5207\u308a\u66ff\u308f\u3063\u3066\u3044\u305f\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3064\u307e\u308a\u300cGMP\u306fADX\/BMI2\u306e\u6069\u6075\u304c\u5927\u304d\u3044\u306f\u305a\u300d\u3068\u3044\u3046\u4e88\u60f3\u81ea\u4f53\u306f\u9593\u9055\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u305d\u306e\u6069\u6075\u306f<strong>pkg\u30d0\u30a4\u30ca\u30ea\u306e\u6642\u70b9\u3067\u65e2\u306b\u5f97\u3089\u308c\u3066\u3044\u305f<\/strong>\u3068\u3044\u3046\u306e\u304c\u5b9f\u614b\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5bfe\u5fdc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u69cb\u7bc9\u3092\u7dad\u6301\u3059\u308b\u610f\u5473\u304c\u8584\u3044\u3068\u5224\u65ad\u3057\u3001pkg\u7ba1\u7406\u306e\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u623b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sudo pkg unlock -y gmp\nsudo pkg install -f gmp<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">pkg<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">unlock<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-y<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">gmp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">pkg<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">install<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-f<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">gmp<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">pkg\u3068ports\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7(6.3.0)\u304c\u5909\u308f\u3089\u306a\u3044\u305f\u3081\u3001<code>-f<\/code>\u3092\u4ed8\u3051\u3066\u5f37\u5236\u7684\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">libargon2\u306e\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u7d50\u679c<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u56de\u6570<\/th><th>\u30d3\u30eb\u30c9<\/th><th>\u5b9f\u884c\u6642\u9593<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>native<\/td><td>5.906\u79d2<\/td><\/tr><tr><td>2<\/td><td>native<\/td><td>5.578\u79d2<\/td><\/tr><tr><td>3<\/td><td>native<\/td><td>5.672\u79d2<\/td><\/tr><tr><td>\u5e73\u5747<\/td><td>native<\/td><td>5.719\u79d2<\/td><\/tr><tr><td>1<\/td><td>\u6c4e\u7528<\/td><td>7.102\u79d2<\/td><\/tr><tr><td>2<\/td><td>\u6c4e\u7528<\/td><td>7.211\u79d2<\/td><\/tr><tr><td>\u5e73\u5747<\/td><td>\u6c4e\u7528<\/td><td>7.157\u79d2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">native\u7248\u306f\u5e73\u57475.719\u79d2\u3001\u6c4e\u7528\u7248\u306f\u5e73\u57477.157\u79d2\u3067\u3001<strong>\u7d0420%\u306e\u901f\u5ea6\u5dee<\/strong>\u304c\u51fa\u307e\u3057\u305f\u3002GMP\u3068\u9055\u3063\u3066\u518d\u73fe\u6027\u306e\u3042\u308b\u660e\u78ba\u306a\u5dee\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u306a\u305c\u5dee\u304c\u51fa\u305f\u306e\u304b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">libargon2\u306fGMP\u306e\u3088\u3046\u306a\u72ec\u81ea\u306eCPU\u691c\u51fa\u6a5f\u69cb\u3092\u6301\u305f\u305a\u3001AVX2\u5411\u3051\u306e\u5b9f\u88c5\u3092\u30b3\u30f3\u30d1\u30a4\u30e9\u306e<code>-march<\/code>\u30d5\u30e9\u30b0\u306b\u305d\u306e\u307e\u307e\u59d4\u306d\u308b\u8a2d\u8a08\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001ports\u5074\u306e<code>CPUTYPE=native<\/code>\u304c\u7d20\u76f4\u306b\u30b3\u30fc\u30c9\u751f\u6210\u3078\u53cd\u6620\u3055\u308c\u3001\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u306b\u3082\u306f\u3063\u304d\u308a\u8868\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5bfe\u5fdc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u660e\u78ba\u306b\u901f\u304f\u306a\u3063\u305f\u306e\u3067native\u30d3\u30eb\u30c9\u3092\u7dad\u6301\u3057\u3001\u4e0a\u66f8\u304d\u3055\u308c\u306a\u3044\u3088\u3046\u30ed\u30c3\u30af\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"\" style=\"font-size:.875rem;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cd \/usr\/ports\/security\/libargon2\nsudo make reinstall clean\nsudo pkg lock -y libargon2<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">cd<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">\/usr\/ports\/security\/libargon2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">make<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">reinstall<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">clean<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">sudo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">pkg<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">lock<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-y<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">libargon2<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u8003\u5bdf<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u500d\u9577\u30fb\u6697\u53f7\u7cfb\u30e9\u30a4\u30d6\u30e9\u30ea\u3060\u304b\u3089SIMD\u62e1\u5f35\u306e\u6069\u6075\u304c\u5927\u304d\u3044\u306f\u305a\u3068\u3044\u3046\u524d\u63d0\u3067\u9078\u3093\u30602\u3064\u306eports\u3067\u3057\u305f\u304c\u3001\u7d50\u679c\u306f\u5bfe\u7167\u7684\u3067\u3057\u305f\u3002\u7406\u7531\u3068\u3057\u3066\u3001CPU\u62e1\u5f35\u547d\u4ee4\u306e\u6d3b\u7528\u3092<strong>\u30e9\u30a4\u30d6\u30e9\u30ea\u81ea\u8eab\u306e\u8a2d\u8a08<\/strong>\u304c\u63e1\u3063\u3066\u3044\u308b\u304b\u3001<strong>\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u30d5\u30e9\u30b0<\/strong>\u306b\u59d4\u306d\u3066\u3044\u308b\u304b\u306e\u9055\u3044\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GMP\u306e\u3088\u3046\u306bCPU\u691c\u51fa\u2192\u6700\u9069\u5b9f\u88c5\u9078\u629e\u3092\u81ea\u524d\u3067\u6301\u3064\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001ports\u5074\u306eCPUTYPE\u64cd\u4f5c\u306e\u52b9\u679c\u304c\u4e57\u308a\u306b\u304f\u3044\u53cd\u9762\u3001libargon2\u306e\u3088\u3046\u306b\u300c\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u81ea\u52d5\u30d9\u30af\u30c8\u30eb\u5316\u30fbintrinsics\u5207\u308a\u66ff\u3048\u300d\u306b\u983c\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001CPUTYPE\u64cd\u4f5c\u304c\u305d\u306e\u307e\u307e\u52b9\u304f\u3066\u3044\u3046\u611f\u3058\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">native\u5316\u3059\u308c\u3070\u901f\u304f\u306a\u308b\u306f\u305a\u3068\u6c7a\u3081\u3064\u3051\u305a\u3001\u5bfe\u8c61\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3069\u3046\u3044\u3046\u4ed5\u7d44\u307f\u3067\u6700\u9069\u5316\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u3092\u500b\u5225\u306b\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">native\u5316\u3059\u308c\u3070\u901f\u304f\u306a\u308b\u3060\u308d\u3046\u304f\u3089\u3044\u306e\u96d1\u306a\u671f\u5f85\u304b\u3089\u59cb\u3081\u305f\u691c\u8a3c\u3067\u3057\u305f\u304c\u3001GMP\u3067\u898b\u4e8b\u306b\u80a9\u900f\u304b\u3057\u3092\u98df\u3089\u3063\u305f\u306e\u306f\u53ce\u7a6b\u3067\u3057\u305f\u3002\u30d9\u30f3\u30c1\u30de\u30fc\u30af\u3092\u53d6\u3089\u305a\u306b\u591a\u5206\u52b9\u3044\u3066\u308b\u306f\u305a\u3067\u5168\u90e8native\u5316\u3057\u3066\u3044\u305f\u3089\u3001GMP\u306e\u518d\u69cb\u7bc9\u30b3\u30b9\u30c8\u3060\u3051\u7121\u99c4\u306b\u6255\u3044\u7d9a\u3051\u308b\u3068\u3053\u308d\u3067\u3057\u305f\u3002CPUTYPE\u5468\u308a\u3092\u89e6\u308b\u306a\u3089\u3001\u5bfe\u8c61\u30e9\u30a4\u30d6\u30e9\u30ea\u3054\u3068\u306b\u6700\u9069\u5316\u306e\u4ed5\u7d44\u307f\u3092\u8efd\u304f\u8abf\u3079\u3066\u304b\u3089\u624b\u3092\u4ed8\u3051\u308b\u306e\u304c\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u306b\u3057\u305f\u8a18\u4e8b<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/gmplib.org\/manual\/Build-Options\" target=\"_blank\" rel=\"noreferrer noopener\">GMP, &#8220;Build Options&#8221;, GNU MP 6.3.0 Manual(gmplib.org)<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tuning FreeBSD ports with CPUTYPE=native: GMP vs libargon2 \u306f\u3058\u3081\u306b FreeBSD\u306epkg\u3067\u5165\u308b\u30d0\u30a4\u30ca\u30ea\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u57fa\u672c\u7684\u306b\u6c4e\u7528amd64\u30bf\u30fc\u30b2\u30c3\u30c8(\u3060\u3044\u305f\u3044 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[108,250],"tags":[254,252,253,255],"class_list":["post-3186","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-ports","tag-argon2","tag-cputype","tag-gpm","tag-255"],"_links":{"self":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/comments?post=3186"}],"version-history":[{"count":5,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3186\/revisions"}],"predecessor-version":[{"id":3191,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/posts\/3186\/revisions\/3191"}],"wp:attachment":[{"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/media?parent=3186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/categories?post=3186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bokumin.org\/blog\/wp-json\/wp\/v2\/tags?post=3186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}