René's URL Explorer Experiment


Title: Avoid masking/sign extension between function calls · Issue #38 · AssemblyScript/assemblyscript · GitHub

Open Graph Title: Avoid masking/sign extension between function calls · Issue #38 · AssemblyScript/assemblyscript

X Title: Avoid masking/sign extension between function calls · Issue #38 · AssemblyScript/assemblyscript

Description: Booleans, u8, i8, u16 and i16 are optimized poorly it seems. There is a lot of masking going on at the moment that is not necessary. Consider the following two functions: export function add16(x: i16, y: i16): i16 { return x + y; } expor...

Open Graph Description: Booleans, u8, i8, u16 and i16 are optimized poorly it seems. There is a lot of masking going on at the moment that is not necessary. Consider the following two functions: export function add16(x: i...

X Description: Booleans, u8, i8, u16 and i16 are optimized poorly it seems. There is a lot of masking going on at the moment that is not necessary. Consider the following two functions: export function add16(x: i...

Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/38

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Avoid masking/sign extension between function calls","articleBody":"Booleans, u8, i8, u16 and i16 are optimized poorly it seems. There is a lot of masking going on at the moment that is not necessary.\r\n\r\nConsider the following two functions:\r\n```ts\r\nexport function add16(x: i16, y: i16): i16 {\r\n  return x + y;\r\n}\r\n\r\nexport function add32(x: i32, y: i32): i32 {\r\n  return x + y;\r\n}\r\n```\r\nThey get compiled down to:\r\n```wat\r\n  (func $main/add16 (export \"add16\") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)\r\n    get_local $p0\r\n    get_local $p1\r\n    i32.add\r\n    i32.const 16\r\n    i32.shl\r\n    i32.const 16\r\n    i32.shr_s\r\n    return)\r\n  (func $main/add32 (export \"add32\") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)\r\n    get_local $p0\r\n    get_local $p1\r\n    i32.add\r\n    return)\r\n```\r\nAs you can see, the add16 function has a lot of masking operations, while the add32 is just a pure addition. Compare this to the following Rust code:\r\n```rust\r\n#[no_mangle]\r\npub extern fn add16(x: i16, y: i16) -> i16 {\r\n  x + y\r\n}\r\n\r\n#[no_mangle]\r\npub extern fn add32(x: i32, y: i32) -> i32 {\r\n  x + y\r\n}\r\n```\r\nWhich gets compiled down to the following code:\r\n```wat\r\n  (func $add16 (export \"add16\") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)\r\n    get_local $p1\r\n    get_local $p0\r\n    i32.add)\r\n  (func $add32 (export \"add32\") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)\r\n    get_local $p1\r\n    get_local $p0\r\n    i32.add)\r\n```\r\nAs you can see, they are the same, as adding two i16 values is the same as adding two i32 values, because the upper 16-bits of the 32-bit wide \"register\" is getting masked away anyway when storing the 16-bit wide value in memory with a i32.store16_u instruction. So there's only very few instructions where actual masking is necessary (like dividing).","author":{"url":"https://github.com/CryZe","@type":"Person","name":"CryZe"},"datePublished":"2018-03-11T18:28:11Z","url":"https://github.com/AssemblyScript/assemblyscript/issues/38"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cab1b1f8-ced1-6e07-6266-b985bece722c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB53C:1A2DA6:AF9A7F:F104DC:6B00AB81
html-safe-nonce32684e63f4436a1a0154bf4e8608e3aec11327f0ad08e1441d44b11490decc9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTNDOjFBMkRBNjpBRjlBN0Y6RjEwNERDOjZCMDBBQjgxIiwidmlzaXRvcl9pZCI6IjQ4MjgzMTY4MjE5NDM3OTA0NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac19304c58f2581a9cfc50a3717870d15dbf74e3291451857750819302a0fa1940
hovercard-subject-tagissue:304181219
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/AssemblyScript/assemblyscript/38/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c5976b8c89cd8ef11e648527b5d32cf1698a56f957acd4daa0913e1300b9bbc5/AssemblyScript/assemblyscript/issues/38
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c5976b8c89cd8ef11e648527b5d32cf1698a56f957acd4daa0913e1300b9bbc5/AssemblyScript/assemblyscript/issues/38
og:image:altBooleans, u8, i8, u16 and i16 are optimized poorly it seems. There is a lot of masking going on at the moment that is not necessary. Consider the following two functions: export function add16(x: i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameCryZe
hostnamegithub.com
expected-hostnamegithub.com
None455b493e3402a3a3a06beac5d20bb7db3da060808b220aa48d6a7eca7c59863a
turbo-cache-controlno-preview
go-importgithub.com/AssemblyScript/assemblyscript git https://github.com/AssemblyScript/assemblyscript.git
octolytics-dimension-user_id28916798
octolytics-dimension-user_loginAssemblyScript
octolytics-dimension-repository_id105138356
octolytics-dimension-repository_nwoAssemblyScript/assemblyscript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id105138356
octolytics-dimension-repository_network_root_nwoAssemblyScript/assemblyscript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2f575159976167242d488c0b062eb355c4e198b7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/AssemblyScript/assemblyscript/issues/38#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FAssemblyScript%2Fassemblyscript%2Fissues%2F38
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FAssemblyScript%2Fassemblyscript%2Fissues%2F38
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=AssemblyScript%2Fassemblyscript
Reloadhttps://github.com/AssemblyScript/assemblyscript/issues/38
Reloadhttps://github.com/AssemblyScript/assemblyscript/issues/38
Reloadhttps://github.com/AssemblyScript/assemblyscript/issues/38
AssemblyScripthttps://github.com/AssemblyScript
assemblyscripthttps://github.com/AssemblyScript/assemblyscript
Codehttps://github.com/AssemblyScript/assemblyscript
Issues196 (196)https://github.com/AssemblyScript/assemblyscript/issues
Pull requests24 (24)https://github.com/AssemblyScript/assemblyscript/pulls
Actionshttps://github.com/AssemblyScript/assemblyscript/actions
Wikihttps://github.com/AssemblyScript/assemblyscript/wiki
Security and qualityhttps://github.com/AssemblyScript/assemblyscript/security
Insightshttps://github.com/AssemblyScript/assemblyscript/insights
https://github.com/AssemblyScript/assemblyscript
New issuehttps://github.com/login?return_to=https://github.com/AssemblyScript/assemblyscript/issues/38
New issuehttps://github.com/login?return_to=https://github.com/AssemblyScript/assemblyscript/issues/38
Avoid masking/sign extension between function callshttps://github.com/AssemblyScript/assemblyscript/issues/38#top
enhancementhttps://github.com/AssemblyScript/assemblyscript/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/CryZe
CryZehttps://github.com/CryZe
on Mar 11, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issue-304181219
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 11, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-372144165
https://github.com/CryZe
CryZehttps://github.com/CryZe
on Mar 11, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-372144724
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 14, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-372870293
sign extension operationhttps://github.com/WebAssembly/sign-extension-ops
https://github.com/CryZe
CryZehttps://github.com/CryZe
on Mar 15, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-373429590
Rusthttps://github.com/rust-lang-nursery/rust-wasm/issues/88
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 15, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-373435669
CryZehttps://github.com/CryZe
on Mar 15, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#event-1523715832
dcodeIOhttps://github.com/dcodeIO
enhancementhttps://github.com/AssemblyScript/assemblyscript/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Mar 15, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#event-1523717664
https://github.com/MaxGraey
MaxGraeyhttps://github.com/MaxGraey
on Mar 21, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-375024052
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 21, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-375026616
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 21, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-375030244
https://github.com/MaxGraey
MaxGraeyhttps://github.com/MaxGraey
on Mar 21, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-375031544
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Mar 21, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-375042731
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Apr 27, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-385019278
mutable-globalhttps://github.com/WebAssembly/mutable-global
https://github.com/CryZe
CryZehttps://github.com/CryZe
on Apr 27, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-385092402
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on Apr 28, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-385128540
WebAssembly/binaryen#1521https://github.com/WebAssembly/binaryen/issues/1521
https://github.com/dcodeIO
dcodeIOhttps://github.com/dcodeIO
on May 5, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#issuecomment-386838381
#87https://github.com/AssemblyScript/assemblyscript/pull/87
canOverflowhttps://github.com/AssemblyScript/assemblyscript/blob/50f6c1c4605067bc13dfb467d4f4d8ee876137a5/src/program.ts#L3868
dcodeIOhttps://github.com/dcodeIO
completedhttps://github.com/AssemblyScript/assemblyscript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 5, 2018https://github.com/AssemblyScript/assemblyscript/issues/38#event-1611450357
Sign up for freehttps://github.com/signup?return_to=https://github.com/AssemblyScript/assemblyscript/issues/38
Sign in to commenthttps://github.com/login?return_to=https://github.com/AssemblyScript/assemblyscript/issues/38
enhancementhttps://github.com/AssemblyScript/assemblyscript/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.