optimization - Is it possible to beat the Assembler today? -


apparently used be, according terrific account ed nather. how today? is, possible, enough knowledge of cpu/fpu/gpu/etc. architecture, write machine code more efficient produced mainstream assembler (nasm, gas, etc.), in scenario? how gpu kernels?

edit: "not constructive"? please. question produced @pointy's answer, quite enlightening not familiar how assemblers work. has favorited it. fact pointy is, endearingly, 1 of close-voters nice touch hey if it's best answer gets accepted.

two things:

  1. there's no single thing called "assembly language". assembler program translates textual encoding of instructions particular architecture form suitable execution. facilities particular assembler exposes designer. many cpu architectures have several assemblers available.

  2. because assembler's job provide "friendly" way person request precise sequence of machine instructions (and other aspects of program, such initialized memory locations, reserved blocks of storage, directives runtime executive, etc), if it's possible produce program hand can't produced particular assembler means you've got inadequate assembler. assembler intel developed iapx 86 series (not microsoft's masm, weak imitator) had typical macro facility, , had sort of "micro macro" facility allow dictionary of opcode mnemonics (things mov, add, bne, etc) extended arbitrarily. assembler that, possible create piece of code desired.

the real topic concern in programming whether burdening programmer responsibility choosing strategy getting work done computer in extreme detail worthwhile performance. question of course has no single answer, because there many possible situations, many different computing devices, , because things change time. in 1959, example, computing task of translating higher-level language fortran machine code itself significant workload computers. understanding of how programming languages should work in infancy.

today, then, reason know "machine language" (and note word "language" isn't accurate) create instruction sequence when there's no available (or convenient) assembler. that's assuming explicitly creating particular instruction sequence better using higher-level language reason. then, it's case if doing you'd writing software in high-level language emit chosen instruction sequence; is, you'd create "domain-specific assembler" task. example code in virtual machine interpreter builds machine language blocks on-the-fly, java or javascript vm.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -