This commit is contained in:
Nitload
2025-08-25 09:50:30 +08:00
parent bd0e31e922
commit 1359ff4ecc
1630 changed files with 738486 additions and 2399 deletions
+747
View File
@@ -0,0 +1,747 @@
# Format Style Options - Created with Clang Power Tools
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BeforeLambdaBody: false
BeforeWhile: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth : 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros:
- '__ata_qc_for_each'
- '__bio_for_each_bvec'
- '__bio_for_each_segment'
- '__evlist__for_each_entry'
- '__evlist__for_each_entry_continue'
- '__evlist__for_each_entry_from'
- '__evlist__for_each_entry_reverse'
- '__evlist__for_each_entry_safe'
- '__for_each_mem_range'
- '__for_each_mem_range_rev'
- '__for_each_thread'
- '__hlist_for_each_rcu'
- '__map__for_each_symbol_by_name'
- '__pci_bus_for_each_res0'
- '__pci_bus_for_each_res1'
- '__pci_dev_for_each_res0'
- '__pci_dev_for_each_res1'
- '__perf_evlist__for_each_entry'
- '__perf_evlist__for_each_entry_reverse'
- '__perf_evlist__for_each_entry_safe'
- '__rq_for_each_bio'
- '__shost_for_each_device'
- '__sym_for_each'
- 'apei_estatus_for_each_section'
- 'ata_for_each_dev'
- 'ata_for_each_link'
- 'ata_qc_for_each'
- 'ata_qc_for_each_raw'
- 'ata_qc_for_each_with_internal'
- 'ax25_for_each'
- 'ax25_uid_for_each'
- 'bio_for_each_bvec'
- 'bio_for_each_bvec_all'
- 'bio_for_each_folio_all'
- 'bio_for_each_integrity_vec'
- 'bio_for_each_segment'
- 'bio_for_each_segment_all'
- 'bio_list_for_each'
- 'bip_for_each_vec'
- 'bond_for_each_slave'
- 'bond_for_each_slave_rcu'
- 'bpf_for_each'
- 'bpf_for_each_reg_in_vstate'
- 'bpf_for_each_reg_in_vstate_mask'
- 'bpf_for_each_spilled_reg'
- 'bpf_object__for_each_map'
- 'bpf_object__for_each_program'
- 'btree_for_each_safe128'
- 'btree_for_each_safe32'
- 'btree_for_each_safe64'
- 'btree_for_each_safel'
- 'card_for_each_dev'
- 'cgroup_taskset_for_each'
- 'cgroup_taskset_for_each_leader'
- 'cpu_aggr_map__for_each_idx'
- 'cpufreq_for_each_efficient_entry_idx'
- 'cpufreq_for_each_entry'
- 'cpufreq_for_each_entry_idx'
- 'cpufreq_for_each_valid_entry'
- 'cpufreq_for_each_valid_entry_idx'
- 'css_for_each_child'
- 'css_for_each_descendant_post'
- 'css_for_each_descendant_pre'
- 'damon_for_each_region'
- 'damon_for_each_region_from'
- 'damon_for_each_region_safe'
- 'damon_for_each_scheme'
- 'damon_for_each_scheme_safe'
- 'damon_for_each_target'
- 'damon_for_each_target_safe'
- 'damos_for_each_filter'
- 'damos_for_each_filter_safe'
- 'damos_for_each_quota_goal'
- 'damos_for_each_quota_goal_safe'
- 'data__for_each_file'
- 'data__for_each_file_new'
- 'data__for_each_file_start'
- 'device_for_each_child_node'
- 'device_for_each_child_node_scoped'
- 'dma_fence_array_for_each'
- 'dma_fence_chain_for_each'
- 'dma_fence_unwrap_for_each'
- 'dma_resv_for_each_fence'
- 'dma_resv_for_each_fence_unlocked'
- 'do_for_each_ftrace_op'
- 'drm_atomic_crtc_for_each_plane'
- 'drm_atomic_crtc_state_for_each_plane'
- 'drm_atomic_crtc_state_for_each_plane_state'
- 'drm_atomic_for_each_plane_damage'
- 'drm_client_for_each_connector_iter'
- 'drm_client_for_each_modeset'
- 'drm_connector_for_each_possible_encoder'
- 'drm_exec_for_each_locked_object'
- 'drm_exec_for_each_locked_object_reverse'
- 'drm_for_each_bridge_in_chain'
- 'drm_for_each_connector_iter'
- 'drm_for_each_crtc'
- 'drm_for_each_crtc_reverse'
- 'drm_for_each_encoder'
- 'drm_for_each_encoder_mask'
- 'drm_for_each_fb'
- 'drm_for_each_legacy_plane'
- 'drm_for_each_plane'
- 'drm_for_each_plane_mask'
- 'drm_for_each_privobj'
- 'drm_gem_for_each_gpuvm_bo'
- 'drm_gem_for_each_gpuvm_bo_safe'
- 'drm_gpuva_for_each_op'
- 'drm_gpuva_for_each_op_from_reverse'
- 'drm_gpuva_for_each_op_reverse'
- 'drm_gpuva_for_each_op_safe'
- 'drm_gpuvm_bo_for_each_va'
- 'drm_gpuvm_bo_for_each_va_safe'
- 'drm_gpuvm_for_each_va'
- 'drm_gpuvm_for_each_va_range'
- 'drm_gpuvm_for_each_va_range_safe'
- 'drm_gpuvm_for_each_va_safe'
- 'drm_mm_for_each_hole'
- 'drm_mm_for_each_node'
- 'drm_mm_for_each_node_in_range'
- 'drm_mm_for_each_node_safe'
- 'dsa_switch_for_each_available_port'
- 'dsa_switch_for_each_cpu_port'
- 'dsa_switch_for_each_cpu_port_continue_reverse'
- 'dsa_switch_for_each_port'
- 'dsa_switch_for_each_port_continue_reverse'
- 'dsa_switch_for_each_port_safe'
- 'dsa_switch_for_each_user_port'
- 'dsa_switch_for_each_user_port_continue_reverse'
- 'dsa_tree_for_each_cpu_port'
- 'dsa_tree_for_each_user_port'
- 'dsa_tree_for_each_user_port_continue_reverse'
- 'dso__for_each_symbol'
- 'elf_hash_for_each_possible'
- 'elf_symtab__for_each_symbol'
- 'evlist__for_each_cpu'
- 'evlist__for_each_entry'
- 'evlist__for_each_entry_continue'
- 'evlist__for_each_entry_from'
- 'evlist__for_each_entry_reverse'
- 'evlist__for_each_entry_safe'
- 'flow_action_for_each'
- 'for_each_acpi_consumer_dev'
- 'for_each_acpi_dev_match'
- 'for_each_active_dev_scope'
- 'for_each_active_drhd_unit'
- 'for_each_active_iommu'
- 'for_each_active_route'
- 'for_each_aggr_pgid'
- 'for_each_and_bit'
- 'for_each_andnot_bit'
- 'for_each_available_child_of_node'
- 'for_each_available_child_of_node_scoped'
- 'for_each_bench'
- 'for_each_bio'
- 'for_each_board_func_rsrc'
- 'for_each_btf_ext_rec'
- 'for_each_btf_ext_sec'
- 'for_each_bvec'
- 'for_each_card_auxs'
- 'for_each_card_auxs_safe'
- 'for_each_card_components'
- 'for_each_card_dapms'
- 'for_each_card_pre_auxs'
- 'for_each_card_prelinks'
- 'for_each_card_rtds'
- 'for_each_card_rtds_safe'
- 'for_each_card_widgets'
- 'for_each_card_widgets_safe'
- 'for_each_cgroup_storage_type'
- 'for_each_child_of_node'
- 'for_each_child_of_node_scoped'
- 'for_each_clear_bit'
- 'for_each_clear_bit_from'
- 'for_each_clear_bitrange'
- 'for_each_clear_bitrange_from'
- 'for_each_cmd'
- 'for_each_cmsghdr'
- 'for_each_collection'
- 'for_each_comp_order'
- 'for_each_compatible_node'
- 'for_each_component_dais'
- 'for_each_component_dais_safe'
- 'for_each_conduit'
- 'for_each_console'
- 'for_each_console_srcu'
- 'for_each_cpu'
- 'for_each_cpu_and'
- 'for_each_cpu_andnot'
- 'for_each_cpu_from'
- 'for_each_cpu_or'
- 'for_each_cpu_wrap'
- 'for_each_dapm_widgets'
- 'for_each_dedup_cand'
- 'for_each_dev_addr'
- 'for_each_dev_scope'
- 'for_each_dma_cap_mask'
- 'for_each_dpcm_be'
- 'for_each_dpcm_be_rollback'
- 'for_each_dpcm_be_safe'
- 'for_each_dpcm_fe'
- 'for_each_drhd_unit'
- 'for_each_dss_dev'
- 'for_each_efi_memory_desc'
- 'for_each_efi_memory_desc_in_map'
- 'for_each_element'
- 'for_each_element_extid'
- 'for_each_element_id'
- 'for_each_enabled_cpu'
- 'for_each_endpoint_of_node'
- 'for_each_event'
- 'for_each_event_tps'
- 'for_each_evictable_lru'
- 'for_each_fib6_node_rt_rcu'
- 'for_each_fib6_walker_rt'
- 'for_each_file_lock'
- 'for_each_free_mem_pfn_range_in_zone_from'
- 'for_each_free_mem_range'
- 'for_each_free_mem_range_reverse'
- 'for_each_func_rsrc'
- 'for_each_gpiochip_node'
- 'for_each_group_evsel'
- 'for_each_group_evsel_head'
- 'for_each_group_member'
- 'for_each_group_member_head'
- 'for_each_hstate'
- 'for_each_hwgpio'
- 'for_each_if'
- 'for_each_inject_fn'
- 'for_each_insn'
- 'for_each_insn_op_loc'
- 'for_each_insn_prefix'
- 'for_each_intid'
- 'for_each_iommu'
- 'for_each_ip_tunnel_rcu'
- 'for_each_irq_nr'
- 'for_each_lang'
- 'for_each_link_ch_maps'
- 'for_each_link_codecs'
- 'for_each_link_cpus'
- 'for_each_link_platforms'
- 'for_each_lru'
- 'for_each_matching_node'
- 'for_each_matching_node_and_match'
- 'for_each_media_entity_data_link'
- 'for_each_mem_pfn_range'
- 'for_each_mem_range'
- 'for_each_mem_range_rev'
- 'for_each_mem_region'
- 'for_each_member'
- 'for_each_memory'
- 'for_each_migratetype_order'
- 'for_each_missing_reg'
- 'for_each_mle_subelement'
- 'for_each_mod_mem_type'
- 'for_each_net'
- 'for_each_net_continue_reverse'
- 'for_each_net_rcu'
- 'for_each_netdev'
- 'for_each_netdev_continue'
- 'for_each_netdev_continue_rcu'
- 'for_each_netdev_continue_reverse'
- 'for_each_netdev_dump'
- 'for_each_netdev_feature'
- 'for_each_netdev_in_bond_rcu'
- 'for_each_netdev_rcu'
- 'for_each_netdev_reverse'
- 'for_each_netdev_safe'
- 'for_each_new_connector_in_state'
- 'for_each_new_crtc_in_state'
- 'for_each_new_mst_mgr_in_state'
- 'for_each_new_plane_in_state'
- 'for_each_new_plane_in_state_reverse'
- 'for_each_new_private_obj_in_state'
- 'for_each_new_reg'
- 'for_each_nhlt_endpoint'
- 'for_each_nhlt_endpoint_fmtcfg'
- 'for_each_nhlt_fmtcfg'
- 'for_each_node'
- 'for_each_node_by_name'
- 'for_each_node_by_type'
- 'for_each_node_mask'
- 'for_each_node_state'
- 'for_each_node_with_cpus'
- 'for_each_node_with_property'
- 'for_each_nonreserved_multicast_dest_pgid'
- 'for_each_numa_hop_mask'
- 'for_each_of_allnodes'
- 'for_each_of_allnodes_from'
- 'for_each_of_cpu_node'
- 'for_each_of_pci_range'
- 'for_each_old_connector_in_state'
- 'for_each_old_crtc_in_state'
- 'for_each_old_mst_mgr_in_state'
- 'for_each_old_plane_in_state'
- 'for_each_old_private_obj_in_state'
- 'for_each_oldnew_connector_in_state'
- 'for_each_oldnew_crtc_in_state'
- 'for_each_oldnew_mst_mgr_in_state'
- 'for_each_oldnew_plane_in_state'
- 'for_each_oldnew_plane_in_state_reverse'
- 'for_each_oldnew_private_obj_in_state'
- 'for_each_online_cpu'
- 'for_each_online_node'
- 'for_each_online_pgdat'
- 'for_each_or_bit'
- 'for_each_path'
- 'for_each_pci_bridge'
- 'for_each_pci_dev'
- 'for_each_pcm_streams'
- 'for_each_physmem_range'
- 'for_each_populated_zone'
- 'for_each_possible_cpu'
- 'for_each_present_blessed_reg'
- 'for_each_present_cpu'
- 'for_each_prime_number'
- 'for_each_prime_number_from'
- 'for_each_probe_cache_entry'
- 'for_each_process'
- 'for_each_process_thread'
- 'for_each_prop_codec_conf'
- 'for_each_prop_dai_codec'
- 'for_each_prop_dai_cpu'
- 'for_each_prop_dlc_codecs'
- 'for_each_prop_dlc_cpus'
- 'for_each_prop_dlc_platforms'
- 'for_each_property_of_node'
- 'for_each_reg'
- 'for_each_reg_filtered'
- 'for_each_reloc'
- 'for_each_reloc_from'
- 'for_each_requested_gpio'
- 'for_each_requested_gpio_in_range'
- 'for_each_reserved_child_of_node'
- 'for_each_reserved_mem_range'
- 'for_each_reserved_mem_region'
- 'for_each_rtd_ch_maps'
- 'for_each_rtd_codec_dais'
- 'for_each_rtd_components'
- 'for_each_rtd_cpu_dais'
- 'for_each_rtd_dais'
- 'for_each_rtd_dais_reverse'
- 'for_each_sband_iftype_data'
- 'for_each_script'
- 'for_each_sec'
- 'for_each_set_bit'
- 'for_each_set_bit_from'
- 'for_each_set_bit_wrap'
- 'for_each_set_bitrange'
- 'for_each_set_bitrange_from'
- 'for_each_set_clump8'
- 'for_each_sg'
- 'for_each_sg_dma_page'
- 'for_each_sg_page'
- 'for_each_sgtable_dma_page'
- 'for_each_sgtable_dma_sg'
- 'for_each_sgtable_page'
- 'for_each_sgtable_sg'
- 'for_each_sibling_event'
- 'for_each_sta_active_link'
- 'for_each_subelement'
- 'for_each_subelement_extid'
- 'for_each_subelement_id'
- 'for_each_sublist'
- 'for_each_subsystem'
- 'for_each_supported_activate_fn'
- 'for_each_supported_inject_fn'
- 'for_each_sym'
- 'for_each_test'
- 'for_each_thread'
- 'for_each_token'
- 'for_each_unicast_dest_pgid'
- 'for_each_valid_link'
- 'for_each_vif_active_link'
- 'for_each_vma'
- 'for_each_vma_range'
- 'for_each_vsi'
- 'for_each_wakeup_source'
- 'for_each_zone'
- 'for_each_zone_zonelist'
- 'for_each_zone_zonelist_nodemask'
- 'func_for_each_insn'
- 'fwnode_for_each_available_child_node'
- 'fwnode_for_each_child_node'
- 'fwnode_for_each_parent_node'
- 'fwnode_graph_for_each_endpoint'
- 'gadget_for_each_ep'
- 'genradix_for_each'
- 'genradix_for_each_from'
- 'genradix_for_each_reverse'
- 'hash_for_each'
- 'hash_for_each_possible'
- 'hash_for_each_possible_rcu'
- 'hash_for_each_possible_rcu_notrace'
- 'hash_for_each_possible_safe'
- 'hash_for_each_rcu'
- 'hash_for_each_safe'
- 'hashmap__for_each_entry'
- 'hashmap__for_each_entry_safe'
- 'hashmap__for_each_key_entry'
- 'hashmap__for_each_key_entry_safe'
- 'hctx_for_each_ctx'
- 'hists__for_each_format'
- 'hists__for_each_sort_list'
- 'hlist_bl_for_each_entry'
- 'hlist_bl_for_each_entry_rcu'
- 'hlist_bl_for_each_entry_safe'
- 'hlist_for_each'
- 'hlist_for_each_entry'
- 'hlist_for_each_entry_continue'
- 'hlist_for_each_entry_continue_rcu'
- 'hlist_for_each_entry_continue_rcu_bh'
- 'hlist_for_each_entry_from'
- 'hlist_for_each_entry_from_rcu'
- 'hlist_for_each_entry_rcu'
- 'hlist_for_each_entry_rcu_bh'
- 'hlist_for_each_entry_rcu_notrace'
- 'hlist_for_each_entry_safe'
- 'hlist_for_each_entry_srcu'
- 'hlist_for_each_safe'
- 'hlist_nulls_for_each_entry'
- 'hlist_nulls_for_each_entry_from'
- 'hlist_nulls_for_each_entry_rcu'
- 'hlist_nulls_for_each_entry_safe'
- 'i3c_bus_for_each_i2cdev'
- 'i3c_bus_for_each_i3cdev'
- 'idr_for_each_entry'
- 'idr_for_each_entry_continue'
- 'idr_for_each_entry_continue_ul'
- 'idr_for_each_entry_ul'
- 'in_dev_for_each_ifa_rcu'
- 'in_dev_for_each_ifa_rtnl'
- 'inet_bind_bucket_for_each'
- 'interval_tree_for_each_span'
- 'intlist__for_each_entry'
- 'intlist__for_each_entry_safe'
- 'kcore_copy__for_each_phdr'
- 'key_for_each'
- 'key_for_each_safe'
- 'klp_for_each_func'
- 'klp_for_each_func_safe'
- 'klp_for_each_func_static'
- 'klp_for_each_object'
- 'klp_for_each_object_safe'
- 'klp_for_each_object_static'
- 'kunit_suite_for_each_test_case'
- 'kvm_for_each_memslot'
- 'kvm_for_each_memslot_in_gfn_range'
- 'kvm_for_each_vcpu'
- 'libbpf_nla_for_each_attr'
- 'list_for_each'
- 'list_for_each_codec'
- 'list_for_each_codec_safe'
- 'list_for_each_continue'
- 'list_for_each_entry'
- 'list_for_each_entry_continue'
- 'list_for_each_entry_continue_rcu'
- 'list_for_each_entry_continue_reverse'
- 'list_for_each_entry_from'
- 'list_for_each_entry_from_rcu'
- 'list_for_each_entry_from_reverse'
- 'list_for_each_entry_lockless'
- 'list_for_each_entry_rcu'
- 'list_for_each_entry_reverse'
- 'list_for_each_entry_safe'
- 'list_for_each_entry_safe_continue'
- 'list_for_each_entry_safe_from'
- 'list_for_each_entry_safe_reverse'
- 'list_for_each_entry_srcu'
- 'list_for_each_from'
- 'list_for_each_prev'
- 'list_for_each_prev_safe'
- 'list_for_each_rcu'
- 'list_for_each_reverse'
- 'list_for_each_safe'
- 'llist_for_each'
- 'llist_for_each_entry'
- 'llist_for_each_entry_safe'
- 'llist_for_each_safe'
- 'lwq_for_each_safe'
- 'map__for_each_symbol'
- 'map__for_each_symbol_by_name'
- 'mas_for_each'
- 'mci_for_each_dimm'
- 'media_device_for_each_entity'
- 'media_device_for_each_intf'
- 'media_device_for_each_link'
- 'media_device_for_each_pad'
- 'media_entity_for_each_pad'
- 'media_pipeline_for_each_entity'
- 'media_pipeline_for_each_pad'
- 'mlx5_lag_for_each_peer_mdev'
- 'msi_domain_for_each_desc'
- 'msi_for_each_desc'
- 'mt_for_each'
- 'nanddev_io_for_each_page'
- 'netdev_for_each_lower_dev'
- 'netdev_for_each_lower_private'
- 'netdev_for_each_lower_private_rcu'
- 'netdev_for_each_mc_addr'
- 'netdev_for_each_synced_mc_addr'
- 'netdev_for_each_synced_uc_addr'
- 'netdev_for_each_uc_addr'
- 'netdev_for_each_upper_dev_rcu'
- 'netdev_hw_addr_list_for_each'
- 'nft_rule_for_each_expr'
- 'nla_for_each_attr'
- 'nla_for_each_attr_type'
- 'nla_for_each_nested'
- 'nla_for_each_nested_type'
- 'nlmsg_for_each_attr'
- 'nlmsg_for_each_msg'
- 'nr_neigh_for_each'
- 'nr_neigh_for_each_safe'
- 'nr_node_for_each'
- 'nr_node_for_each_safe'
- 'of_for_each_phandle'
- 'of_property_for_each_string'
- 'of_property_for_each_u32'
- 'pci_bus_for_each_resource'
- 'pci_dev_for_each_resource'
- 'pcl_for_each_chunk'
- 'pcl_for_each_segment'
- 'pcm_for_each_format'
- 'perf_config_items__for_each_entry'
- 'perf_config_sections__for_each_entry'
- 'perf_config_set__for_each_entry'
- 'perf_cpu_map__for_each_cpu'
- 'perf_cpu_map__for_each_cpu_skip_any'
- 'perf_cpu_map__for_each_idx'
- 'perf_evlist__for_each_entry'
- 'perf_evlist__for_each_entry_reverse'
- 'perf_evlist__for_each_entry_safe'
- 'perf_evlist__for_each_evsel'
- 'perf_evlist__for_each_mmap'
- 'perf_hpp_list__for_each_format'
- 'perf_hpp_list__for_each_format_safe'
- 'perf_hpp_list__for_each_sort_list'
- 'perf_hpp_list__for_each_sort_list_safe'
- 'perf_tool_event__for_each_event'
- 'plist_for_each'
- 'plist_for_each_continue'
- 'plist_for_each_entry'
- 'plist_for_each_entry_continue'
- 'plist_for_each_entry_safe'
- 'plist_for_each_safe'
- 'pnp_for_each_card'
- 'pnp_for_each_dev'
- 'protocol_for_each_card'
- 'protocol_for_each_dev'
- 'queue_for_each_hw_ctx'
- 'radix_tree_for_each_slot'
- 'radix_tree_for_each_tagged'
- 'rb_for_each'
- 'rbtree_postorder_for_each_entry_safe'
- 'rdma_for_each_block'
- 'rdma_for_each_port'
- 'rdma_umem_for_each_dma_block'
- 'resort_rb__for_each_entry'
- 'resource_list_for_each_entry'
- 'resource_list_for_each_entry_safe'
- 'rhl_for_each_entry_rcu'
- 'rhl_for_each_rcu'
- 'rht_for_each'
- 'rht_for_each_entry'
- 'rht_for_each_entry_from'
- 'rht_for_each_entry_rcu'
- 'rht_for_each_entry_rcu_from'
- 'rht_for_each_entry_safe'
- 'rht_for_each_from'
- 'rht_for_each_rcu'
- 'rht_for_each_rcu_from'
- 'rq_for_each_bvec'
- 'rq_for_each_segment'
- 'rq_list_for_each'
- 'rq_list_for_each_safe'
- 'sample_read_group__for_each'
- 'scsi_for_each_prot_sg'
- 'scsi_for_each_sg'
- 'sctp_for_each_hentry'
- 'sctp_skb_for_each'
- 'sec_for_each_insn'
- 'sec_for_each_insn_continue'
- 'sec_for_each_insn_from'
- 'sec_for_each_sym'
- 'shdma_for_each_chan'
- 'shost_for_each_device'
- 'sk_for_each'
- 'sk_for_each_bound'
- 'sk_for_each_entry_offset_rcu'
- 'sk_for_each_from'
- 'sk_for_each_rcu'
- 'sk_for_each_safe'
- 'sk_nulls_for_each'
- 'sk_nulls_for_each_from'
- 'sk_nulls_for_each_rcu'
- 'snd_array_for_each'
- 'snd_pcm_group_for_each_entry'
- 'snd_soc_dapm_widget_for_each_path'
- 'snd_soc_dapm_widget_for_each_path_safe'
- 'snd_soc_dapm_widget_for_each_sink_path'
- 'snd_soc_dapm_widget_for_each_source_path'
- 'sparsebit_for_each_set_range'
- 'strlist__for_each_entry'
- 'strlist__for_each_entry_safe'
- 'sym_for_each_insn'
- 'sym_for_each_insn_continue_reverse'
- 'symbols__for_each_entry'
- 'tb_property_for_each'
- 'tcf_act_for_each_action'
- 'tcf_exts_for_each_action'
- 'ttm_resource_manager_for_each_res'
- 'udp_portaddr_for_each_entry'
- 'udp_portaddr_for_each_entry_rcu'
- 'usb_hub_for_each_child'
- 'v4l2_device_for_each_subdev'
- 'v4l2_m2m_for_each_dst_buf'
- 'v4l2_m2m_for_each_dst_buf_safe'
- 'v4l2_m2m_for_each_src_buf'
- 'v4l2_m2m_for_each_src_buf_safe'
- 'virtio_device_for_each_vq'
- 'while_for_each_ftrace_op'
- 'xa_for_each'
- 'xa_for_each_marked'
- 'xa_for_each_range'
- 'xa_for_each_start'
- 'xas_for_each'
- 'xas_for_each_conflict'
- 'xas_for_each_marked'
- 'xbc_array_for_each_value'
- 'xbc_for_each_key_value'
- 'xbc_node_for_each_array_value'
- 'xbc_node_for_each_child'
- 'xbc_node_for_each_key_value'
- 'xbc_node_for_each_subkey'
- 'ynl_attr_for_each'
- 'ynl_attr_for_each_nested'
- 'ynl_attr_for_each_payload'
- 'zorro_for_each_dev'
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: (Test)?$
IndentCaseLabels: false
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 8
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatementsExceptForEachMacros
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 8
UseTab: Never
...
+75
View File
@@ -0,0 +1,75 @@
#include "StgSharpC.h"
#include "gl.h"
#include "glfw3.h"
#include <stdio.h>
#include <string.h>
extern GladGLContext *currentContext;
extern char infolog[512];
SSCAPI int SSCDECL glCheckShaderStat(GladGLContext *context, uint64_t shaderHandle, int key,
char **logRef)
{
int stat = 0;
context->GetShaderiv(shaderHandle, key, &stat);
if (!stat) {
context->GetShaderInfoLog(shaderHandle, 512, NULL, infolog);
}
*logRef = infolog;
return stat;
}
SSCAPI void SSCDECL initGL(int majorVersion, int minorVersion)
{
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
}
SSCAPI GLFWglproc SSCDECL loadGlfuncDefault(char *procName)
{
void *ret = glfwGetProcAddress(procName);
// printf("%llu\n", (uint64_t)ret);
if (ret == NULL) {
strcpy_s(infolog,30, "Failed to load OpenGL api:");
for (size_t i = 0; i < sizeof(procName); i++) {
infolog[30 + i] = procName[i];
}
//printf("%s\n", infolog);
}
return (GLFWglproc)ret;
}
SSCAPI unsigned int linkShaderProgram(GladGLContext *context, GLuint shaderProgram)
{
context->LinkProgram(shaderProgram);
int success;
context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
if (!success) {
context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog);
return 0;
} else {
return shaderProgram;
}
}
SSCAPI void SSCDECL loadImageData(char *location, Image *out, imageLoader loader)
{
if (loader == NULL) {
loader = stbi_load;
}
out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0);
}
SSCAPI void SSCDECL unloadImageData(Image *out)
{
free(out->pixelPtr);
}
SSCAPI char *SSCDECL readLog()
{
infolog[511] = '\0';
return infolog;
}
+73
View File
@@ -0,0 +1,73 @@
#ifdef _MSC_VER
#pragma once
#endif
#ifndef SSC
#define SSC
#include "ssc_internal.h"
#define STBIDEF SSCAPI
#include "stb_image.h"
#include "gl.h"
#include "wgl.h"
#include "glfw3.h"
#include <immintrin.h>
#include <assert.h>
#ifndef SSCAPI_DEFINE
#ifdef _WIN32
#define SSCAPI __declspec(dllexport)
#elif defined _LINUX_
#define SSCAPI __attribute__((dllexport))
#elif defined _APPLE_
#define SSCAPI __attribute__((visibility("default")))
#else
#define SSCAPI
#endif
#endif // ! SSCAPI_DEFINE
#if __cplusplus
extern "C" {
#endif
#define byte char
#define cs_char uint16_t
#define ssc_null_assert(ptr) assert(ptr != NULL)
#define ALIGN(simdVec) _mm_loadu_ps(&simdVec)
#define ALIGN256(simdVec) _mm256_loadu_ps(&simdVec)
#define ALIGN512(simdVec) _mm512_loadu_ps(&simdVec)
typedef struct Image {
int width;
int height;
int channel;
char *pixelPtr;
} Image;
typedef char *(*imageLoader)(char const *filename, int *x, int *y, int *channels_in_file,
int desired_channels);
SSCAPI char infolog[512];
SSCAPI int SSCDECL glCheckShaderStat(GladGLContext *context, uint64_t shaderHandle, int key,
char **logRef);
SSCAPI void SSCDECL initGL(int majorVersion, int minorVersion);
SSCAPI unsigned int SSCDECL linkShaderProgram(GladGLContext *context, GLuint shadertype);
SSCAPI void SSCDECL loadImageData(char *location, Image *out, imageLoader loader);
SSCAPI GLFWglproc SSCDECL loadGlfuncDefault(char *procName);
SSCAPI void SSCDECL unloadImageData(Image *out);
SSCAPI char *SSCDECL readLog(void);
#pragma endregion
SSCAPI int SSCDECL load_intrinsic_function(void *intrinsic_context);
#ifdef __cplusplus
}
#endif
#endif
+192
View File
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{20cbff26-6746-402e-992c-7b643e9423eb}</ProjectGuid>
<RootNamespace>StgSharpC</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>StgSharp.C</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<VCToolsVersion>14.41.34120</VCToolsVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)build</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)build</OutDir>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
<ExpandAttributedSource>true</ExpandAttributedSource>
<AssemblerOutput>All</AssemblerOutput>
<BrowseInformation>true</BrowseInformation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>opengl32.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Bscmake>
<PreserveSbr>true</PreserveSbr>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AssemblerOutput>NoListing</AssemblerOutput>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalDependencies>opengl32.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>LinkVerbose</ShowProgress>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Library Include="glfw3.lib" />
<Library Include="glfw3dll.lib" />
<Library Include="glfw3_mt.lib" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.c" />
<ClCompile Include="intrinsic.c" />
<ClCompile Include="mat2.c" />
<ClCompile Include="mat3.c" />
<ClCompile Include="mat4.c" />
<ClCompile Include="stb_image.c" />
<ClCompile Include="StgSharpC.c" />
<ClCompile Include="hash.c" />
<ClCompile Include="string.c" />
<ClCompile Include="vector.c" />
<ClCompile Include="vector_dot.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="gl.h" />
<ClInclude Include="glfw3.h" />
<ClInclude Include="glfw3native.h" />
<ClInclude Include="ssc_intrinsic.h" />
<ClInclude Include="khrplatform.h" />
<ClInclude Include="ssc_internal.h" />
<ClInclude Include="stb_image.h" />
<ClInclude Include="StgSharpC.h" />
<ClInclude Include="wgl.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+92
View File
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Library Include="glfw3.lib">
<Filter>资源文件</Filter>
</Library>
<Library Include="glfw3_mt.lib">
<Filter>资源文件</Filter>
</Library>
<Library Include="glfw3dll.lib">
<Filter>资源文件</Filter>
</Library>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mat2.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mat3.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="mat4.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="stb_image.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="StgSharpC.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="vector.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="intrinsic.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="hash.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="vector_dot.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="string.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="glfw3.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="glfw3native.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="khrplatform.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ssc_internal.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="stb_image.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="StgSharpC.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="gl.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ssc_intrinsic.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="wgl.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
</Project>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>$(SolutionDir)Output\x64\Debug\net6.0\StgSharpDebug.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
+35
View File
@@ -0,0 +1,35 @@
#include "StgSharpC.h"
#ifdef _WIN32
// clang-format off
BOOL APIENTRY DllMain(
HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
return 1;
case DLL_THREAD_ATTACH:
return 1;
case DLL_THREAD_DETACH:
return 1;
case DLL_PROCESS_DETACH:
return 1;
break;
}
return TRUE;
}
#else
attribute((constructor)) void DllMain()
{
}
#endif // _WIN32
// clang-format on
+12656
View File
File diff suppressed because one or more lines are too long
+6440
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
+632
View File
@@ -0,0 +1,632 @@
/*************************************************************************
* GLFW 3.4 - www.glfw->org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
* Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw->org>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
*************************************************************************/
#ifndef _glfw3_native_h_
#define _glfw3_native_h_
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
* Doxygen documentation
*************************************************************************/
/*! @file glfw3native.h
* @brief The header of the native access functions.
*
* This is the header file of the native access functions. See @ref native for
* more information.
*/
/*! @defgroup native Native access
* @brief Functions related to accessing native handles.
*
* **By using the native access functions you assert that you know what you're
* doing and how to fix problems caused by using them. If you don't, you
* shouldn't be using them.**
*
* Before the inclusion of @ref glfw3native.h, you may define zero or more
* window system API macro and zero or more context creation API macros.
*
* The chosen backends must match those the library was compiled for. Failure
* to do this will cause a link-time error.
*
* The available window API macros are:
* * `GLFW_EXPOSE_NATIVE_WIN32`
* * `GLFW_EXPOSE_NATIVE_COCOA`
* * `GLFW_EXPOSE_NATIVE_X11`
* * `GLFW_EXPOSE_NATIVE_WAYLAND`
*
* The available context API macros are:
* * `GLFW_EXPOSE_NATIVE_WGL`
* * `GLFW_EXPOSE_NATIVE_NSGL`
* * `GLFW_EXPOSE_NATIVE_GLX`
* * `GLFW_EXPOSE_NATIVE_EGL`
* * `GLFW_EXPOSE_NATIVE_OSMESA`
*
* These macros select which of the native access functions that are declared
* and which platform-specific headers to include. It is then up your (by
* definition platform-specific) code to handle which of these should be
* defined.
*
* If you do not want the platform-specific headers to be included, define
* `GLFW_NATIVE_INCLUDE_NONE` before including the @ref glfw3native.h header.
*
* @code
* #define GLFW_EXPOSE_NATIVE_WIN32
* #define GLFW_EXPOSE_NATIVE_WGL
* #define GLFW_NATIVE_INCLUDE_NONE
* #include <GLFW/glfw3native.h>
* @endcode
*/
/*************************************************************************
* System headers and types
*************************************************************************/
#if !defined(GLFW_NATIVE_INCLUDE_NONE)
#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
/* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
* example to allow applications to correctly declare a GL_KHR_debug callback)
* but windows.h assumes no one will define APIENTRY before it does
*/
#if defined(GLFW_APIENTRY_DEFINED)
#undef APIENTRY
#undef GLFW_APIENTRY_DEFINED
#endif
#include <windows.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#else
#include <ApplicationServices/ApplicationServices.h>
#include <objc/objc.h>
#endif
#endif
#if defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
#include <wayland-client.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
/* WGL is declared by windows.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
/* NSGL is declared by Cocoa.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
* default it also acts as an OpenGL header
* However, glx.h will include gl.h, which will define it unconditionally
*/
#if defined(GLFW_GLAPIENTRY_DEFINED)
#undef GLAPIENTRY
#undef GLFW_GLAPIENTRY_DEFINED
#endif
#include <GL/glx.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
#include <EGL/egl.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
* default it also acts as an OpenGL header
* However, osmesa.h will include gl.h, which will define it unconditionally
*/
#if defined(GLFW_GLAPIENTRY_DEFINED)
#undef GLAPIENTRY
#undef GLFW_GLAPIENTRY_DEFINED
#endif
#include <GL/osmesa.h>
#endif
#endif /*GLFW_NATIVE_INCLUDE_NONE*/
/*************************************************************************
* Functions
*************************************************************************/
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
/*! @brief Returns the adapter device name of the specified monitor.
*
* @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
* of the specified monitor, or `NULL` if an [error](@ref error_handling)
* occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
SSCAPI const char *glfwGetWin32Adapter(GLFWmonitor *monitor);
/*! @brief Returns the display device name of the specified monitor.
*
* @return The UTF-8 encoded display device name (for example
* `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
SSCAPI const char *glfwGetWin32Monitor(GLFWmonitor *monitor);
/*! @brief Returns the `HWND` of the specified window.
*
* @return The `HWND` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark The `HDC` associated with the window can be queried with the
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
* function.
* @code
* HDC dc = GetDC(glfwGetWin32Window(window));
* @endcode
* This DC is private and does not need to be released.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI HWND glfwGetWin32Window(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
/*! @brief Returns the `HGLRC` of the specified window.
*
* @return The `HGLRC` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @remark The `HDC` associated with the window can be queried with the
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
* function.
* @code
* HDC dc = GetDC(glfwGetWin32Window(window));
* @endcode
* This DC is private and does not need to be released.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI HGLRC glfwGetWGLContext(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
/*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
*
* @return The `CGDirectDisplayID` of the specified monitor, or
* `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
SSCAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor *monitor);
/*! @brief Returns the `NSWindow` of the specified window.
*
* @return The `NSWindow` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI id glfwGetCocoaWindow(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
/*! @brief Returns the `NSOpenGLContext` of the specified window.
*
* @return The `NSOpenGLContext` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI id glfwGetNSGLContext(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_X11)
/*! @brief Returns the `Display` used by GLFW.
*
* @return The `Display` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI Display *glfwGetX11Display(void);
/*! @brief Returns the `RRCrtc` of the specified monitor.
*
* @return The `RRCrtc` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
SSCAPI RRCrtc glfwGetX11Adapter(GLFWmonitor *monitor);
/*! @brief Returns the `RROutput` of the specified monitor.
*
* @return The `RROutput` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.1.
*
* @ingroup native
*/
SSCAPI RROutput glfwGetX11Monitor(GLFWmonitor *monitor);
/*! @brief Returns the `Window` of the specified window.
*
* @return The `Window` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI Window glfwGetX11Window(GLFWwindow *window);
/*! @brief Sets the current primary selection to the specified string.
*
* @param[in] string A UTF-8 encoded string.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwGetX11SelectionString
* @sa glfwSetClipboardString
*
* @since Added in version 3.3.
*
* @ingroup native
*/
SSCAPI void glfwSetX11SelectionString(const char *string);
/*! @brief Returns the contents of the current primary selection as a string.
*
* If the selection is empty or if its contents cannot be converted, `NULL`
* is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
*
* @return The contents of the selection as a UTF-8 encoded string, or `NULL`
* if an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
* glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
* library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref clipboard
* @sa glfwSetX11SelectionString
* @sa glfwGetClipboardString
*
* @since Added in version 3.3.
*
* @ingroup native
*/
SSCAPI const char *glfwGetX11SelectionString(void);
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
/*! @brief Returns the `GLXContext` of the specified window.
*
* @return The `GLXContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI GLXContext glfwGetGLXContext(GLFWwindow *window);
/*! @brief Returns the `GLXWindow` of the specified window.
*
* @return The `GLXWindow` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
SSCAPI GLXWindow glfwGetGLXWindow(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
/*! @brief Returns the `struct wl_display*` used by GLFW.
*
* @return The `struct wl_display*` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
SSCAPI struct wl_display *glfwGetWaylandDisplay(void);
/*! @brief Returns the `struct wl_output*` of the specified monitor.
*
* @return The `struct wl_output*` of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
SSCAPI struct wl_output *glfwGetWaylandMonitor(GLFWmonitor *monitor);
/*! @brief Returns the main `struct wl_surface*` of the specified window.
*
* @return The main `struct wl_surface*` of the specified window, or `NULL` if
* an [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.2.
*
* @ingroup native
*/
SSCAPI struct wl_surface *glfwGetWaylandWindow(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
/*! @brief Returns the `EGLDisplay` used by GLFW.
*
* @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @remark Because EGL is initialized on demand, this function will return
* `EGL_NO_DISPLAY` until the first context has been created via EGL.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI EGLDisplay glfwGetEGLDisplay(void);
/*! @brief Returns the `EGLContext` of the specified window.
*
* @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI EGLContext glfwGetEGLContext(GLFWwindow *window);
/*! @brief Returns the `EGLSurface` of the specified window.
*
* @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.0.
*
* @ingroup native
*/
SSCAPI EGLSurface glfwGetEGLSurface(GLFWwindow *window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
/*! @brief Retrieves the color buffer associated with the specified window.
*
* @param[in] window The window whose color buffer to retrieve.
* @param[out] width Where to store the width of the color buffer, or `NULL`.
* @param[out] height Where to store the height of the color buffer, or `NULL`.
* @param[out] format Where to store the OSMesa pixel format of the color
* buffer, or `NULL`.
* @param[out] buffer Where to store the address of the color buffer, or
* `NULL`.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
SSCAPI int glfwGetOSMesaColorBuffer(GLFWwindow *window, int *width, int *height, int *format,
void **buffer);
/*! @brief Retrieves the depth buffer associated with the specified window.
*
* @param[in] window The window whose depth buffer to retrieve.
* @param[out] width Where to store the width of the depth buffer, or `NULL`.
* @param[out] height Where to store the height of the depth buffer, or `NULL`.
* @param[out] bytesPerValue Where to store the number of bytes per depth
* buffer element, or `NULL`.
* @param[out] buffer Where to store the address of the depth buffer, or
* `NULL`.
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
SSCAPI int glfwGetOSMesaDepthBuffer(GLFWwindow *window, int *width, int *height, int *bytesPerValue,
void **buffer);
/*! @brief Returns the `OSMesaContext` of the specified window.
*
* @return The `OSMesaContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
* GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
* @since Added in version 3.3.
*
* @ingroup native
*/
SSCAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow *window);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _glfw3_native_h_ */
+45
View File
@@ -0,0 +1,45 @@
#include "ssc_intrinsic.h"
#include "StgSharpC.h"
INTERNAL int SSCDECL city_hash_simplify_sse(byte const *str, int const length)
{
uint32_t hash = length, size = length << 1;
byte *end = str + size, *ptr = str;
if (size < 4) {
for (; ptr < end; ptr += 2) {
hash = _mm_crc32_u16(hash, *ptr);
}
} else if (size < 16) {
byte *last = end - 4;
for (; ptr < end; ptr += 4) {
hash = _mm_crc32_u32(hash, *(uint32_t *)ptr);
}
for (; ptr < end; ptr++) {
hash = _mm_crc32_u16(hash, *ptr);
}
} else {
byte *last_128 = end - 16;
byte *last_32 = end - 4;
uint64_t hash64 = size;
for (; ptr < last_128; ptr += 16) {
__m128i vec = _mm_loadu_si32((int *)ptr);
hash64 = _mm_crc32_u64(hash64, _mm_extract_epi64(vec, 0));
hash64 = _mm_crc32_u64(hash64, _mm_extract_epi64(vec, 1));
}
hash = _mm_crc32_u8(hash, hash64);
hash = _mm_crc32_u8(hash, hash64 >> 32);
for (; ptr < last_32; ptr += 4) {
hash = _mm_crc32_u32(hash,*(uint32_t *)ptr);
}
for (; ptr < end; ptr += 2) {
hash = _mm_crc32_u8(hash,*ptr);
}
}
hash ^= hash >> 16;
hash *= 0x85ebca6b;
hash ^= hash >> 13;
hash *= 0xc2b2ae35;
hash ^= hash >> 16;
return hash;
}
+141
View File
@@ -0,0 +1,141 @@
#include "StgSharpC.h"
#include "ssc_intrinsic.h"
#ifdef _MSC_VER
#include <intrin.h>
#include <isa_availability.h>
#else
#include <cpuid.h>
#endif // _MSC_VER
PRIVATE void load_intrinsic_sse(ssc_intrinsic *context);
PRIVATE void load_intrinsic_avx(ssc_intrinsic *context);
PRIVATE void load_intrinsic_512(ssc_intrinsic *context);
PRIVATE int check_isa(most_advanced_instruction instruction_family)
{
if (instruction_family != NEON) {
#if _MSC_VER
return __check_isa_support(instruction_family, 0);
#else
switch (instruction_family) {
case SSE:
return __builtin_cpu_supports("sse4.2");
case AVX256:
return __builtin_cpu_supports("avx2");
case AVX512:
return __builtin_cpu_supports("avx512f");
default:
return 0;
}
#endif // _MSC_VER
}
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
return 1;
#else
return 0;
#endif
}
SSCAPI int load_intrinsic_function(void *intrinsic_context)
{
ssc_null_assert(intrinsic_context);
ssc_intrinsic *context = (ssc_intrinsic *)intrinsic_context;
if (check_isa(AVX512)) {
load_intrinsic_512(context);
return 3;
} else if (check_isa(AVX256)) {
load_intrinsic_avx(context);
return 2;
} else if (check_isa(SSE)) {
load_intrinsic_sse(context);
return 1;
} else if (check_isa(NEON)) {
return -1;
}
return 0;
}
void load_intrinsic_sse(ssc_intrinsic *context)
{
context->add_m2 = addmatrix2_sse;
context->add_m3 = addmatrix3_sse;
context->add_m4 = addmatrix4_sse;
context->transpose_23 = transpose23;
context->transpose_24 = transpose24;
context->transpose_32 = transpose32;
context->transpose_33 = transpose33;
context->transpose_34 = transpose34;
context->transpose_42 = transpose42;
context->transpose_43 = transpose43;
context->transpose_44 = transpose44;
context->normalize_3 = normalize;
context->det_matrix33 = det_mat3;
context->det_matrix44 = det_mat4;
context->dot_31 = dot_31_sse;
context->dot_32 = dot_32_sse;
context->dot_41 = dot_41_sse;
context->dot_42 = dot_42_sse;
context->dot_43 = dot_43_sse;
context->city_hash_simplify = city_hash_simplify_sse;
context->index_pair = index_pair_sse;
context->sub_m2 = submatrix2_sse;
context->sub_m3 = submatrix3_sse;
context->sub_m4 = submatrix4_sse;
}
void load_intrinsic_avx(ssc_intrinsic *context)
{
context->add_m2 = addmatrix2_avx;
context->add_m3 = addmatrix3_avx;
context->add_m4 = addmatrix4_avx;
context->transpose_23 = transpose23;
context->transpose_24 = transpose24;
context->transpose_32 = transpose32;
context->transpose_33 = transpose33;
context->transpose_34 = transpose34;
context->transpose_42 = transpose42;
context->transpose_43 = transpose43;
context->transpose_44 = transpose44;
context->normalize_3 = normalize;
context->det_matrix33 = det_mat3;
context->det_matrix44 = det_mat4;
context->dot_31 = dot_31_avx;
context->dot_32 = dot_32_avx;
context->dot_41 = dot_41_avx;
context->dot_42 = dot_42_avx;
context->dot_43 = dot_43_avx;
context->city_hash_simplify = city_hash_simplify_sse;
context->index_pair = index_pair_sse;
}
void load_intrinsic_512(ssc_intrinsic *context)
{
context->add_m2 = addmatrix2_avx;
context->add_m3 = addmatrix3_512;
context->add_m4 = addmatrix4_512;
context->transpose_23 = transpose23;
context->transpose_24 = transpose24;
context->transpose_32 = transpose32;
context->transpose_33 = transpose33;
context->transpose_34 = transpose34;
context->transpose_42 = transpose42;
context->transpose_43 = transpose43;
context->transpose_44 = transpose44;
context->normalize_3 = normalize;
context->det_matrix33 = det_mat3;
context->det_matrix44 = det_mat4;
context->dot_31 = dot_31_avx;
context->dot_32 = dot_32_avx;
context->dot_41 = dot_41_avx;
context->dot_42 = dot_42_avx;
context->dot_43 = dot_43_avx;
context->city_hash_simplify = city_hash_simplify_sse;
context->index_pair = index_pair_sse;
}
+310
View File
@@ -0,0 +1,310 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
#define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
#define KHRONOS_APICALL
#elif defined(_WIN32)
#define KHRONOS_APICALL __declspec(dllimport)
#elif defined(__SYMBIAN32__)
#define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
#define KHRONOS_APICALL __attribute__((visibility("default")))
#else
#define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
#define KHRONOS_APIENTRY __stdcall
#else
#define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined(__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || \
defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */
+57
View File
@@ -0,0 +1,57 @@
#include "StgSharpC.h"
#include "ssc_intrinsic.h"
INTERNAL void __cdecl transpose23(__2_columnset *source, __3_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
}
INTERNAL void __cdecl transpose24(__2_columnset *source, __4_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
target->column[3] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
}
INTERNAL void __cdecl addmatrix2_sse(__2_columnset *left, __2_columnset *right, __2_columnset *ans)
{
__m128 temp0 = _mm_add_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
__m128 temp1 = _mm_add_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
_mm_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][1], temp1);
}
INTERNAL void __cdecl addmatrix2_avx(__2_columnset *left, __2_columnset *right, __2_columnset *ans)
{
__m256 temp = _mm256_add_ps(ALIGN256(left->column[0]), ALIGN256(right->column[0]));
_mm256_storeu_ps(&ans->m[0][0], temp);
}
INTERNAL void __cdecl submatrix2_sse(__2_columnset *left, __2_columnset *right, __2_columnset *ans)
{
__m128 temp0 = _mm_sub_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
__m128 temp1 = _mm_sub_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
_mm_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][1], temp1);
}
INTERNAL void __cdecl submatrix2_avx(__2_columnset *left, __2_columnset *right, __2_columnset *ans)
{
__m256 temp = _mm256_sub_ps(ALIGN256(left->column[0]), ALIGN256(right->column[0]));
_mm256_storeu_ps(&ans->m[0][0], temp);
}
+130
View File
@@ -0,0 +1,130 @@
#include "StgSharpC.h"
#include "ssc_intrinsic.h"
#include <stdio.h>
INTERNAL void _cdecl transpose32(__3_columnset *source, __2_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), zero_vec, _MM_SHUFFLE(1, 0, 1, 0));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
}
INTERNAL void _cdecl transpose33(__3_columnset *source, __3_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), zero_vec, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->column[2]), zero_vec, _MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(2, 0, 2, 0));
}
INTERNAL void _cdecl transpose34(__3_columnset *source, __4_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), zero_vec, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->column[2]), zero_vec, _MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(2, 0, 2, 0));
target->column[3] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(3, 1, 3, 1));
}
INTERNAL float _cdecl det_mat3_internal(__m128 const c0, __m128 const c1, __m128 const c2)
{
//let adding row aligned
__m128 addc1 = _mm_shuffle_ps(c1, c1, _MM_SHUFFLE(3, 0, 2, 1));
__m128 addc2 = _mm_shuffle_ps(c2, c2, _MM_SHUFFLE(3, 1, 0, 2));
//let sub row aligned
__m128 subc1 = _mm_shuffle_ps(c1, c1, _MM_SHUFFLE(3, 1, 0, 2));
__m128 subc2 = _mm_shuffle_ps(c2, c2, _MM_SHUFFLE(3, 0, 2, 1));
//multple all add row
__m128 cache = _mm_mul_ps(c0, addc1);
cache = _mm_mul_ps(cache, addc2);
//multiple all sub row
__m128 sub = _mm_mul_ps(c0, subc1);
sub = _mm_mul_ps(sub, subc2);
//main-corner sub sub-corner
cache = _mm_sub_ps(cache, sub);
__m128 ret = _mm_hadd_ps(cache, cache); //element 1 add element 2
ret = _mm_add_ps(ret, cache); //(e1 add e2) add element 3
return ret.m128_f32[2];
}
INTERNAL float _cdecl det_mat3(__3_columnset *source, __3_columnset *transpose)
{
return det_mat3_internal(source->column[0], source->column[1], source->column[2]);
}
#pragma region add
INTERNAL void __cdecl addmatrix3_sse(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m128 temp0 = _mm_add_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
__m128 temp1 = _mm_add_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
__m128 temp2 = _mm_add_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
_mm_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][1], temp1);
_mm_storeu_ps(&ans->m[0][2], temp2);
}
INTERNAL void __cdecl addmatrix3_avx(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m256 temp0 = _mm256_add_ps(ALIGN256(left->part), ALIGN256(right->part));
__m128 temp1 = _mm_add_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
_mm256_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][2], temp1);
}
INTERNAL void __cdecl addmatrix3_512(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m512 temp = _mm512_add_ps(_mm512_loadu_ps(left), _mm512_loadu_ps(right));
_mm512_mask_store_ps(ans, 0x0fff, temp);
}
INTERNAL void __cdecl submatrix3_sse(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m128 temp0 = _mm_sub_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
__m128 temp1 = _mm_sub_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
__m128 temp2 = _mm_sub_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
_mm_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][1], temp1);
_mm_storeu_ps(&ans->m[0][2], temp2);
}
INTERNAL void __cdecl submatrix3_avx(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m256 temp0 = _mm256_sub_ps(ALIGN256(left->part), ALIGN256(right->part));
__m128 temp1 = _mm_sub_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
_mm256_storeu_ps(&ans->m[0][0], temp0);
_mm_storeu_ps(&ans->m[0][2], temp1);
}
INTERNAL void __cdecl submatrix3_512(__3_columnset *left, __3_columnset *right, __3_columnset *ans)
{
__m512 temp = _mm512_sub_ps(_mm512_loadu_ps(left), _mm512_loadu_ps(right));
_mm512_mask_store_ps(ans, 0x0fff, temp);
}
#pragma endregion
+103
View File
@@ -0,0 +1,103 @@
#include "StgSharpC.h"
#include "ssc_intrinsic.h"
#include <stdio.h>
#include <pmmintrin.h>
INTERNAL void __cdecl transpose42(__4_columnset const *source, __2_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), ALIGN(source->column[3]),
_MM_SHUFFLE(1, 0, 1, 0));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
}
INTERNAL void __cdecl transpose43(__4_columnset const *source, __3_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), ALIGN(source->column[3]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->column[2]), ALIGN(source->column[3]),
_MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(2, 0, 2, 0));
}
INTERNAL void __cdecl transpose44(__4_columnset const *source, __4_columnset *target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
_MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->column[2]), ALIGN(source->column[3]),
_MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->column[2]), ALIGN(source->column[3]),
_MM_SHUFFLE(3, 2, 3, 2));
target->column[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->column[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
target->column[2] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(2, 0, 2, 0));
target->column[3] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(3, 1, 3, 1));
}
INTERNAL float __cdecl det_mat4(__4_columnset const *mat_ptr, __4_columnset const *transpose)
{
__m128 mc0 = ALIGN(mat_ptr->column[0]);
__m128 mc1 = ALIGN(mat_ptr->column[1]);
__m128 mc2 = ALIGN(mat_ptr->column[2]);
__m128 mc3 = ALIGN(mat_ptr->column[3]);
__m128 cogeneration =
_mm_set_ps(det_mat3_internal(mc0, mc1, mc2), det_mat3_internal(mc0, mc1, mc3),
det_mat3_internal(mc0, mc2, mc3), det_mat3_internal(mc1, mc2, mc3));
__m128 retvec = _mm_mul_ps(ALIGN(transpose->column[3]), cogeneration);
retvec = _mm_hsub_ps(retvec, retvec);
retvec = _mm_hadd_ps(retvec, retvec);
return -retvec.m128_f32[0];
}
INTERNAL void SSCDECL addmatrix4_sse(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->column[0] = _mm_add_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
ans->column[1] = _mm_add_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
ans->column[2] = _mm_add_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
ans->column[3] = _mm_add_ps(ALIGN(left->column[3]), ALIGN(right->column[3]));
}
INTERNAL void SSCDECL addmatrix4_avx(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->half[0] = _mm256_add_ps(ALIGN256(left->half[0]), ALIGN256(right->half[0]));
ans->half[1] = _mm256_add_ps(ALIGN256(left->half[1]), ALIGN256(right->half[1]));
}
INTERNAL void SSCDECL addmatrix4_512(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->stream = _mm512_add_ps(ALIGN512(left->stream), ALIGN512(right->stream));
}
INTERNAL void SSCDECL submatrix4_sse(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->column[0] = _mm_sub_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
ans->column[1] = _mm_sub_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
ans->column[2] = _mm_sub_ps(ALIGN(left->column[2]), ALIGN(right->column[2]));
ans->column[3] = _mm_sub_ps(ALIGN(left->column[3]), ALIGN(right->column[3]));
}
INTERNAL void SSCDECL submatrix4_avx(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->half[0] = _mm256_sub_ps(ALIGN256(left->half[0]), ALIGN256(right->half[0]));
ans->half[1] = _mm256_sub_ps(ALIGN256(left->half[1]), ALIGN256(right->half[1]));
}
INTERNAL void SSCDECL submatrix4_512(__4_columnset *left, __4_columnset *right, __4_columnset *ans)
{
ans->stream = _mm512_sub_ps(ALIGN512(left->stream), ALIGN512(right->stream));
}
+37
View File
@@ -0,0 +1,37 @@
#ifdef _MSC_VER
#pragma once
#endif
#include "xmmintrin.h"
/*
#include "GLAD/gl.h"
#include "glfw3.h"
#include "StgSharpC.h"
*/
#ifndef SSC_INTERNAL
#define SSC_INTERNAL
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS 1
#define WIN32_LEAN_AND_MEAN
#define SSCDECL __cdecl
#define SSCAPI __declspec(dllexport)
#define FORCEINLINE __forceinline
#include <windows.h>
#elif defined(__clang__) || defined(__GNUC__)
#define SSCDECL __attribute__((cdecl))
#define SSCAPI __attribute__((dllexport))
#define FORCEINLINE __attribute__((always_inline))
#else
#define SSCAPI
#define SSCDECL
#define FORCEINLINE
#endif
#define SSCAPI_DEFINE
#define PRIVATE static
#define INTERNAL extern
#endif //
+162
View File
@@ -0,0 +1,162 @@
#ifdef _MSC_VER
#pragma once
#endif
#ifndef SSC_INTRIN
#define SSC_INTRIN
#include "StgSharpC.h"
#include <immintrin.h>
#include <smmintrin.h>
#ifdef _MSC_VER
#include <intrin.h>
#include <isa_availability.h>
#endif
#define LASTTWO(x) (x & 3)
#define LAST(x) (x & 3)
#define get_align_begin(x) ((x + 15) & (~15))
#define SSE_INSERT(source, target, reset3, reset2, reset1, reset0) \
(LASTTWO(source - 1) << 6) | (LASTTWO(target - 1) << 4) | (LAST(reset3) << 3) | \
(LAST(reset2) << 2) | (LAST(reset1) << 1) | LAST(reset0)
#define SSE_INSERT_SIMPLE(source, target) SSE_INSERT(source, target, 0, 0, 0, 0)
#define M256_PERMUTE(s3, s2, s1, s0) (LASTTWO(s3) << 6) | (LASTTWO(s2) << 4) | (LASTTWO(s1) << 2) | (LASTTWO(s0)
#define zero_vec _mm_setzero_ps()
#define zero_vec_256 _mm256_setzero_ps()
typedef union uint64_u {
uint64_t u64;
uint32_t u32[2];
} uint64_u;
typedef union column_2 {
__m256 stream;
__m128 column[2];
float m[4][2];
} __2_columnset;
typedef union column_3 {
__m256 part;
__m128 column[3];
float m[4][3];
} __3_columnset;
typedef union column_4 {
__m512 stream;
__m256 half[2];
__m128 column[4];
float m[4][4];
} __4_columnset;
typedef void(SSCDECL *VECTORNORMALIZEPROC)(__m128 *source, __m128 *target);
typedef void(SSCDECL *DOTPROC)(void *transpose, __m128 *vector, __m128 *ans);
typedef void(SSCDECL *MATRIXTRANSPOSEPROC)(void *source, void *target);
typedef void(SSCDECL *MATRIXDETPROC)(void *mat, void *transpose);
typedef void(SSCDECL *MATARITHMETIC)(void *left, void *right, void *ans);
typedef void(SSCDECL *SCALERMATARITHMETIC)(void *left, void *right, void *ans);
#pragma region matix function
INTERNAL void normalize(__m128 *source, __m128 *target);
INTERNAL void SSCDECL addmatrix2_sse(__2_columnset *left, __2_columnset *right, __2_columnset *ans);
INTERNAL void SSCDECL addmatrix2_avx(__2_columnset *left, __2_columnset *right, __2_columnset *ans);
INTERNAL void SSCDECL submatrix2_sse(__2_columnset *left, __2_columnset *right, __2_columnset *ans);
INTERNAL void SSCDECL addmatrix2_avx(__2_columnset *left, __2_columnset *right, __2_columnset *ans);
INTERNAL void SSCDECL transpose23(__2_columnset const *source, __3_columnset *target);
INTERNAL void SSCDECL transpose24(__2_columnset const *source, __4_columnset *target);
INTERNAL void SSCDECL addmatrix3_sse(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL addmatrix3_avx(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL addmatrix3_512(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL submatrix3_sse(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL submatrix3_avx(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL submatrix3_512(__3_columnset *left, __3_columnset *right, __3_columnset *ans);
INTERNAL void SSCDECL transpose32(__3_columnset const *source, __2_columnset *target);
INTERNAL void SSCDECL transpose33(__3_columnset const *source, __3_columnset *target);
INTERNAL void SSCDECL transpose34(__3_columnset const *source, __4_columnset *target);
INTERNAL float SSCDECL det_mat3(__3_columnset *matrix, __3_columnset *tranpose);
INTERNAL void SSCDECL addmatrix4_sse(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL addmatrix4_avx(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL addmatrix4_512(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL submatrix4_sse(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL submatrix4_avx(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL submatrix4_512(__4_columnset *left, __4_columnset *right, __4_columnset *ans);
INTERNAL void SSCDECL transpose42(__4_columnset const *source, __2_columnset *target);
INTERNAL void SSCDECL transpose43(__4_columnset const *source, __3_columnset *target);
INTERNAL void SSCDECL transpose44(__4_columnset const *source, __4_columnset *target);
INTERNAL float SSCDECL det_mat4(__4_columnset *matrix, __4_columnset *transpose);
#pragma endregion
#pragma region dot
INTERNAL void FORCEINLINE SSCDECL dot_41_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void FORCEINLINE SSCDECL dot_31_sse(__3_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void FORCEINLINE SSCDECL dot_41_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void FORCEINLINE SSCDECL dot_31_avx(__3_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_32_sse(__3_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_32_avx(__3_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_42_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_42_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_43_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans);
INTERNAL void SSCDECL dot_43_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans);
//INTERNAL void SSCDECL dot_43_512(__4_columnset *transpose, __m128 *vector, __m128 *ans);
#pragma endregion
#pragma region string
INTERNAL int SSCDECL city_hash_simplify_sse(byte const *str, int length);
INTERNAL int SSCDECL index_pair_sse(short const *str, uint32_t target, int length);
#pragma endregion
typedef struct ssc_intrinsic {
MATARITHMETIC add_m2;
MATARITHMETIC add_m3;
MATARITHMETIC add_m4;
int (*city_hash_simplify)(byte *str, int length);
MATRIXDETPROC det_matrix33;
MATRIXDETPROC det_matrix44;
DOTPROC dot_31;
DOTPROC dot_32;
DOTPROC dot_41;
DOTPROC dot_42;
DOTPROC dot_43;
int (*index_pair)(short const *str, uint32_t target, int length);
VECTORNORMALIZEPROC normalize_3;
MATARITHMETIC sub_m2;
MATARITHMETIC sub_m3;
MATARITHMETIC sub_m4;
MATRIXTRANSPOSEPROC transpose_23;
MATRIXTRANSPOSEPROC transpose_24;
MATRIXTRANSPOSEPROC transpose_32;
MATRIXTRANSPOSEPROC transpose_33;
MATRIXTRANSPOSEPROC transpose_34;
MATRIXTRANSPOSEPROC transpose_42;
MATRIXTRANSPOSEPROC transpose_43;
MATRIXTRANSPOSEPROC transpose_44;
} ssc_intrinsic;
typedef enum most_advanced_instruction {
#ifdef _MSC_VER
SSE = __IA_SUPPORT_SSE42,
AVX256 = __IA_SUPPORT_VECTOR256,
AVX512 = __IA_SUPPORT_VECTOR512,
NEON
#else
SSE,
AVX256,
AVX512,
NEON
#endif
} most_advanced_instruction;
#endif // !SSC_INTRIN
File diff suppressed because it is too large Load Diff
+787
View File
@@ -0,0 +1,787 @@
/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like this:
#include ...
#include ...
#include ...
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
PNG 1/2/4/8/16-bit-per-channel
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels, 8/16 bit-per-channel)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)
Animated GIF still needs a proper API, but here's one way to do it:
http://gist.github.com/urraka/685d9a6340b26b830d49
- decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- decode from arbitrary I/O callbacks
- SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
Full documentation under "DOCUMENTATION" below.
LICENSE
See end of file for license information.
RECENT REVISION HISTORY:
2.28 (2023-01-29) many error fixes, security errors, just tons of stuff
2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes
2.26 (2020-07-13) many minor fixes
2.25 (2020-02-02) fix warnings
2.24 (2020-02-02) fix warnings; thread-local failure_reason and flip_vertically
2.23 (2019-08-11) fix clang static analysis warning
2.22 (2019-03-04) gif fixes, fix warnings
2.21 (2019-02-25) fix typo in comment
2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs
2.19 (2018-02-11) fix warning
2.18 (2018-01-30) fix warnings
2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings
2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes
2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64
RGB-format JPEG; remove white matting in PSD;
allocate large structures on the stack;
correct channel count for PNG & BMP
2.10 (2016-01-22) avoid warning introduced in 2.09
2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
See end of file for full revision history.
============================ Contributors =========================
Image formats Extensions, features
Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info)
Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info)
Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG)
Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks)
Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG)
Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip)
Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD)
github:urraka (animated gif) Junggon Kim (PNM comments)
Christopher Forseth (animated gif) Daniel Gibson (16-bit TGA)
socks-the-fox (16-bit PNG)
Jeremy Sawicki (handle all ImageNet JPGs)
Optimizations & bugfixes Mikhail Morozov (1-bit BMP)
Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query)
Arseny Kapoulkine Simon Breuss (16-bit PNM)
John-Mark Allen
Carmelo J Fdez-Aguera
Bug & warning fixes
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski
Phil Jordan Dave Moore Roy Eltham
Hayaki Saito Nathan Reed Won Chun
Luke Graham Johan Duparc Nick Verigakis the Horde3D community
Thomas Ruf Ronny Chevalier github:rlyeh
Janez Zemva John Bartholomew Michal Cichon github:romigrou
Jonathan Blow Ken Hamada Tero Hanninen github:svdijk
Eugene Golushkov Laurent Gomila Cort Stratton github:snagar
Aruelien Pocheville Sergio Gonzalez Thibault Reuille github:Zelex
Cass Everitt Ryamond Barbiero github:grim210
Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw
Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus
Josh Tobin Neil Bickford Matthew Gregan github:poppolopoppo
Julian Raschke Gregory Mullen Christian Floisand github:darealshinji
Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007
Brad Weinberger Matvey Cherevko github:mosra
Luca Sas Alexander Veselov Zack Middleton [reserved]
Ryan C. Gordon [reserved] [reserved]
DO NOT ADD YOUR NAME HERE
Jacko Dirks
To add your name to the credits, pick a random blank space in the middle and fill it.
80% of merge conflicts on stb PRs are due to people adding their name at the end
of the credits.
*/
#pragma once
#ifndef STBI_INCLUDE_STB_IMAGE_H
#define STBI_INCLUDE_STB_IMAGE_H
// DOCUMENTATION
//
// Limitations:
// - no 12-bit-per-channel JPEG
// - no JPEGs with arithmetic coding
// - GIF always returns *comp=4
//
// Basic usage (see HDR discussion below for HDR usage):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
// // ... process data if not NULL ...
// // ... x = width, y = height, n = # 8-bit components per pixel ...
// // ... replace '0' with '1'..'4' to force that many components per pixel
// // ... but 'n' will always be the number that it would have been if you said 0
// stbi_image_free(data);
//
// Standard parameters:
// int *x -- outputs image width in pixels
// int *y -- outputs image height in pixels
// int *channels_in_file -- outputs # of image components in image file
// int desired_channels -- if non-zero, # of image components requested in result
//
// The return value from an image loader is an 'unsigned char *' which points
// to the pixel data, or NULL on an allocation failure or if the image is
// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
// with each pixel consisting of N interleaved 8-bit components; the first
// pixel pointed to is top-left-most in the image. There is no padding between
// image scanlines or between pixels, regardless of format. The number of
// components N is 'desired_channels' if desired_channels is non-zero, or
// *channels_in_file otherwise. If desired_channels is non-zero,
// *channels_in_file has the number of components that _would_ have been
// output otherwise. E.g. if you set desired_channels to 4, you will always
// get RGBA output, but you can check *channels_in_file to see if it's trivially
// opaque because e.g. there were only 3 channels in the source image.
//
// An output image with N components has the following components interleaved
// in this order in each pixel:
//
// N=#comp components
// 1 grey
// 2 grey, alpha
// 3 red, green, blue
// 4 red, green, blue, alpha
//
// If image loading fails for any reason, the return value will be NULL,
// and *x, *y, *channels_in_file will be unchanged. The function
// stbi_failure_reason() can be queried for an extremely brief, end-user
// unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS
// to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
// more user-friendly ones.
//
// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
//
// To query the width, height and component count of an image without having to
// decode the full file, you can use the stbi_info family of functions:
//
// int x,y,n,ok;
// ok = stbi_info(filename, &x, &y, &n);
// // returns ok=1 and sets x, y, n if image is a supported format,
// // 0 otherwise.
//
// Note that stb_image pervasively uses ints in its public API for sizes,
// including sizes of memory buffers. This is now part of the API and thus
// hard to change without causing breakage. As a result, the various image
// loaders all have certain limits on image size; these differ somewhat
// by format but generally boil down to either just under 2GB or just under
// 1GB. When the decoded image would be larger than this, stb_image decoding
// will fail.
//
// Additionally, stb_image will reject image files that have any of their
// dimensions set to a larger value than the configurable STBI_MAX_DIMENSIONS,
// which defaults to 2**24 = 16777216 pixels. Due to the above memory limit,
// the only way to have an image with such dimensions load correctly
// is for it to have a rather extreme aspect ratio. Either way, the
// assumption here is that such larger images are likely to be malformed
// or malicious. If you do need to load an image with individual dimensions
// larger than that, and it still fits in the overall size limit, you can
// #define STBI_MAX_DIMENSIONS on your own to be something larger.
//
// ===========================================================================
//
// UNICODE:
//
// If compiling for Windows and you wish to use Unicode filenames, compile
// with
// #define STBI_WINDOWS_UTF8
// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert
// Windows wchar_t filenames to utf8.
//
// ===========================================================================
//
// Philosophy
//
// stb libraries are designed with the following priorities:
//
// 1. easy to use
// 2. easy to maintain
// 3. good performance
//
// Sometimes I let "good performance" creep up in priority over "easy to maintain",
// and for best performance I may provide less-easy-to-use APIs that give higher
// performance, in addition to the easy-to-use ones. Nevertheless, it's important
// to keep in mind that from the standpoint of you, a client of this library,
// all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all.
//
// Some secondary priorities arise directly from the first two, some of which
// provide more explicit reasons why performance can't be emphasized.
//
// - Portable ("ease of use")
// - Small source code footprint ("easy to maintain")
// - No dependencies ("ease of use")
//
// ===========================================================================
//
// I/O callbacks
//
// I/O callbacks allow you to read from arbitrary sources, like packaged
// files or some other source. Data read from callbacks are processed
// through a small internal buffer (currently 128 bytes) to try to reduce
// overhead.
//
// The three functions you must define are "read" (reads some bytes of data),
// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
//
// ===========================================================================
//
// SIMD support
//
// The JPEG decoder will try to automatically use SIMD kernels on x86 when
// supported by the compiler. For ARM Neon support, you must explicitly
// request it.
//
// (The old do-it-yourself SIMD API is no longer supported in the current
// code.)
//
// On x86, SSE2 will automatically be used when available based on a run-time
// test; if not, the generic C versions are used as a fall-back. On ARM targets,
// the typical path is to have separate builds for NEON and non-NEON devices
// (at least this is true for iOS and Android). Therefore, the NEON support is
// toggled by a build flag: define STBI_NEON to get NEON loops.
//
// If for some reason you do not want to use any of SIMD code, or if
// you have issues compiling it, you can disable it entirely by
// defining STBI_NO_SIMD.
//
// ===========================================================================
//
// HDR image support (disable by defining STBI_NO_HDR)
//
// stb_image supports loading HDR images in general, and currently the Radiance
// .HDR file format specifically. You can still load any file through the existing
// interface; if you attempt to load an HDR file, it will be automatically remapped
// to LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
// both of these constants can be reconfigured through this interface:
//
// stbi_hdr_to_ldr_gamma(2.2f);
// stbi_hdr_to_ldr_scale(1.0f);
//
// (note, do not use _inverse_ constants; stbi_image will invert them
// appropriately).
//
// Additionally, there is a new, parallel interface for loading files as
// (linear) floats to preserve the full dynamic range:
//
// float *data = stbi_loadf(filename, &x, &y, &n, 0);
//
// If you load LDR images through this interface, those images will
// be promoted to floating point values, run through the inverse of
// constants corresponding to the above:
//
// stbi_ldr_to_hdr_scale(1.0f);
// stbi_ldr_to_hdr_gamma(2.2f);
//
// Finally, given a filename (or an open file or memory block--see header
// file for details) containing image data, you can query for the "most
// appropriate" interface to use (that is, whether the image is HDR or
// not), using:
//
// stbi_is_hdr(char *filename);
//
// ===========================================================================
//
// iPhone PNG support:
//
// We optionally support converting iPhone-formatted PNGs (which store
// premultiplied BGRA) back to RGB, even though they're internally encoded
// differently. To enable this conversion, call
// stbi_convert_iphone_png_to_rgb(1).
//
// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
// pixel to remove any premultiplied alpha *only* if the image file explicitly
// says there's premultiplied data (currently only happens in iPhone images,
// and only if iPhone convert-to-rgb processing is on).
//
// ===========================================================================
//
// ADDITIONAL CONFIGURATION
//
// - You can suppress implementation of any of the decoders to reduce
// your code footprint by #defining one or more of the following
// symbols before creating the implementation.
//
// STBI_NO_JPEG
// STBI_NO_PNG
// STBI_NO_BMP
// STBI_NO_PSD
// STBI_NO_TGA
// STBI_NO_GIF
// STBI_NO_HDR
// STBI_NO_PIC
// STBI_NO_PNM (.ppm and .pgm)
//
// - You can request *only* certain decoders and suppress all other ones
// (this will be more forward-compatible, as addition of new decoders
// doesn't require you to disable them explicitly):
//
// STBI_ONLY_JPEG
// STBI_ONLY_PNG
// STBI_ONLY_BMP
// STBI_ONLY_PSD
// STBI_ONLY_TGA
// STBI_ONLY_GIF
// STBI_ONLY_HDR
// STBI_ONLY_PIC
// STBI_ONLY_PNM (.ppm and .pgm)
//
// - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
// want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
//
// - If you define STBI_MAX_DIMENSIONS, stb_image will reject images greater
// than that size (in either width or height) without further processing.
// This is to let programs in the wild set an upper bound to prevent
// denial-of-service attacks on untrusted data, as one could generate a
// valid image of gigantic dimensions and force stb_image to allocate a
// huge block of memory and spend disproportionate time decoding it. By
// default this is set to (1 << 24), which is 16777216, but that's still
// very big.
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif // STBI_NO_STDIO
#define STBI_VERSION 1
enum {
STBI_default = 0, // only used for desired_channels
STBI_grey = 1,
STBI_grey_alpha = 2,
STBI_rgb = 3,
STBI_rgb_alpha = 4
};
#include <stdlib.h>
typedef unsigned char stbi_uc;
typedef unsigned short stbi_us;
#ifdef __cplusplus
extern "C" {
#endif
#ifndef STBIDEF
#ifdef STB_IMAGE_STATIC
#define STBIDEF static
#else
#define STBIDEF extern
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// PRIMARY API - works on images of any type
//
//
// load image by filename, open file, or memory buffer
//
typedef struct {
int (*read)(
void *user, char *data,
int size); // fill 'data' with 'size' bytes. return number of bytes actually read
void (*skip)(void *user,
int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
int (*eof)(void *user); // returns nonzero if we are at end of file/data
} stbi_io_callbacks;
////////////////////////////////////
//
// 8-bits-per-channel interface
//
STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y,
int *channels_in_file, int desired_channels);
STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y,
int *channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *channels_in_file,
int desired_channels);
STBIDEF void stbi_load_to_target(char const *filename, int *x, int *y, stbi_uc *target,
int *channels_in_file, int desired_channels);
STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *channels_in_file,
int desired_channels);
// for stbi_load_from_file, file pointer is left pointing immediately after image
#endif
#ifndef STBI_NO_GIF
STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x,
int *y, int *z, int *comp, int req_comp);
#endif
#ifdef STBI_WINDOWS_UTF8
STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t *input);
#endif
////////////////////////////////////
//
// 16-bits-per-channel interface
//
STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len, int *x, int *y,
int *channels_in_file, int desired_channels);
STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x,
int *y, int *channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *channels_in_file,
int desired_channels);
STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file,
int desired_channels);
#endif
////////////////////////////////////
//
// float-per-channel interface
//
#ifndef STBI_NO_LINEAR
STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y,
int *channels_in_file, int desired_channels);
STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y,
int *channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *channels_in_file,
int desired_channels);
STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *channels_in_file,
int desired_channels);
#endif
#endif
#ifndef STBI_NO_HDR
STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
STBIDEF void stbi_hdr_to_ldr_scale(float scale);
#endif // STBI_NO_HDR
#ifndef STBI_NO_LINEAR
STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
STBIDEF void stbi_ldr_to_hdr_scale(float scale);
#endif // STBI_NO_LINEAR
// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_is_hdr(char const *filename);
STBIDEF int stbi_is_hdr_from_file(FILE *f);
#endif // STBI_NO_STDIO
// get a VERY brief reason for failure
// on most compilers (and ALL modern mainstream compilers) this is threadsafe
STBIDEF const char *stbi_failure_reason(void);
// free the loaded image -- this is just free()
STBIDEF void stbi_image_free(void *retval_from_stbi_load);
// get image dimensions & components without fully decoding
STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y,
int *comp);
STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len);
STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp);
STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp);
STBIDEF int stbi_is_16_bit(char const *filename);
STBIDEF int stbi_is_16_bit_from_file(FILE *f);
#endif
// for image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
// indicate whether we should process iphone images back to canonical format,
// or just pass them through "as-is"
STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
// flip the image vertically, so the first pixel in the output array is the bottom left
STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
// as above, but only applies to images loaded on the thread that calls the function
// this function is only available if your compiler supports thread-local variables;
// calling it will fail to link if your compiler doesn't
STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply);
STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert);
STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip);
// ZLIB client - used by PNG, available for other purposes
STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size,
int *outlen);
STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len,
int initial_size, int *outlen,
int parse_header);
STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer,
int ilen);
#ifdef __cplusplus
}
#endif
//
//
//// end header file /////////////////////////////////////////////////////
#endif // STBI_INCLUDE_STB_IMAGE_H
/*
revision history:
2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs
2.19 (2018-02-11) fix warning
2.18 (2018-01-30) fix warnings
2.17 (2018-01-29) change sbti__shiftsigned to avoid clang -O2 bug
1-bit BMP
*_is_16_bit api
avoid warnings
2.16 (2017-07-23) all functions have 16-bit variants;
STBI_NO_STDIO works again;
compilation fixes;
fix rounding in unpremultiply;
optimize vertical flip;
disable raw_len validation;
documentation fixes
2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
warning fixes; disable run-time SSE detection on gcc;
uniform handling of optional "return" values;
thread-safe initialization of zlib tables
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
2.13 (2016-11-29) add 16-bit API, only supported for PNG right now
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
2.11 (2016-04-02) allocate large structures on the stack
remove white matting for transparent PSD
fix reported channel count for PNG & BMP
re-enable SSE2 in non-gcc 64-bit
support RGB-formatted JPEG
read 16-bit PNGs (only as 8-bit)
2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED
2.09 (2016-01-16) allow comments in PNM files
16-bit-per-pixel TGA (not bit-per-component)
info() for TGA could break due to .hdr handling
info() for BMP to shares code instead of sloppy parse
can use STBI_REALLOC_SIZED if allocator doesn't support realloc
code cleanup
2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA
2.07 (2015-09-13) fix compiler warnings
partial animated GIF support
limited 16-bpc PSD support
#ifdef unused functions
bug with < 92 byte PIC,PNM,HDR,TGA
2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
2.03 (2015-04-12) extra corruption checking (mmozeiko)
stbi_set_flip_vertically_on_load (nguillemot)
fix NEON support; fix mingw support
2.02 (2015-01-19) fix incorrect assert, fix warning
2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)
progressive JPEG (stb)
PGM/PPM support (Ken Miller)
STBI_MALLOC,STBI_REALLOC,STBI_FREE
GIF bugfix -- seemingly never worked
STBI_NO_*, STBI_ONLY_*
1.48 (2014-12-14) fix incorrectly-named assert()
1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
optimize PNG (ryg)
fix bug in interlaced PNG with user-specified channel count (stb)
1.46 (2014-08-26)
fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG
1.45 (2014-08-16)
fix MSVC-ARM internal compiler error by wrapping malloc
1.44 (2014-08-07)
various warning fixes from Ronny Chevalier
1.43 (2014-07-15)
fix MSVC-only compiler problem in code changed in 1.42
1.42 (2014-07-09)
don't define _CRT_SECURE_NO_WARNINGS (affects user code)
fixes to stbi__cleanup_jpeg path
added STBI_ASSERT to avoid requiring assert.h
1.41 (2014-06-25)
fix search&replace from 1.36 that messed up comments/error messages
1.40 (2014-06-22)
fix gcc struct-initialization warning
1.39 (2014-06-15)
fix to TGA optimization when req_comp != number of components in TGA;
fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
add support for BMP version 5 (more ignored fields)
1.38 (2014-06-06)
suppress MSVC warnings on integer casts truncating values
fix accidental rename of 'skip' field of I/O
1.37 (2014-06-04)
remove duplicate typedef
1.36 (2014-06-03)
convert to header file single-file library
if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
1.35 (2014-05-27)
various warnings
fix broken STBI_SIMD path
fix bug where stbi_load_from_file no longer left file pointer in correct place
fix broken non-easy path for 32-bit BMP (possibly never used)
TGA optimization by Arseny Kapoulkine
1.34 (unknown)
use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
1.33 (2011-07-14)
make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
1.32 (2011-07-13)
support for "info" function for all supported filetypes (SpartanJ)
1.31 (2011-06-20)
a few more leak fixes, bug in PNG handling (SpartanJ)
1.30 (2011-06-11)
added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
removed deprecated format-specific test/load functions
removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
fix inefficiency in decoding 32-bit BMP (David Woo)
1.29 (2010-08-16)
various warning fixes from Aurelien Pocheville
1.28 (2010-08-01)
fix bug in GIF palette transparency (SpartanJ)
1.27 (2010-08-01)
cast-to-stbi_uc to fix warnings
1.26 (2010-07-24)
fix bug in file buffering for PNG reported by SpartanJ
1.25 (2010-07-17)
refix trans_data warning (Won Chun)
1.24 (2010-07-12)
perf improvements reading from files on platforms with lock-heavy fgetc()
minor perf improvements for jpeg
deprecated type-specific functions so we'll get feedback if they're needed
attempt to fix trans_data warning (Won Chun)
1.23 fixed bug in iPhone support
1.22 (2010-07-10)
removed image *writing* support
stbi_info support from Jetro Lauha
GIF support from Jean-Marc Lienher
iPhone PNG-extensions from James Brown
warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
1.21 fix use of 'stbi_uc' in header (reported by jon blow)
1.20 added support for Softimage PIC, by Tom Seddon
1.19 bug in interlaced PNG corruption check (found by ryg)
1.18 (2008-08-02)
fix a threading bug (local mutable static)
1.17 support interlaced PNG
1.16 major bugfix - stbi__convert_format converted one too many pixels
1.15 initialize some fields for thread safety
1.14 fix threadsafe conversion bug
header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
1.13 threadsafe
1.12 const qualifiers in the API
1.11 Support installable IDCT, colorspace conversion routines
1.10 Fixes for 64-bit (don't use "unsigned long")
optimized upsampling by Fabian "ryg" Giesen
1.09 Fix format-conversion for PSD code (bad global variables!)
1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
1.07 attempt to fix C++ warning/errors again
1.06 attempt to fix C++ warning/errors again
1.05 fix TGA loading to return correct *comp and use good luminance calc
1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
1.02 support for (subset of) HDR files, float interface for preferred access to them
1.01 fix bug: possible bug in handling right-side up bmps... not sure
fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
1.00 interface to zlib that skips zlib header
0.99 correct handling of alpha in palette
0.98 TGA loader by lonesock; dynamically add loaders (untested)
0.97 jpeg errors on too large a file; also catch another malloc failure
0.96 fix detection of invalid v value - particleman@mollyrocket forum
0.95 during header scan, seek to markers in case of padding
0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
0.93 handle jpegtran output; verbose errors
0.92 read 4,8,16,24,32-bit BMP files of several formats
0.91 output 24-bit Windows 3.0 BMP files
0.90 fix a few more warnings; bump version number to approach 1.0
0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
0.60 fix compiling as c++
0.59 fix warnings: merge Dave Moore's -Wall fixes
0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
0.56 fix bug: zlib uncompressed mode len vs. nlen
0.55 fix bug: restart_interval not initialized to 0
0.54 allow NULL for 'int *comp'
0.53 fix bug in png 3->4; speedup png decoding
0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
0.51 obey req_comp requests, 1-component jpegs return as 1-component,
on 'test' only check type, not whether we support this variant
0.50 (2006-11-19)
first released version
*/
/*
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
*/
+53
View File
@@ -0,0 +1,53 @@
#include "ssc_intrinsic.h"
int index_pair_sse(short const *str, uint32_t target, int length)
{
int index = 0, result = 0, size = length, end = size - 8;
__m128i s = {
target,
target,
target,
target,
};
__m128i vec, com;
while (index < end) {
vec = _mm_loadu_epi32(str + index);
com = _mm_cmpeq_epi16(vec, s);
result = _mm_movemask_epi8(com);
if (result) {
for (size_t i = 0; i < 7; i++) {
if (((result & 0xF) == 0xF)) {
return index + i;
}
if (result == 0) {
break;
}
result >>= 2;
}
}
index += 1;
vec = _mm_loadu_epi32(str + index);
com = _mm_cmpeq_epi16(vec, s);
result = _mm_movemask_epi8(com);
if (result) {
for (size_t i = 0; i < 7; i++) {
if (((result & 0xF) == 0xF)) {
return index + i;
}
if (result == 0) {
break;
}
result >>= 2;
}
}
index += 7;
}
for (; (index < size - 1) && (!result); index += 2) {
result = *(int *)(str + index) == target;
}
if (result) {
return index;
}
return -1;
}
+31
View File
@@ -0,0 +1,31 @@
#include "StgSharpC.h"
#include "ssc_internal.h"
SSCAPI void SSCDECL normalize(__m128 *source, __m128 *target)
{
__m128 a_length_sq = _mm_mul_ps(*source, *source);
a_length_sq = _mm_add_ps(a_length_sq,
_mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
a_length_sq = _mm_add_ss(a_length_sq,
_mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
__m128 a_inv_length = _mm_rsqrt_ps(a_length_sq);
*source = _mm_mul_ps(*source, a_inv_length);
__m128 dot_product = _mm_mul_ps(*target, *source);
dot_product = _mm_add_ps(dot_product,
_mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(2, 3, 0, 1)));
dot_product = _mm_add_ss(dot_product,
_mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(0, 0, 3, 2)));
__m128 b_orthogonal = _mm_sub_ps(*target, _mm_mul_ps(*source, dot_product));
__m128 b_length_sq = _mm_mul_ps(b_orthogonal, b_orthogonal);
b_length_sq = _mm_add_ps(b_length_sq,
_mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
b_length_sq = _mm_add_ss(b_length_sq,
_mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
__m128 b_inv_length = _mm_rsqrt_ps(b_length_sq);
*target = _mm_mul_ps(b_orthogonal, b_inv_length);
}
+147
View File
@@ -0,0 +1,147 @@
#include "ssc_intrinsic.h"
#include "SSC_internal.h"
static const int avxdot_indices[] = { 0, 4, 1, 5, 2, 3, 6, 7 };
INTERNAL void FORCEINLINE SSCDECL dot_41_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
*ans = _mm_dp_ps(transpose->column[0], *vector, 0B11110001);
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 1));
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[3], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 4));
}
INTERNAL void SSCDECL dot_41_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
__m256 _double = _mm256_set_m128(vector[0], vector[0]);
__m256 tmp = _mm256_dp_ps(transpose->half[0], _double, 0B11110001);
tmp = _mm256_blend_ps(tmp, _mm256_dp_ps(transpose->half[0], _double, 0B11110010),
0B00100010);
*ans = _mm256_castps256_ps128(
_mm256_permutevar8x32_ps(tmp, _mm256_loadu_epi32(avxdot_indices)));
}
INTERNAL void FORCEINLINE SSCDECL dot_31_sse(__3_columnset *transpose, __m128 *vector, __m128 *ans)
{
*ans = _mm_dp_ps(transpose->column[0], *vector, 0B11110001);
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 2));
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
}
INTERNAL void FORCEINLINE SSCDECL dot_31_avx(__3_columnset *transpose, __m128 *vector, __m128 *ans)
{
__m256 _double = _mm256_set_m128(vector[0], vector[0]);
__m256 tmp = _mm256_dp_ps(transpose->part, _double, 0B11110001);
*ans = _mm256_castps256_ps128(
_mm256_permutevar8x32_ps(tmp, _mm256_loadu_epi32(avxdot_indices)));
*ans = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], *vector, 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
}
INTERNAL void SSCDECL dot_42_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
ans[0] = _mm_dp_ps(transpose->column[0], vector[0], 0B11110001);
ans[0] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], vector[0], 0B11110001),
SSE_INSERT_SIMPLE(1, 2));
ans[0] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], vector[0], 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
ans[0] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[3], vector[0], 0B11110001),
SSE_INSERT_SIMPLE(1, 4));
ans[1] = _mm_dp_ps(transpose->column[0], vector[1], 0B11110001);
ans[1] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], vector[1], 0B11110001),
SSE_INSERT_SIMPLE(1, 2));
ans[1] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], vector[1], 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
ans[1] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[3], vector[1], 0B11110001),
SSE_INSERT_SIMPLE(1, 4));
}
INTERNAL void SSCDECL dot_32_sse(__3_columnset *transpose, __m128 *vector, __m128 *ans)
{
ans[0] = _mm_dp_ps(transpose->column[0], vector[0], 0B11110001);
ans[0] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], vector[0], 0B11110001),
SSE_INSERT_SIMPLE(1, 2));
ans[0] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], vector[0], 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
ans[1] = _mm_dp_ps(transpose->column[0], vector[1], 0B11110001);
ans[1] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[1], vector[1], 0B11110001),
SSE_INSERT_SIMPLE(1, 2));
ans[1] = _mm_insert_ps(*ans, _mm_dp_ps(transpose->column[2], vector[1], 0B11110001),
SSE_INSERT_SIMPLE(1, 3));
}
INTERNAL void SSCDECL dot_42_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
__2_columnset *ans_ptr = (__2_columnset *)ans, *right_ptr = (__2_columnset *)vector;
__m256 temp = ALIGN256(transpose->half[0]);
ans_ptr->stream = _mm256_dp_ps(temp, right_ptr->stream, 0B11110001);
temp = _mm256_permute2f128_ps(temp, temp, 0B00000001);
ans_ptr->stream = _mm256_blend_ps(
ans_ptr->stream, _mm256_dp_ps(temp, right_ptr->stream, 0B11110010), 0B00100010);
temp = ALIGN256(transpose->half[1]);
ans_ptr->stream = _mm256_blend_ps(
ans_ptr->stream, _mm256_dp_ps(temp, right_ptr->stream, 0B11110100), 0B01000100);
temp = _mm256_permute2f128_ps(temp, temp, 0B00000001);
ans_ptr->stream = _mm256_blend_ps(
ans_ptr->stream, _mm256_dp_ps(temp, right_ptr->stream, 0B11111000), 0B10001000);
ans[1] = _mm_shuffle_ps(ALIGN(ans[1]), ALIGN(ans[1]), _MM_SHUFFLE(2, 3, 0, 1));
}
INTERNAL void SSCDECL dot_32_avx(__3_columnset *transpose, __m128 *vector, __m128 *ans)
{
__2_columnset *ans_ptr = (__2_columnset *)ans, *right_ptr = (__2_columnset *)vector;
__m256 temp = transpose->part;
ans_ptr->stream = _mm256_dp_ps(temp, right_ptr->stream, 0B11110001);
temp = _mm256_permute2f128_ps(temp, temp, 0B00000001);
ans_ptr->stream = _mm256_blend_ps(
ans_ptr->stream, _mm256_dp_ps(temp, right_ptr->stream, 0B11110010), 0B00100010);
temp = _mm256_set_m128(transpose->column[2], transpose->column[2]);
ans_ptr->stream = _mm256_blend_ps(
ans_ptr->stream, _mm256_dp_ps(temp, right_ptr->stream, 0B11110100), 0B01000100);
ans[1] = _mm_shuffle_ps(ALIGN(ans[1]), ALIGN(ans[1]), _MM_SHUFFLE(2, 2, 0, 1));
}
INTERNAL void SSCDECL dot_43_sse(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
dot_41_sse(transpose, vector, ans);
dot_41_sse(transpose, vector + 1, ans + 1);
dot_41_sse(transpose, vector + 2, ans + 2);
}
INTERNAL void SSCDECL dot_43_avx(__4_columnset *transpose, __m128 *vector, __m128 *ans)
{
__3_columnset *ans_ptr = (__3_columnset *)ans, *right_ptr = (__3_columnset *)vector;
__m256 temp = ALIGN256(transpose->half[0]);
__m256 third = _mm256_set_m128(right_ptr->column[2], right_ptr->column[2]);
ans_ptr->part = _mm256_dp_ps(temp, right_ptr->part, 0B11110001);
__m256 ans_third = _mm256_dp_ps(temp, third, 0B11110001);
temp = _mm256_permute2f128_ps(temp, temp, 0B00000001);
ans_ptr->part = _mm256_blend_ps(
ans_ptr->part, _mm256_dp_ps(temp, right_ptr->part, 0B11110010), 0B00100010);
temp = ALIGN256(transpose->half[1]);
ans_ptr->part = _mm256_blend_ps(
ans_ptr->part, _mm256_dp_ps(temp, right_ptr->part, 0B11110100), 0B01000100);
ans_third = _mm256_blend_ps(ans_third, _mm256_dp_ps(temp, third, 0B11110010), 0B00100010);
temp = _mm256_permute2f128_ps(temp, temp, 0B00000001);
ans_ptr->part = _mm256_blend_ps(
ans_ptr->part, _mm256_dp_ps(temp, right_ptr->part, 0B11111000), 0B10001000);
ans[1] = _mm_shuffle_ps(ALIGN(ans[1]), ALIGN(ans[1]), _MM_SHUFFLE(2, 3, 0, 1));
ans[2] = _mm256_castps256_ps128(
_mm256_permutevar8x32_ps(ans_third, _mm256_loadu_epi32(avxdot_indices)));
}
+1076
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,52 @@
c:\users\youmu\onedrive - msft\大学\毕业设计\graduationproject\build\stgsharp.c.bsc
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stb_image.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stb_image.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stb_image.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat2.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat2.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat2.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\hash.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\hash.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\hash.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\string.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\string.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\string.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat4.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat4.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat4.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharpc.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharpc.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharpc.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat3.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat3.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\mat3.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector_dot.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector_dot.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vector_dot.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\dllmain.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\dllmain.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\dllmain.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\intrinsic.sbr
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\intrinsic.obj
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\intrinsic.cod
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vc143.pdb
c:\users\youmu\onedrive - msft\大学\毕业设计\graduationproject\build\stgsharp.c.dll
c:\users\youmu\onedrive - msft\大学\毕业设计\graduationproject\build\stgsharp.c.pdb
c:\users\youmu\onedrive - msft\大学\毕业设计\graduationproject\build\stgsharp.c.lib
c:\users\youmu\onedrive - msft\大学\毕业设计\graduationproject\build\stgsharp.c.exp
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.ilk
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\vc143.idb
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\bscmake.command.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\bscmake.read.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\bscmake.write.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\cl.12408.write.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\cl.command.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\cl.items.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\cl.read.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\link.command.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\link.read.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\link.secondary.1.tlog
d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\内核源代码\stgsharp.c\x64\debug\stgsharp.c.tlog\link.write.1.tlog
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\dllmain.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\dllmain.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\intrinsic.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\intrinsic.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat2.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\mat2.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat3.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\mat3.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\mat4.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\stb_image.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\stb_image.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\StgSharpC.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\hash.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\string.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\string.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\vector.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\vector.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\vector_dot.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\vector_dot.obj
@@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.22621.0:
Debug|x64|D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\|
@@ -0,0 +1,4 @@
^D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3DLL.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3_MT.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\DLLMAIN.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\HASH.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\INTRINSIC.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\MAT2.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\MAT3.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\MAT4.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\STB_IMAGE.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\STGSHARPC.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\STRING.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\VECTOR.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\DEBUG\VECTOR_DOT.OBJ
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.lib
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.EXP
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Debug\StgSharp.C.ilk
+869
View File
@@ -0,0 +1,869 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__9BC420BA_StgSharpC@c DB 01H
msvcjmc ENDS
PUBLIC glCheckShaderStat
PUBLIC initGL
PUBLIC linkShaderProgram
PUBLIC loadImageData
PUBLIC loadGlfuncDefault
PUBLIC unloadImageData
PUBLIC readLog
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ ; `string'
EXTRN __report_rangecheckfailure:PROC
EXTRN __imp_free:PROC
EXTRN __imp_strcpy_s:PROC
EXTRN stbi_load:PROC
EXTRN glfwWindowHint:PROC
EXTRN glfwGetProcAddress:PROC
EXTRN _RTC_CheckStackVars:PROC
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __security_check_cookie:PROC
EXTRN __security_cookie:QWORD
; COMDAT pdata
pdata SEGMENT
$pdata$glCheckShaderStat DD imagerel $LN4
DD imagerel $LN4+232
DD imagerel $unwind$glCheckShaderStat
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$initGL DD imagerel $LN3
DD imagerel $LN3+111
DD imagerel $unwind$initGL
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$linkShaderProgram DD imagerel $LN5
DD imagerel $LN5+227
DD imagerel $unwind$linkShaderProgram
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$loadImageData DD imagerel $LN4
DD imagerel $LN4+143
DD imagerel $unwind$loadImageData
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$loadGlfuncDefault DD imagerel $LN7
DD imagerel $LN7+160
DD imagerel $unwind$loadGlfuncDefault
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$unloadImageData DD imagerel $LN3
DD imagerel $LN3+60
DD imagerel $unwind$unloadImageData
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$readLog DD imagerel $LN5
DD imagerel $LN5+103
DD imagerel $unwind$readLog
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@
CONST SEGMENT
??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ DB 'Failed to load Op'
DB 'enGL api:', 00H ; `string'
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$readLog DD 025050f01H
DD 010a230fH
DD 070030021H
DD 05002H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$unloadImageData DD 025051301H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$loadGlfuncDefault DD 025051301H
DD 010e2313H
DD 070070025H
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$loadImageData DD 035051d01H
DD 0118331dH
DD 07011001fH
DD 05010H
xdata ENDS
; COMDAT voltbl
voltbl SEGMENT
_volmd DB 03aH
DB 0caH
voltbl ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$linkShaderProgram DD 025054119H
DD 01122317H
DD 0700b0021H
DD 0500aH
DD imagerel __GSHandlerCheck
DD 0f8H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
linkShaderProgram$rtcName$0 DB 073H
DB 075H
DB 063H
DB 063H
DB 065H
DB 073H
DB 073H
DB 00H
ORG $+8
linkShaderProgram$rtcVarDesc DD 024H
DD 04H
DQ FLAT:linkShaderProgram$rtcName$0
ORG $+48
linkShaderProgram$rtcFrameData DD 01H
DD 00H
DQ FLAT:linkShaderProgram$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$initGL DD 025051601H
DD 01112316H
DD 0700a001dH
DD 05009H
xdata ENDS
; COMDAT voltbl
voltbl SEGMENT
_volmd DB 045H
DB 0cfH
voltbl ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$glCheckShaderStat DD 025054c19H
DD 011d2322H
DD 070160021H
DD 05015H
DD imagerel __GSHandlerCheck
DD 0f8H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
glCheckShaderStat$rtcName$0 DB 073H
DB 074H
DB 061H
DB 074H
DB 00H
ORG $+11
glCheckShaderStat$rtcVarDesc DD 024H
DD 04H
DQ FLAT:glCheckShaderStat$rtcName$0
ORG $+48
glCheckShaderStat$rtcFrameData DD 01H
DD 00H
DQ FLAT:glCheckShaderStat$rtcVarDesc
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT readLog
_TEXT SEGMENT
$T1 = 200
readLog PROC ; COMDAT
; 72 : {
$LN5:
00000 40 55 push rbp
00002 57 push rdi
00003 48 81 ec 08 01
00 00 sub rsp, 264 ; 00000108H
0000a 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
0000f 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001b 90 npad 1
; 73 : infolog[511] = '\0';
0001c b8 01 00 00 00 mov eax, 1
00021 48 69 c0 ff 01
00 00 imul rax, rax, 511 ; 000001ffH
00028 48 89 85 c8 00
00 00 mov QWORD PTR $T1[rbp], rax
0002f 48 81 bd c8 00
00 00 00 02 00
00 cmp QWORD PTR $T1[rbp], 512 ; 00000200H
0003a 73 02 jae SHORT $LN3@readLog
0003c eb 06 jmp SHORT $LN4@readLog
$LN3@readLog:
0003e e8 00 00 00 00 call __report_rangecheckfailure
00043 90 npad 1
$LN4@readLog:
00044 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:infolog
0004b 48 8b 8d c8 00
00 00 mov rcx, QWORD PTR $T1[rbp]
00052 c6 04 08 00 mov BYTE PTR [rax+rcx], 0
; 74 : return infolog;
00056 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:infolog
$LN2@readLog:
; 75 : }
0005d 48 8d a5 e8 00
00 00 lea rsp, QWORD PTR [rbp+232]
00064 5f pop rdi
00065 5d pop rbp
00066 c3 ret 0
readLog ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT unloadImageData
_TEXT SEGMENT
out$ = 224
unloadImageData PROC ; COMDAT
; 67 : {
$LN3:
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
00005 55 push rbp
00006 57 push rdi
00007 48 81 ec e8 00
00 00 sub rsp, 232 ; 000000e8H
0000e 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00013 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001f 90 npad 1
; 68 : free(out->pixelPtr);
00020 48 8b 85 e0 00
00 00 mov rax, QWORD PTR out$[rbp]
00027 48 8b 48 10 mov rcx, QWORD PTR [rax+16]
0002b ff 15 00 00 00
00 call QWORD PTR __imp_free
00031 90 npad 1
; 69 : }
00032 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200]
00039 5f pop rdi
0003a 5d pop rbp
0003b c3 ret 0
unloadImageData ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT loadGlfuncDefault
_TEXT SEGMENT
ret$ = 8
i$1 = 40
procName$ = 288
loadGlfuncDefault PROC ; COMDAT
; 31 : {
$LN7:
00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
00005 55 push rbp
00006 57 push rdi
00007 48 81 ec 28 01
00 00 sub rsp, 296 ; 00000128H
0000e 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00013 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0001f 90 npad 1
; 32 : void *ret = glfwGetProcAddress(procName);
00020 48 8b 8d 20 01
00 00 mov rcx, QWORD PTR procName$[rbp]
00027 e8 00 00 00 00 call glfwGetProcAddress
0002c 48 89 45 08 mov QWORD PTR ret$[rbp], rax
; 33 : // printf("%llu\n", (uint64_t)ret);
; 34 : if (ret == NULL) {
00030 48 83 7d 08 00 cmp QWORD PTR ret$[rbp], 0
00035 75 5b jne SHORT $LN5@loadGlfunc
; 35 : strcpy_s(infolog,30, "Failed to load OpenGL api:");
00037 4c 8d 05 00 00
00 00 lea r8, OFFSET FLAT:??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@
0003e ba 1e 00 00 00 mov edx, 30
00043 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:infolog
0004a ff 15 00 00 00
00 call QWORD PTR __imp_strcpy_s
00050 90 npad 1
; 36 : for (size_t i = 0; i < sizeof(procName); i++) {
00051 48 c7 45 28 00
00 00 00 mov QWORD PTR i$1[rbp], 0
00059 eb 0b jmp SHORT $LN4@loadGlfunc
$LN2@loadGlfunc:
0005b 48 8b 45 28 mov rax, QWORD PTR i$1[rbp]
0005f 48 ff c0 inc rax
00062 48 89 45 28 mov QWORD PTR i$1[rbp], rax
$LN4@loadGlfunc:
00066 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8
0006b 73 25 jae SHORT $LN3@loadGlfunc
; 37 : infolog[30 + i] = procName[i];
0006d 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:infolog
00074 48 8b 4d 28 mov rcx, QWORD PTR i$1[rbp]
00078 48 8b 95 20 01
00 00 mov rdx, QWORD PTR procName$[rbp]
0007f 48 03 d1 add rdx, rcx
00082 48 8b ca mov rcx, rdx
00085 48 8b 55 28 mov rdx, QWORD PTR i$1[rbp]
00089 0f b6 09 movzx ecx, BYTE PTR [rcx]
0008c 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl
; 38 : }
00090 eb c9 jmp SHORT $LN2@loadGlfunc
$LN3@loadGlfunc:
$LN5@loadGlfunc:
; 39 : //printf("%s\n", infolog);
; 40 : }
; 41 : return (GLFWglproc)ret;
00092 48 8b 45 08 mov rax, QWORD PTR ret$[rbp]
; 42 : }
00096 48 8d a5 08 01
00 00 lea rsp, QWORD PTR [rbp+264]
0009d 5f pop rdi
0009e 5d pop rbp
0009f c3 ret 0
loadGlfuncDefault ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT loadImageData
_TEXT SEGMENT
location$ = 224
out$ = 232
loader$ = 240
loadImageData PROC ; COMDAT
; 59 : {
$LN4:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000f 55 push rbp
00010 57 push rdi
00011 48 81 ec f8 00
00 00 sub rsp, 248 ; 000000f8H
00018 48 8d 6c 24 30 lea rbp, QWORD PTR [rsp+48]
0001d 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00029 90 npad 1
; 60 : if (loader == NULL) {
0002a 48 83 bd f0 00
00 00 00 cmp QWORD PTR loader$[rbp], 0
00032 75 0e jne SHORT $LN2@loadImageD
; 61 : loader = stbi_load;
00034 48 8d 05 00 00
00 00 lea rax, OFFSET FLAT:stbi_load
0003b 48 89 85 f0 00
00 00 mov QWORD PTR loader$[rbp], rax
$LN2@loadImageD:
; 62 : }
; 63 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0);
00042 48 8b 85 e8 00
00 00 mov rax, QWORD PTR out$[rbp]
00049 48 83 c0 08 add rax, 8
0004d 48 8b 8d e8 00
00 00 mov rcx, QWORD PTR out$[rbp]
00054 48 83 c1 04 add rcx, 4
00058 48 8b 95 e8 00
00 00 mov rdx, QWORD PTR out$[rbp]
0005f c7 44 24 20 00
00 00 00 mov DWORD PTR [rsp+32], 0
00067 4c 8b c8 mov r9, rax
0006a 4c 8b c1 mov r8, rcx
0006d 48 8b 8d e0 00
00 00 mov rcx, QWORD PTR location$[rbp]
00074 ff 95 f0 00 00
00 call QWORD PTR loader$[rbp]
0007a 48 8b 8d e8 00
00 00 mov rcx, QWORD PTR out$[rbp]
00081 48 89 41 10 mov QWORD PTR [rcx+16], rax
; 64 : }
00085 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200]
0008c 5f pop rdi
0008d 5d pop rbp
0008e c3 ret 0
loadImageData ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT linkShaderProgram
_TEXT SEGMENT
success$ = 4
__$ArrayPad$ = 216
context$ = 256
shaderProgram$ = 264
linkShaderProgram PROC ; COMDAT
; 45 : {
$LN5:
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
00004 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
00009 55 push rbp
0000a 57 push rdi
0000b 48 81 ec 08 01
00 00 sub rsp, 264 ; 00000108H
00012 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00017 48 8d 7c 24 20 lea rdi, QWORD PTR [rsp+32]
0001c b9 0a 00 00 00 mov ecx, 10
00021 b8 cc cc cc cc mov eax, -858993460 ; ccccccccH
00026 f3 ab rep stosd
00028 48 8b 8c 24 28
01 00 00 mov rcx, QWORD PTR [rsp+296]
00030 48 8b 05 00 00
00 00 mov rax, QWORD PTR __security_cookie
00037 48 33 c5 xor rax, rbp
0003a 48 89 85 d8 00
00 00 mov QWORD PTR __$ArrayPad$[rbp], rax
00041 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
00048 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
0004d 90 npad 1
; 46 : context->LinkProgram(shaderProgram);
0004e 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderProgram$[rbp]
00054 48 8b 85 00 01
00 00 mov rax, QWORD PTR context$[rbp]
0005b ff 90 80 22 00
00 call QWORD PTR [rax+8832]
00061 90 npad 1
; 47 :
; 48 : int success;
; 49 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
00062 4c 8d 45 04 lea r8, QWORD PTR success$[rbp]
00066 ba 82 8b 00 00 mov edx, 35714 ; 00008b82H
0006b 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderProgram$[rbp]
00071 48 8b 85 00 01
00 00 mov rax, QWORD PTR context$[rbp]
00078 ff 90 48 1a 00
00 call QWORD PTR [rax+6728]
0007e 90 npad 1
; 50 : if (!success) {
0007f 83 7d 04 00 cmp DWORD PTR success$[rbp], 0
00083 75 29 jne SHORT $LN2@linkShader
; 51 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog);
00085 4c 8d 0d 00 00
00 00 lea r9, OFFSET FLAT:infolog
0008c 45 33 c0 xor r8d, r8d
0008f ba 00 02 00 00 mov edx, 512 ; 00000200H
00094 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderProgram$[rbp]
0009a 48 8b 85 00 01
00 00 mov rax, QWORD PTR context$[rbp]
000a1 ff 90 98 19 00
00 call QWORD PTR [rax+6552]
000a7 90 npad 1
; 52 : return 0;
000a8 33 c0 xor eax, eax
000aa eb 08 jmp SHORT $LN1@linkShader
; 53 : } else {
000ac eb 06 jmp SHORT $LN3@linkShader
$LN2@linkShader:
; 54 : return shaderProgram;
000ae 8b 85 08 01 00
00 mov eax, DWORD PTR shaderProgram$[rbp]
$LN3@linkShader:
$LN1@linkShader:
; 55 : }
; 56 : }
000b4 48 8b f8 mov rdi, rax
000b7 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32]
000bb 48 8d 15 00 00
00 00 lea rdx, OFFSET FLAT:linkShaderProgram$rtcFrameData
000c2 e8 00 00 00 00 call _RTC_CheckStackVars
000c7 48 8b c7 mov rax, rdi
000ca 48 8b 8d d8 00
00 00 mov rcx, QWORD PTR __$ArrayPad$[rbp]
000d1 48 33 cd xor rcx, rbp
000d4 e8 00 00 00 00 call __security_check_cookie
000d9 48 8d a5 e8 00
00 00 lea rsp, QWORD PTR [rbp+232]
000e0 5f pop rdi
000e1 5d pop rbp
000e2 c3 ret 0
linkShaderProgram ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT initGL
_TEXT SEGMENT
majorVersion$ = 224
minorVersion$ = 232
initGL PROC ; COMDAT
; 23 : {
$LN3:
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
00004 89 4c 24 08 mov DWORD PTR [rsp+8], ecx
00008 55 push rbp
00009 57 push rdi
0000a 48 81 ec e8 00
00 00 sub rsp, 232 ; 000000e8H
00011 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00016 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
0001d e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00022 90 npad 1
; 24 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion);
00023 8b 95 e0 00 00
00 mov edx, DWORD PTR majorVersion$[rbp]
00029 b9 02 20 02 00 mov ecx, 139266 ; 00022002H
0002e e8 00 00 00 00 call glfwWindowHint
00033 90 npad 1
; 25 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion);
00034 8b 95 e8 00 00
00 mov edx, DWORD PTR minorVersion$[rbp]
0003a b9 03 20 02 00 mov ecx, 139267 ; 00022003H
0003f e8 00 00 00 00 call glfwWindowHint
00044 90 npad 1
; 26 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
00045 ba 01 20 03 00 mov edx, 204801 ; 00032001H
0004a b9 08 20 02 00 mov ecx, 139272 ; 00022008H
0004f e8 00 00 00 00 call glfwWindowHint
00054 90 npad 1
; 27 : glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
00055 ba 01 00 00 00 mov edx, 1
0005a b9 03 00 02 00 mov ecx, 131075 ; 00020003H
0005f e8 00 00 00 00 call glfwWindowHint
00064 90 npad 1
; 28 : }
00065 48 8d a5 c8 00
00 00 lea rsp, QWORD PTR [rbp+200]
0006c 5f pop rdi
0006d 5d pop rbp
0006e c3 ret 0
initGL ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\StgSharpC.c
; COMDAT glCheckShaderStat
_TEXT SEGMENT
stat$ = 4
__$ArrayPad$ = 216
context$ = 256
shaderHandle$ = 264
key$ = 272
logRef$ = 280
glCheckShaderStat PROC ; COMDAT
; 12 : {
$LN4:
00000 4c 89 4c 24 20 mov QWORD PTR [rsp+32], r9
00005 44 89 44 24 18 mov DWORD PTR [rsp+24], r8d
0000a 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000f 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
00014 55 push rbp
00015 57 push rdi
00016 48 81 ec 08 01
00 00 sub rsp, 264 ; 00000108H
0001d 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00022 48 8d 7c 24 20 lea rdi, QWORD PTR [rsp+32]
00027 b9 0a 00 00 00 mov ecx, 10
0002c b8 cc cc cc cc mov eax, -858993460 ; ccccccccH
00031 f3 ab rep stosd
00033 48 8b 8c 24 28
01 00 00 mov rcx, QWORD PTR [rsp+296]
0003b 48 8b 05 00 00
00 00 mov rax, QWORD PTR __security_cookie
00042 48 33 c5 xor rax, rbp
00045 48 89 85 d8 00
00 00 mov QWORD PTR __$ArrayPad$[rbp], rax
0004c 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__9BC420BA_StgSharpC@c
00053 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00058 90 npad 1
; 13 : int stat = 0;
00059 c7 45 04 00 00
00 00 mov DWORD PTR stat$[rbp], 0
; 14 : context->GetShaderiv(shaderHandle, key, &stat);
00060 4c 8d 45 04 lea r8, QWORD PTR stat$[rbp]
00064 8b 95 10 01 00
00 mov edx, DWORD PTR key$[rbp]
0006a 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderHandle$[rbp]
00070 48 8b 85 00 01
00 00 mov rax, QWORD PTR context$[rbp]
00077 ff 90 40 1b 00
00 call QWORD PTR [rax+6976]
0007d 90 npad 1
; 15 : if (!stat) {
0007e 83 7d 04 00 cmp DWORD PTR stat$[rbp], 0
00082 75 23 jne SHORT $LN2@glCheckSha
; 16 : context->GetShaderInfoLog(shaderHandle, 512, NULL, infolog);
00084 4c 8d 0d 00 00
00 00 lea r9, OFFSET FLAT:infolog
0008b 45 33 c0 xor r8d, r8d
0008e ba 00 02 00 00 mov edx, 512 ; 00000200H
00093 8b 8d 08 01 00
00 mov ecx, DWORD PTR shaderHandle$[rbp]
00099 48 8b 85 00 01
00 00 mov rax, QWORD PTR context$[rbp]
000a0 ff 90 20 1b 00
00 call QWORD PTR [rax+6944]
000a6 90 npad 1
$LN2@glCheckSha:
; 17 : }
; 18 : *logRef = infolog;
000a7 48 8b 85 18 01
00 00 mov rax, QWORD PTR logRef$[rbp]
000ae 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:infolog
000b5 48 89 08 mov QWORD PTR [rax], rcx
; 19 : return stat;
000b8 8b 45 04 mov eax, DWORD PTR stat$[rbp]
; 20 : }
000bb 8b f8 mov edi, eax
000bd 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32]
000c1 48 8d 15 00 00
00 00 lea rdx, OFFSET FLAT:glCheckShaderStat$rtcFrameData
000c8 e8 00 00 00 00 call _RTC_CheckStackVars
000cd 8b c7 mov eax, edi
000cf 48 8b 8d d8 00
00 00 mov rcx, QWORD PTR __$ArrayPad$[rbp]
000d6 48 33 cd xor rcx, rbp
000d9 e8 00 00 00 00 call __security_check_cookie
000de 48 8d a5 e8 00
00 00 lea rsp, QWORD PTR [rbp+232]
000e5 5f pop rdi
000e6 5d pop rbp
000e7 c3 ret 0
glCheckShaderStat ENDP
_TEXT ENDS
END
+10
View File
@@ -0,0 +1,10 @@
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output 目录未以斜杠结尾。 此生成实例将添加斜杠,因为必须有这个斜杠才能正确计算 Output 目录。
hash.c
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c(30,43): warning C4244: “函数”: 从“uint64_t”转换到“unsigned char”,可能丢失数据
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c(31,50): warning C4244: “函数”: 从“uint64_t”转换到“unsigned char”,可能丢失数据
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c(7,15): warning C4090: “初始化”: 不同的“const”限定符
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c(7,34): warning C4090: “初始化”: 不同的“const”限定符
LINK : 没有找到 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.dll 或上一个增量链接没有生成它;正在执行完全链接
正在创建库 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.lib 和对象 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.exp
LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\build\StgSharp.C.dll
Binary file not shown.
Binary file not shown.
+263
View File
@@ -0,0 +1,263 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__F35F2EF4_dllmain@c DB 01H
msvcjmc ENDS
PUBLIC DllMain
PUBLIC __JustMyCode_Default
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
; COMDAT pdata
pdata SEGMENT
$pdata$DllMain DD imagerel $LN9
DD imagerel $LN9+134
DD imagerel $unwind$DllMain
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$DllMain DD 025051c01H
DD 0117231cH
DD 07010001fH
DD 0500fH
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\ŃĐžżĎîÄż\1-Flagship\TH2020\ProjectFile\ÄÚşËÔ´´úÂë\StgSharp.C\dllmain.c
; COMDAT DllMain
_TEXT SEGMENT
tv64 = 192
hModule$ = 240
ul_reason_for_call$ = 248
lpReserved$ = 256
DllMain PROC ; COMDAT
; 13 : {
$LN9:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 89 54 24 10 mov DWORD PTR [rsp+16], edx
00009 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000e 55 push rbp
0000f 57 push rdi
00010 48 81 ec f8 00
00 00 sub rsp, 248 ; 000000f8H
00017 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
0001c 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__F35F2EF4_dllmain@c
00023 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00028 90 npad 1
; 14 : switch (ul_reason_for_call)
00029 8b 85 f8 00 00
00 mov eax, DWORD PTR ul_reason_for_call$[rbp]
0002f 89 85 c0 00 00
00 mov DWORD PTR tv64[rbp], eax
00035 83 bd c0 00 00
00 00 cmp DWORD PTR tv64[rbp], 0
0003c 74 32 je SHORT $LN7@DllMain
0003e 83 bd c0 00 00
00 01 cmp DWORD PTR tv64[rbp], 1
00045 74 14 je SHORT $LN4@DllMain
00047 83 bd c0 00 00
00 02 cmp DWORD PTR tv64[rbp], 2
0004e 74 12 je SHORT $LN5@DllMain
00050 83 bd c0 00 00
00 03 cmp DWORD PTR tv64[rbp], 3
00057 74 10 je SHORT $LN6@DllMain
00059 eb 1c jmp SHORT $LN2@DllMain
$LN4@DllMain:
; 15 : {
; 16 : case DLL_PROCESS_ATTACH:
; 17 : return 1;
0005b b8 01 00 00 00 mov eax, 1
00060 eb 1a jmp SHORT $LN1@DllMain
$LN5@DllMain:
; 18 : case DLL_THREAD_ATTACH:
; 19 : return 1;
00062 b8 01 00 00 00 mov eax, 1
00067 eb 13 jmp SHORT $LN1@DllMain
$LN6@DllMain:
; 20 : case DLL_THREAD_DETACH:
; 21 : return 1;
00069 b8 01 00 00 00 mov eax, 1
0006e eb 0c jmp SHORT $LN1@DllMain
$LN7@DllMain:
; 22 : case DLL_PROCESS_DETACH:
; 23 : return 1;
00070 b8 01 00 00 00 mov eax, 1
00075 eb 05 jmp SHORT $LN1@DllMain
$LN2@DllMain:
; 24 : break;
; 25 : }
; 26 : return TRUE;
00077 b8 01 00 00 00 mov eax, 1
$LN1@DllMain:
; 27 : }
0007c 48 8d a5 d8 00
00 00 lea rsp, QWORD PTR [rbp+216]
00083 5f pop rdi
00084 5d pop rbp
00085 c3 ret 0
DllMain ENDP
_TEXT ENDS
END
Binary file not shown.
Binary file not shown.
+531
View File
@@ -0,0 +1,531 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__B2F9F159_intrin0@inl@h DB 01H
__0833F55F_setjmp@h DB 01H
__3F5BC814_ammintrin@h DB 01H
__2E054928_intrin@h DB 01H
__5A8332CE_isa_availability@h DB 01H
__EB6C2FE1_ssc_intrinsic@h DB 01H
__F5438B76_hash@c DB 01H
msvcjmc ENDS
PUBLIC city_hash_simplify_sse
PUBLIC __JustMyCode_Default
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
; COMDAT pdata
pdata SEGMENT
$pdata$city_hash_simplify_sse DD imagerel $LN25
DD imagerel $LN25+632
DD imagerel $unwind$city_hash_simplify_sse
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$city_hash_simplify_sse DD 025051701H
DD 01122317H
DD 0700b0043H
DD 0500aH
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\hash.c
; COMDAT city_hash_simplify_sse
_TEXT SEGMENT
hash$ = 4
size$ = 36
end$ = 72
ptr$ = 104
last$1 = 136
last_128$2 = 168
last_32$3 = 200
hash64$4 = 232
vec$5 = 272
str$ = 528
length$ = 536
city_hash_simplify_sse PROC ; COMDAT
; 5 : {
$LN25:
00000 89 54 24 10 mov DWORD PTR [rsp+16], edx
00004 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
00009 55 push rbp
0000a 57 push rdi
0000b 48 81 ec 18 02
00 00 sub rsp, 536 ; 00000218H
00012 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00017 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__F5438B76_hash@c
0001e e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00023 90 npad 1
; 6 : uint32_t hash = length, size = length << 1;
00024 8b 85 18 02 00
00 mov eax, DWORD PTR length$[rbp]
0002a 89 45 04 mov DWORD PTR hash$[rbp], eax
0002d 8b 85 18 02 00
00 mov eax, DWORD PTR length$[rbp]
00033 d1 e0 shl eax, 1
00035 89 45 24 mov DWORD PTR size$[rbp], eax
; 7 : byte *end = str + size, *ptr = str;
00038 8b 45 24 mov eax, DWORD PTR size$[rbp]
0003b 48 8b 8d 10 02
00 00 mov rcx, QWORD PTR str$[rbp]
00042 48 03 c8 add rcx, rax
00045 48 8b c1 mov rax, rcx
00048 48 89 45 48 mov QWORD PTR end$[rbp], rax
0004c 48 8b 85 10 02
00 00 mov rax, QWORD PTR str$[rbp]
00053 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
; 8 :
; 9 : if (size < 4) {
00057 83 7d 24 04 cmp DWORD PTR size$[rbp], 4
0005b 73 35 jae SHORT $LN20@city_hash_
; 10 : for (; ptr < end; ptr += 2) {
0005d eb 0c jmp SHORT $LN4@city_hash_
$LN2@city_hash_:
0005f 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
00063 48 83 c0 02 add rax, 2
00067 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN4@city_hash_:
0006b 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
0006f 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
00073 73 18 jae SHORT $LN3@city_hash_
; 11 : hash = _mm_crc32_u16(hash, *ptr);
00075 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
00079 66 0f be 00 movsx ax, BYTE PTR [rax]
0007d 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
00080 66 f2 0f 38 f1
c8 crc32 ecx, ax
00086 8b c1 mov eax, ecx
00088 89 45 04 mov DWORD PTR hash$[rbp], eax
; 12 : }
0008b eb d2 jmp SHORT $LN2@city_hash_
$LN3@city_hash_:
; 13 : } else if (size < 16) {
0008d e9 95 01 00 00 jmp $LN21@city_hash_
$LN20@city_hash_:
00092 83 7d 24 10 cmp DWORD PTR size$[rbp], 16
00096 73 6e jae SHORT $LN22@city_hash_
; 14 : byte *last = end - 4;
00098 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
0009c 48 83 e8 04 sub rax, 4
000a0 48 89 85 88 00
00 00 mov QWORD PTR last$1[rbp], rax
; 15 : for (; ptr < end; ptr += 4) {
000a7 eb 0c jmp SHORT $LN7@city_hash_
$LN5@city_hash_:
000a9 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
000ad 48 83 c0 04 add rax, 4
000b1 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN7@city_hash_:
000b5 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
000b9 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
000bd 73 13 jae SHORT $LN6@city_hash_
; 16 : hash = _mm_crc32_u32(hash, *(uint32_t *)ptr);
000bf 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
000c3 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
000c6 f2 0f 38 f1 08 crc32 ecx, DWORD PTR [rax]
000cb 8b c1 mov eax, ecx
000cd 89 45 04 mov DWORD PTR hash$[rbp], eax
; 17 : }
000d0 eb d7 jmp SHORT $LN5@city_hash_
$LN6@city_hash_:
; 18 : for (; ptr < end; ptr++) {
000d2 eb 0b jmp SHORT $LN10@city_hash_
$LN8@city_hash_:
000d4 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
000d8 48 ff c0 inc rax
000db 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN10@city_hash_:
000df 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
000e3 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
000e7 73 18 jae SHORT $LN9@city_hash_
; 19 : hash = _mm_crc32_u16(hash, *ptr);
000e9 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
000ed 66 0f be 00 movsx ax, BYTE PTR [rax]
000f1 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
000f4 66 f2 0f 38 f1
c8 crc32 ecx, ax
000fa 8b c1 mov eax, ecx
000fc 89 45 04 mov DWORD PTR hash$[rbp], eax
; 20 : }
000ff eb d3 jmp SHORT $LN8@city_hash_
$LN9@city_hash_:
; 21 : } else {
00101 e9 21 01 00 00 jmp $LN23@city_hash_
$LN22@city_hash_:
; 22 : byte *last_128 = end - 16;
00106 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
0010a 48 83 e8 10 sub rax, 16
0010e 48 89 85 a8 00
00 00 mov QWORD PTR last_128$2[rbp], rax
; 23 : byte *last_32 = end - 4;
00115 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
00119 48 83 e8 04 sub rax, 4
0011d 48 89 85 c8 00
00 00 mov QWORD PTR last_32$3[rbp], rax
; 24 : uint64_t hash64 = size;
00124 8b 45 24 mov eax, DWORD PTR size$[rbp]
00127 48 89 85 e8 00
00 00 mov QWORD PTR hash64$4[rbp], rax
; 25 : for (; ptr < last_128; ptr += 16) {
0012e eb 0c jmp SHORT $LN13@city_hash_
$LN11@city_hash_:
00130 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
00134 48 83 c0 10 add rax, 16
00138 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN13@city_hash_:
0013c 48 8b 85 a8 00
00 00 mov rax, QWORD PTR last_128$2[rbp]
00143 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
00147 73 5e jae SHORT $LN12@city_hash_
; 26 : __m128i vec = _mm_loadu_si32((int *)ptr);
00149 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
0014d 66 0f 6e 00 movd xmm0, DWORD PTR [rax]
00151 66 0f 7f 85 10
01 00 00 movdqa XMMWORD PTR vec$5[rbp], xmm0
; 27 : hash64 = _mm_crc32_u64(hash64, _mm_extract_epi64(vec, 0));
00159 66 0f 6f 85 10
01 00 00 movdqa xmm0, XMMWORD PTR vec$5[rbp]
00161 66 48 0f 3a 16
c0 00 pextrq rax, xmm0, 0
00168 48 8b 8d e8 00
00 00 mov rcx, QWORD PTR hash64$4[rbp]
0016f f2 48 0f 38 f1
c8 crc32 rcx, rax
00175 48 8b c1 mov rax, rcx
00178 48 89 85 e8 00
00 00 mov QWORD PTR hash64$4[rbp], rax
; 28 : hash64 = _mm_crc32_u64(hash64, _mm_extract_epi64(vec, 1));
0017f 66 0f 6f 85 10
01 00 00 movdqa xmm0, XMMWORD PTR vec$5[rbp]
00187 66 48 0f 3a 16
c0 01 pextrq rax, xmm0, 1
0018e 48 8b 8d e8 00
00 00 mov rcx, QWORD PTR hash64$4[rbp]
00195 f2 48 0f 38 f1
c8 crc32 rcx, rax
0019b 48 8b c1 mov rax, rcx
0019e 48 89 85 e8 00
00 00 mov QWORD PTR hash64$4[rbp], rax
; 29 : }
001a5 eb 89 jmp SHORT $LN11@city_hash_
$LN12@city_hash_:
; 30 : hash = _mm_crc32_u8(hash, hash64);
001a7 8b 45 04 mov eax, DWORD PTR hash$[rbp]
001aa f2 0f 38 f0 85
e8 00 00 00 crc32 eax, BYTE PTR hash64$4[rbp]
001b3 89 45 04 mov DWORD PTR hash$[rbp], eax
; 31 : hash = _mm_crc32_u8(hash, hash64 >> 32);
001b6 48 8b 85 e8 00
00 00 mov rax, QWORD PTR hash64$4[rbp]
001bd 48 c1 e8 20 shr rax, 32 ; 00000020H
001c1 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
001c4 f2 0f 38 f0 c8 crc32 ecx, al
001c9 8b c1 mov eax, ecx
001cb 89 45 04 mov DWORD PTR hash$[rbp], eax
; 32 : for (; ptr < last_32; ptr += 4) {
001ce eb 0c jmp SHORT $LN16@city_hash_
$LN14@city_hash_:
001d0 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
001d4 48 83 c0 04 add rax, 4
001d8 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN16@city_hash_:
001dc 48 8b 85 c8 00
00 00 mov rax, QWORD PTR last_32$3[rbp]
001e3 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
001e7 73 13 jae SHORT $LN15@city_hash_
; 33 : hash = _mm_crc32_u32(hash,*(uint32_t *)ptr);
001e9 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
001ed 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
001f0 f2 0f 38 f1 08 crc32 ecx, DWORD PTR [rax]
001f5 8b c1 mov eax, ecx
001f7 89 45 04 mov DWORD PTR hash$[rbp], eax
; 34 : }
001fa eb d4 jmp SHORT $LN14@city_hash_
$LN15@city_hash_:
; 35 : for (; ptr < end; ptr += 2) {
001fc eb 0c jmp SHORT $LN19@city_hash_
$LN17@city_hash_:
001fe 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
00202 48 83 c0 02 add rax, 2
00206 48 89 45 68 mov QWORD PTR ptr$[rbp], rax
$LN19@city_hash_:
0020a 48 8b 45 48 mov rax, QWORD PTR end$[rbp]
0020e 48 39 45 68 cmp QWORD PTR ptr$[rbp], rax
00212 73 13 jae SHORT $LN18@city_hash_
; 36 : hash = _mm_crc32_u8(hash,*ptr);
00214 48 8b 45 68 mov rax, QWORD PTR ptr$[rbp]
00218 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
0021b f2 0f 38 f0 08 crc32 ecx, BYTE PTR [rax]
00220 8b c1 mov eax, ecx
00222 89 45 04 mov DWORD PTR hash$[rbp], eax
; 37 : }
00225 eb d7 jmp SHORT $LN17@city_hash_
$LN18@city_hash_:
$LN23@city_hash_:
$LN21@city_hash_:
; 38 : }
; 39 : hash ^= hash >> 16;
00227 8b 45 04 mov eax, DWORD PTR hash$[rbp]
0022a c1 e8 10 shr eax, 16
0022d 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
00230 33 c8 xor ecx, eax
00232 8b c1 mov eax, ecx
00234 89 45 04 mov DWORD PTR hash$[rbp], eax
; 40 : hash *= 0x85ebca6b;
00237 69 45 04 6b ca
eb 85 imul eax, DWORD PTR hash$[rbp], -2048144789 ; 85ebca6bH
0023e 89 45 04 mov DWORD PTR hash$[rbp], eax
; 41 : hash ^= hash >> 13;
00241 8b 45 04 mov eax, DWORD PTR hash$[rbp]
00244 c1 e8 0d shr eax, 13
00247 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
0024a 33 c8 xor ecx, eax
0024c 8b c1 mov eax, ecx
0024e 89 45 04 mov DWORD PTR hash$[rbp], eax
; 42 : hash *= 0xc2b2ae35;
00251 69 45 04 35 ae
b2 c2 imul eax, DWORD PTR hash$[rbp], -1028477387 ; c2b2ae35H
00258 89 45 04 mov DWORD PTR hash$[rbp], eax
; 43 : hash ^= hash >> 16;
0025b 8b 45 04 mov eax, DWORD PTR hash$[rbp]
0025e c1 e8 10 shr eax, 16
00261 8b 4d 04 mov ecx, DWORD PTR hash$[rbp]
00264 33 c8 xor ecx, eax
00266 8b c1 mov eax, ecx
00268 89 45 04 mov DWORD PTR hash$[rbp], eax
; 44 : return hash;
0026b 8b 45 04 mov eax, DWORD PTR hash$[rbp]
; 45 : }
0026e 48 8d a5 f8 01
00 00 lea rsp, QWORD PTR [rbp+504]
00275 5f pop rdi
00276 5d pop rbp
00277 c3 ret 0
city_hash_simplify_sse ENDP
_TEXT ENDS
END
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+839
View File
@@ -0,0 +1,839 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__B2F9F159_intrin0@inl@h DB 01H
__0833F55F_setjmp@h DB 01H
__3F5BC814_ammintrin@h DB 01H
__2E054928_intrin@h DB 01H
__5A8332CE_isa_availability@h DB 01H
__EB6C2FE1_ssc_intrinsic@h DB 01H
__5972891A_mat2@c DB 01H
msvcjmc ENDS
PUBLIC addmatrix2_sse
PUBLIC addmatrix2_avx
PUBLIC submatrix2_sse
PUBLIC transpose23
PUBLIC transpose24
PUBLIC submatrix2_avx
PUBLIC __JustMyCode_Default
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
; COMDAT pdata
pdata SEGMENT
$pdata$addmatrix2_sse DD imagerel $LN3
DD imagerel $LN3+254
DD imagerel $unwind$addmatrix2_sse
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$addmatrix2_avx DD imagerel $LN3
DD imagerel $LN3+169
DD imagerel $unwind$addmatrix2_avx
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$submatrix2_sse DD imagerel $LN3
DD imagerel $LN3+254
DD imagerel $unwind$submatrix2_sse
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$transpose23 DD imagerel $LN3
DD imagerel $LN3+271
DD imagerel $unwind$transpose23
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$transpose24 DD imagerel $LN3
DD imagerel $LN3+305
DD imagerel $unwind$transpose24
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$submatrix2_avx DD imagerel $LN3
DD imagerel $LN3+169
DD imagerel $unwind$submatrix2_avx
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$submatrix2_avx DD 02d062801H
DD 011a231fH
DD 07013002aH
DD 0d0115012H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$transpose24 DD 025051801H
DD 01132318H
DD 0700c0029H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$transpose23 DD 025051801H
DD 01132318H
DD 0700c0029H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$submatrix2_sse DD 025051d01H
DD 0118231dH
DD 070110029H
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$addmatrix2_avx DD 02d062801H
DD 011a231fH
DD 07013002aH
DD 0d0115012H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$addmatrix2_sse DD 025051d01H
DD 0118231dH
DD 070110029H
DD 05010H
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT submatrix2_avx
_TEXT SEGMENT
temp$ = 32
left$ = 336
right$ = 344
ans$ = 352
submatrix2_avx PROC ; COMDAT
; 54 : {
$LN3:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000f 41 55 push r13
00011 55 push rbp
00012 57 push rdi
00013 48 81 ec 50 01
00 00 sub rsp, 336 ; 00000150H
0001a 4c 8d 6c 24 20 lea r13, QWORD PTR [rsp+32]
0001f 48 8d 6c 24 40 lea rbp, QWORD PTR [rsp+64]
00024 48 83 e5 e0 and rbp, -32 ; ffffffffffffffe0H
00028 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
0002f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00034 90 npad 1
; 55 : __m256 temp = _mm256_sub_ps(ALIGN256(left->column[0]), ALIGN256(right->column[0]));
00035 b8 10 00 00 00 mov eax, 16
0003a 48 6b c0 00 imul rax, rax, 0
0003e 49 8b 8d 58 01
00 00 mov rcx, QWORD PTR right$[r13]
00045 48 03 c8 add rcx, rax
00048 48 8b c1 mov rax, rcx
0004b c5 fc 10 00 vmovups ymm0, YMMWORD PTR [rax]
0004f b8 10 00 00 00 mov eax, 16
00054 48 6b c0 00 imul rax, rax, 0
00058 49 8b 8d 50 01
00 00 mov rcx, QWORD PTR left$[r13]
0005f 48 03 c8 add rcx, rax
00062 48 8b c1 mov rax, rcx
00065 c5 fc 10 08 vmovups ymm1, YMMWORD PTR [rax]
00069 c5 f4 5c c0 vsubps ymm0, ymm1, ymm0
0006d c5 fc 11 45 20 vmovups YMMWORD PTR temp$[rbp], ymm0
; 56 : _mm256_storeu_ps(&ans->m[0][0], temp);
00072 b8 08 00 00 00 mov eax, 8
00077 48 6b c0 00 imul rax, rax, 0
0007b 49 8b 8d 60 01
00 00 mov rcx, QWORD PTR ans$[r13]
00082 48 03 c8 add rcx, rax
00085 48 8b c1 mov rax, rcx
00088 b9 04 00 00 00 mov ecx, 4
0008d 48 6b c9 00 imul rcx, rcx, 0
00091 48 03 c1 add rax, rcx
00094 c5 fc 10 45 20 vmovups ymm0, YMMWORD PTR temp$[rbp]
00099 c5 fc 11 00 vmovups YMMWORD PTR [rax], ymm0
; 57 : }
0009d 49 8d a5 30 01
00 00 lea rsp, QWORD PTR [r13+304]
000a4 5f pop rdi
000a5 5d pop rbp
000a6 41 5d pop r13
000a8 c3 ret 0
submatrix2_avx ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT transpose24
_TEXT SEGMENT
t0$ = 16
t1$ = 64
source$ = 320
target$ = 328
transpose24 PROC ; COMDAT
; 17 : {
$LN3:
00000 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
00005 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000a 55 push rbp
0000b 57 push rdi
0000c 48 81 ec 48 01
00 00 sub rsp, 328 ; 00000148H
00013 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00018 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
0001f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00024 90 npad 1
; 18 : __m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
00025 b8 10 00 00 00 mov eax, 16
0002a 48 6b c0 01 imul rax, rax, 1
0002e 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
00035 48 03 c8 add rcx, rax
00038 48 8b c1 mov rax, rcx
0003b 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0003e b8 10 00 00 00 mov eax, 16
00043 48 6b c0 00 imul rax, rax, 0
00047 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
0004e 48 03 c8 add rcx, rax
00051 48 8b c1 mov rax, rcx
00054 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00057 0f c6 c8 44 shufps xmm1, xmm0, 68 ; 00000044H
0005b 0f 28 c1 movaps xmm0, xmm1
0005e 0f 29 45 10 movaps XMMWORD PTR t0$[rbp], xmm0
; 19 : _MM_SHUFFLE(1, 0, 1, 0));
; 20 : __m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
00062 b8 10 00 00 00 mov eax, 16
00067 48 6b c0 01 imul rax, rax, 1
0006b 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
00072 48 03 c8 add rcx, rax
00075 48 8b c1 mov rax, rcx
00078 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0007b b8 10 00 00 00 mov eax, 16
00080 48 6b c0 00 imul rax, rax, 0
00084 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
0008b 48 03 c8 add rcx, rax
0008e 48 8b c1 mov rax, rcx
00091 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00094 0f c6 c8 ee shufps xmm1, xmm0, 238 ; 000000eeH
00098 0f 28 c1 movaps xmm0, xmm1
0009b 0f 29 45 40 movaps XMMWORD PTR t1$[rbp], xmm0
; 21 : _MM_SHUFFLE(3, 2, 3, 2));
; 22 :
; 23 : target->column[0] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
0009f 0f 57 c0 xorps xmm0, xmm0
000a2 0f 28 4d 10 movaps xmm1, XMMWORD PTR t0$[rbp]
000a6 0f c6 c8 88 shufps xmm1, xmm0, 136 ; 00000088H
000aa 0f 28 c1 movaps xmm0, xmm1
000ad b8 10 00 00 00 mov eax, 16
000b2 48 6b c0 00 imul rax, rax, 0
000b6 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
000bd 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 24 : target->column[1] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
000c1 0f 57 c0 xorps xmm0, xmm0
000c4 0f 28 4d 10 movaps xmm1, XMMWORD PTR t0$[rbp]
000c8 0f c6 c8 dd shufps xmm1, xmm0, 221 ; 000000ddH
000cc 0f 28 c1 movaps xmm0, xmm1
000cf b8 10 00 00 00 mov eax, 16
000d4 48 6b c0 01 imul rax, rax, 1
000d8 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
000df 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 25 : target->column[2] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
000e3 0f 57 c0 xorps xmm0, xmm0
000e6 0f 28 4d 40 movaps xmm1, XMMWORD PTR t1$[rbp]
000ea 0f c6 c8 88 shufps xmm1, xmm0, 136 ; 00000088H
000ee 0f 28 c1 movaps xmm0, xmm1
000f1 b8 10 00 00 00 mov eax, 16
000f6 48 6b c0 02 imul rax, rax, 2
000fa 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
00101 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 26 : target->column[3] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
00105 0f 57 c0 xorps xmm0, xmm0
00108 0f 28 4d 40 movaps xmm1, XMMWORD PTR t1$[rbp]
0010c 0f c6 c8 dd shufps xmm1, xmm0, 221 ; 000000ddH
00110 0f 28 c1 movaps xmm0, xmm1
00113 b8 10 00 00 00 mov eax, 16
00118 48 6b c0 03 imul rax, rax, 3
0011c 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
00123 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 27 : }
00127 48 8d a5 28 01
00 00 lea rsp, QWORD PTR [rbp+296]
0012e 5f pop rdi
0012f 5d pop rbp
00130 c3 ret 0
transpose24 ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT transpose23
_TEXT SEGMENT
t0$ = 16
t1$ = 64
source$ = 320
target$ = 328
transpose23 PROC ; COMDAT
; 5 : {
$LN3:
00000 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
00005 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000a 55 push rbp
0000b 57 push rdi
0000c 48 81 ec 48 01
00 00 sub rsp, 328 ; 00000148H
00013 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00018 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
0001f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00024 90 npad 1
; 6 : __m128 t0 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
00025 b8 10 00 00 00 mov eax, 16
0002a 48 6b c0 01 imul rax, rax, 1
0002e 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
00035 48 03 c8 add rcx, rax
00038 48 8b c1 mov rax, rcx
0003b 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0003e b8 10 00 00 00 mov eax, 16
00043 48 6b c0 00 imul rax, rax, 0
00047 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
0004e 48 03 c8 add rcx, rax
00051 48 8b c1 mov rax, rcx
00054 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00057 0f c6 c8 44 shufps xmm1, xmm0, 68 ; 00000044H
0005b 0f 28 c1 movaps xmm0, xmm1
0005e 0f 29 45 10 movaps XMMWORD PTR t0$[rbp], xmm0
; 7 : _MM_SHUFFLE(1, 0, 1, 0));
; 8 : __m128 t1 = _mm_shuffle_ps(ALIGN(source->column[0]), ALIGN(source->column[1]),
00062 b8 10 00 00 00 mov eax, 16
00067 48 6b c0 01 imul rax, rax, 1
0006b 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
00072 48 03 c8 add rcx, rax
00075 48 8b c1 mov rax, rcx
00078 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0007b b8 10 00 00 00 mov eax, 16
00080 48 6b c0 00 imul rax, rax, 0
00084 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR source$[rbp]
0008b 48 03 c8 add rcx, rax
0008e 48 8b c1 mov rax, rcx
00091 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00094 0f c6 c8 ee shufps xmm1, xmm0, 238 ; 000000eeH
00098 0f 28 c1 movaps xmm0, xmm1
0009b 0f 29 45 40 movaps XMMWORD PTR t1$[rbp], xmm0
; 9 : _MM_SHUFFLE(3, 2, 3, 2));
; 10 :
; 11 : target->column[0] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
0009f 0f 57 c0 xorps xmm0, xmm0
000a2 0f 28 4d 10 movaps xmm1, XMMWORD PTR t0$[rbp]
000a6 0f c6 c8 88 shufps xmm1, xmm0, 136 ; 00000088H
000aa 0f 28 c1 movaps xmm0, xmm1
000ad b8 10 00 00 00 mov eax, 16
000b2 48 6b c0 00 imul rax, rax, 0
000b6 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
000bd 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 12 : target->column[1] = _mm_shuffle_ps(t0, zero_vec, _MM_SHUFFLE(3, 1, 3, 1));
000c1 0f 57 c0 xorps xmm0, xmm0
000c4 0f 28 4d 10 movaps xmm1, XMMWORD PTR t0$[rbp]
000c8 0f c6 c8 dd shufps xmm1, xmm0, 221 ; 000000ddH
000cc 0f 28 c1 movaps xmm0, xmm1
000cf b8 10 00 00 00 mov eax, 16
000d4 48 6b c0 01 imul rax, rax, 1
000d8 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
000df 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 13 : target->column[2] = _mm_shuffle_ps(t1, zero_vec, _MM_SHUFFLE(2, 0, 2, 0));
000e3 0f 57 c0 xorps xmm0, xmm0
000e6 0f 28 4d 40 movaps xmm1, XMMWORD PTR t1$[rbp]
000ea 0f c6 c8 88 shufps xmm1, xmm0, 136 ; 00000088H
000ee 0f 28 c1 movaps xmm0, xmm1
000f1 b8 10 00 00 00 mov eax, 16
000f6 48 6b c0 02 imul rax, rax, 2
000fa 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR target$[rbp]
00101 0f 11 04 01 movups XMMWORD PTR [rcx+rax], xmm0
; 14 : }
00105 48 8d a5 28 01
00 00 lea rsp, QWORD PTR [rbp+296]
0010c 5f pop rdi
0010d 5d pop rbp
0010e c3 ret 0
transpose23 ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT submatrix2_sse
_TEXT SEGMENT
temp0$ = 16
temp1$ = 64
left$ = 320
right$ = 328
ans$ = 336
submatrix2_sse PROC ; COMDAT
; 45 : {
$LN3:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000f 55 push rbp
00010 57 push rdi
00011 48 81 ec 48 01
00 00 sub rsp, 328 ; 00000148H
00018 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
0001d 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00029 90 npad 1
; 46 : __m128 temp0 = _mm_sub_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
0002a b8 10 00 00 00 mov eax, 16
0002f 48 6b c0 00 imul rax, rax, 0
00033 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR right$[rbp]
0003a 48 03 c8 add rcx, rax
0003d 48 8b c1 mov rax, rcx
00040 0f 10 00 movups xmm0, XMMWORD PTR [rax]
00043 b8 10 00 00 00 mov eax, 16
00048 48 6b c0 00 imul rax, rax, 0
0004c 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR left$[rbp]
00053 48 03 c8 add rcx, rax
00056 48 8b c1 mov rax, rcx
00059 0f 10 08 movups xmm1, XMMWORD PTR [rax]
0005c 0f 5c c8 subps xmm1, xmm0
0005f 0f 28 c1 movaps xmm0, xmm1
00062 0f 29 45 10 movaps XMMWORD PTR temp0$[rbp], xmm0
; 47 : __m128 temp1 = _mm_sub_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
00066 b8 10 00 00 00 mov eax, 16
0006b 48 6b c0 01 imul rax, rax, 1
0006f 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR right$[rbp]
00076 48 03 c8 add rcx, rax
00079 48 8b c1 mov rax, rcx
0007c 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0007f b8 10 00 00 00 mov eax, 16
00084 48 6b c0 01 imul rax, rax, 1
00088 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR left$[rbp]
0008f 48 03 c8 add rcx, rax
00092 48 8b c1 mov rax, rcx
00095 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00098 0f 5c c8 subps xmm1, xmm0
0009b 0f 28 c1 movaps xmm0, xmm1
0009e 0f 29 45 40 movaps XMMWORD PTR temp1$[rbp], xmm0
; 48 :
; 49 : _mm_storeu_ps(&ans->m[0][0], temp0);
000a2 b8 08 00 00 00 mov eax, 8
000a7 48 6b c0 00 imul rax, rax, 0
000ab 48 8b 8d 50 01
00 00 mov rcx, QWORD PTR ans$[rbp]
000b2 48 03 c8 add rcx, rax
000b5 48 8b c1 mov rax, rcx
000b8 b9 04 00 00 00 mov ecx, 4
000bd 48 6b c9 00 imul rcx, rcx, 0
000c1 48 03 c1 add rax, rcx
000c4 0f 28 45 10 movaps xmm0, XMMWORD PTR temp0$[rbp]
000c8 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 50 : _mm_storeu_ps(&ans->m[0][1], temp1);
000cb b8 08 00 00 00 mov eax, 8
000d0 48 6b c0 00 imul rax, rax, 0
000d4 48 8b 8d 50 01
00 00 mov rcx, QWORD PTR ans$[rbp]
000db 48 03 c8 add rcx, rax
000de 48 8b c1 mov rax, rcx
000e1 b9 04 00 00 00 mov ecx, 4
000e6 48 6b c9 01 imul rcx, rcx, 1
000ea 48 03 c1 add rax, rcx
000ed 0f 28 45 40 movaps xmm0, XMMWORD PTR temp1$[rbp]
000f1 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 51 : }
000f4 48 8d a5 28 01
00 00 lea rsp, QWORD PTR [rbp+296]
000fb 5f pop rdi
000fc 5d pop rbp
000fd c3 ret 0
submatrix2_sse ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT addmatrix2_avx
_TEXT SEGMENT
temp$ = 32
left$ = 336
right$ = 344
ans$ = 352
addmatrix2_avx PROC ; COMDAT
; 39 : {
$LN3:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000f 41 55 push r13
00011 55 push rbp
00012 57 push rdi
00013 48 81 ec 50 01
00 00 sub rsp, 336 ; 00000150H
0001a 4c 8d 6c 24 20 lea r13, QWORD PTR [rsp+32]
0001f 48 8d 6c 24 40 lea rbp, QWORD PTR [rsp+64]
00024 48 83 e5 e0 and rbp, -32 ; ffffffffffffffe0H
00028 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
0002f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00034 90 npad 1
; 40 : __m256 temp = _mm256_add_ps(ALIGN256(left->column[0]), ALIGN256(right->column[0]));
00035 b8 10 00 00 00 mov eax, 16
0003a 48 6b c0 00 imul rax, rax, 0
0003e 49 8b 8d 58 01
00 00 mov rcx, QWORD PTR right$[r13]
00045 48 03 c8 add rcx, rax
00048 48 8b c1 mov rax, rcx
0004b c5 fc 10 00 vmovups ymm0, YMMWORD PTR [rax]
0004f b8 10 00 00 00 mov eax, 16
00054 48 6b c0 00 imul rax, rax, 0
00058 49 8b 8d 50 01
00 00 mov rcx, QWORD PTR left$[r13]
0005f 48 03 c8 add rcx, rax
00062 48 8b c1 mov rax, rcx
00065 c5 fc 10 08 vmovups ymm1, YMMWORD PTR [rax]
00069 c5 f4 58 c0 vaddps ymm0, ymm1, ymm0
0006d c5 fc 11 45 20 vmovups YMMWORD PTR temp$[rbp], ymm0
; 41 : _mm256_storeu_ps(&ans->m[0][0], temp);
00072 b8 08 00 00 00 mov eax, 8
00077 48 6b c0 00 imul rax, rax, 0
0007b 49 8b 8d 60 01
00 00 mov rcx, QWORD PTR ans$[r13]
00082 48 03 c8 add rcx, rax
00085 48 8b c1 mov rax, rcx
00088 b9 04 00 00 00 mov ecx, 4
0008d 48 6b c9 00 imul rcx, rcx, 0
00091 48 03 c1 add rax, rcx
00094 c5 fc 10 45 20 vmovups ymm0, YMMWORD PTR temp$[rbp]
00099 c5 fc 11 00 vmovups YMMWORD PTR [rax], ymm0
; 42 : }
0009d 49 8d a5 30 01
00 00 lea rsp, QWORD PTR [r13+304]
000a4 5f pop rdi
000a5 5d pop rbp
000a6 41 5d pop r13
000a8 c3 ret 0
addmatrix2_avx ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\mat2.c
; COMDAT addmatrix2_sse
_TEXT SEGMENT
temp0$ = 16
temp1$ = 64
left$ = 320
right$ = 328
ans$ = 336
addmatrix2_sse PROC ; COMDAT
; 30 : {
$LN3:
00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8
00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000f 55 push rbp
00010 57 push rdi
00011 48 81 ec 48 01
00 00 sub rsp, 328 ; 00000148H
00018 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
0001d 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__5972891A_mat2@c
00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00029 90 npad 1
; 31 : __m128 temp0 = _mm_add_ps(ALIGN(left->column[0]), ALIGN(right->column[0]));
0002a b8 10 00 00 00 mov eax, 16
0002f 48 6b c0 00 imul rax, rax, 0
00033 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR right$[rbp]
0003a 48 03 c8 add rcx, rax
0003d 48 8b c1 mov rax, rcx
00040 0f 10 00 movups xmm0, XMMWORD PTR [rax]
00043 b8 10 00 00 00 mov eax, 16
00048 48 6b c0 00 imul rax, rax, 0
0004c 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR left$[rbp]
00053 48 03 c8 add rcx, rax
00056 48 8b c1 mov rax, rcx
00059 0f 10 08 movups xmm1, XMMWORD PTR [rax]
0005c 0f 58 c8 addps xmm1, xmm0
0005f 0f 28 c1 movaps xmm0, xmm1
00062 0f 29 45 10 movaps XMMWORD PTR temp0$[rbp], xmm0
; 32 : __m128 temp1 = _mm_add_ps(ALIGN(left->column[1]), ALIGN(right->column[1]));
00066 b8 10 00 00 00 mov eax, 16
0006b 48 6b c0 01 imul rax, rax, 1
0006f 48 8b 8d 48 01
00 00 mov rcx, QWORD PTR right$[rbp]
00076 48 03 c8 add rcx, rax
00079 48 8b c1 mov rax, rcx
0007c 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0007f b8 10 00 00 00 mov eax, 16
00084 48 6b c0 01 imul rax, rax, 1
00088 48 8b 8d 40 01
00 00 mov rcx, QWORD PTR left$[rbp]
0008f 48 03 c8 add rcx, rax
00092 48 8b c1 mov rax, rcx
00095 0f 10 08 movups xmm1, XMMWORD PTR [rax]
00098 0f 58 c8 addps xmm1, xmm0
0009b 0f 28 c1 movaps xmm0, xmm1
0009e 0f 29 45 40 movaps XMMWORD PTR temp1$[rbp], xmm0
; 33 :
; 34 : _mm_storeu_ps(&ans->m[0][0], temp0);
000a2 b8 08 00 00 00 mov eax, 8
000a7 48 6b c0 00 imul rax, rax, 0
000ab 48 8b 8d 50 01
00 00 mov rcx, QWORD PTR ans$[rbp]
000b2 48 03 c8 add rcx, rax
000b5 48 8b c1 mov rax, rcx
000b8 b9 04 00 00 00 mov ecx, 4
000bd 48 6b c9 00 imul rcx, rcx, 0
000c1 48 03 c1 add rax, rcx
000c4 0f 28 45 10 movaps xmm0, XMMWORD PTR temp0$[rbp]
000c8 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 35 : _mm_storeu_ps(&ans->m[0][1], temp1);
000cb b8 08 00 00 00 mov eax, 8
000d0 48 6b c0 00 imul rax, rax, 0
000d4 48 8b 8d 50 01
00 00 mov rcx, QWORD PTR ans$[rbp]
000db 48 03 c8 add rcx, rax
000de 48 8b c1 mov rax, rcx
000e1 b9 04 00 00 00 mov ecx, 4
000e6 48 6b c9 01 imul rcx, rcx, 1
000ea 48 03 c1 add rax, rcx
000ed 0f 28 45 40 movaps xmm0, XMMWORD PTR temp1$[rbp]
000f1 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 36 : }
000f4 48 8d a5 28 01
00 00 lea rsp, QWORD PTR [rbp+296]
000fb 5f pop rdi
000fc 5d pop rbp
000fd c3 ret 0
addmatrix2_sse ENDP
_TEXT ENDS
END
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+570
View File
@@ -0,0 +1,570 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__B2F9F159_intrin0@inl@h DB 01H
__0833F55F_setjmp@h DB 01H
__3F5BC814_ammintrin@h DB 01H
__2E054928_intrin@h DB 01H
__5A8332CE_isa_availability@h DB 01H
__EB6C2FE1_ssc_intrinsic@h DB 01H
__A2A5DCB5_string@c DB 01H
msvcjmc ENDS
PUBLIC index_pair_sse
PUBLIC __JustMyCode_Default
EXTRN _RTC_CheckStackVars:PROC
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __security_check_cookie:PROC
EXTRN __security_cookie:QWORD
; COMDAT pdata
pdata SEGMENT
$pdata$index_pair_sse DD imagerel $LN23
DD imagerel $LN23+681
DD imagerel $unwind$index_pair_sse
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT voltbl
voltbl SEGMENT
_volmd DW 03fH
DW 0290H
voltbl ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$index_pair_sse DD 025054619H
DD 0117231cH
DD 070100047H
DD 0500fH
DD imagerel __GSHandlerCheck
DD 0228H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
index_pair_sse$rtcName$0 DB 073H
DB 00H
ORG $+14
index_pair_sse$rtcVarDesc DD 0b0H
DD 010H
DQ FLAT:index_pair_sse$rtcName$0
ORG $+48
index_pair_sse$rtcFrameData DD 01H
DD 00H
DQ FLAT:index_pair_sse$rtcVarDesc
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\string.c
; COMDAT index_pair_sse
_TEXT SEGMENT
index$ = 4
result$ = 36
size$ = 68
end$ = 100
s$ = 144
vec$ = 192
com$ = 240
i$4 = 280
i$5 = 312
tv152 = 516
__$ArrayPad$ = 520
str$ = 560
target$ = 568
length$ = 576
index_pair_sse PROC ; COMDAT
; 4 : {
$LN23:
00000 44 89 44 24 18 mov DWORD PTR [rsp+24], r8d
00005 89 54 24 10 mov DWORD PTR [rsp+16], edx
00009 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000e 55 push rbp
0000f 57 push rdi
00010 48 81 ec 38 02
00 00 sub rsp, 568 ; 00000238H
00017 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
0001c 48 8d 7c 24 20 lea rdi, QWORD PTR [rsp+32]
00021 b9 56 00 00 00 mov ecx, 86 ; 00000056H
00026 b8 cc cc cc cc mov eax, -858993460 ; ccccccccH
0002b f3 ab rep stosd
0002d 48 8b 8c 24 58
02 00 00 mov rcx, QWORD PTR [rsp+600]
00035 48 8b 05 00 00
00 00 mov rax, QWORD PTR __security_cookie
0003c 48 33 c5 xor rax, rbp
0003f 48 89 85 08 02
00 00 mov QWORD PTR __$ArrayPad$[rbp], rax
00046 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__A2A5DCB5_string@c
0004d e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00052 90 npad 1
; 5 : int index = 0, result = 0, size = length, end = size - 8;
00053 c7 45 04 00 00
00 00 mov DWORD PTR index$[rbp], 0
0005a c7 45 24 00 00
00 00 mov DWORD PTR result$[rbp], 0
00061 8b 85 40 02 00
00 mov eax, DWORD PTR length$[rbp]
00067 89 45 44 mov DWORD PTR size$[rbp], eax
0006a 8b 45 44 mov eax, DWORD PTR size$[rbp]
0006d 83 e8 08 sub eax, 8
00070 89 45 64 mov DWORD PTR end$[rbp], eax
; 6 : __m128i s = {
00073 0f b6 85 38 02
00 00 movzx eax, BYTE PTR target$[rbp]
0007a 88 85 90 00 00
00 mov BYTE PTR s$[rbp], al
00080 0f b6 85 38 02
00 00 movzx eax, BYTE PTR target$[rbp]
00087 88 85 91 00 00
00 mov BYTE PTR s$[rbp+1], al
0008d 0f b6 85 38 02
00 00 movzx eax, BYTE PTR target$[rbp]
00094 88 85 92 00 00
00 mov BYTE PTR s$[rbp+2], al
0009a 0f b6 85 38 02
00 00 movzx eax, BYTE PTR target$[rbp]
000a1 88 85 93 00 00
00 mov BYTE PTR s$[rbp+3], al
000a7 48 8d 85 94 00
00 00 lea rax, QWORD PTR s$[rbp+4]
000ae 48 8b f8 mov rdi, rax
000b1 33 c0 xor eax, eax
000b3 b9 0c 00 00 00 mov ecx, 12
000b8 f3 aa rep stosb
$LN2@index_pair:
; 7 : target,
; 8 : target,
; 9 : target,
; 10 : target,
; 11 : };
; 12 : __m128i vec, com;
; 13 :
; 14 : while (index < end) {
000ba 8b 45 64 mov eax, DWORD PTR end$[rbp]
000bd 39 45 04 cmp DWORD PTR index$[rbp], eax
000c0 0f 8d 52 01 00
00 jge $LN3@index_pair
; 15 : vec = _mm_loadu_epi32(str + index);
000c6 48 63 45 04 movsxd rax, DWORD PTR index$[rbp]
000ca 48 8b 8d 30 02
00 00 mov rcx, QWORD PTR str$[rbp]
000d1 48 8d 04 41 lea rax, QWORD PTR [rcx+rax*2]
000d5 c5 fa 6f 00 vmovdqu xmm0, XMMWORD PTR [rax]
000d9 66 0f 7f 85 c0
00 00 00 movdqa XMMWORD PTR vec$[rbp], xmm0
; 16 : com = _mm_cmpeq_epi16(vec, s);
000e1 66 0f 6f 85 c0
00 00 00 movdqa xmm0, XMMWORD PTR vec$[rbp]
000e9 66 0f 75 85 90
00 00 00 pcmpeqw xmm0, XMMWORD PTR s$[rbp]
000f1 66 0f 7f 85 f0
00 00 00 movdqa XMMWORD PTR com$[rbp], xmm0
; 17 : result = _mm_movemask_epi8(com);
000f9 66 0f 6f 85 f0
00 00 00 movdqa xmm0, XMMWORD PTR com$[rbp]
00101 66 0f d7 c0 pmovmskb eax, xmm0
00105 89 45 24 mov DWORD PTR result$[rbp], eax
; 18 : if (result) {
00108 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
0010c 74 56 je SHORT $LN13@index_pair
; 19 : for (size_t i = 0; i < 7; i++) {
0010e 48 c7 85 18 01
00 00 00 00 00
00 mov QWORD PTR i$4[rbp], 0
00119 eb 11 jmp SHORT $LN6@index_pair
$LN4@index_pair:
0011b 48 8b 85 18 01
00 00 mov rax, QWORD PTR i$4[rbp]
00122 48 ff c0 inc rax
00125 48 89 85 18 01
00 00 mov QWORD PTR i$4[rbp], rax
$LN6@index_pair:
0012c 48 83 bd 18 01
00 00 07 cmp QWORD PTR i$4[rbp], 7
00134 73 2e jae SHORT $LN5@index_pair
; 20 : if (((result & 0xF) == 0xF)) {
00136 8b 45 24 mov eax, DWORD PTR result$[rbp]
00139 83 e0 0f and eax, 15
0013c 83 f8 0f cmp eax, 15
0013f 75 10 jne SHORT $LN14@index_pair
; 21 : return index + i;
00141 48 63 45 04 movsxd rax, DWORD PTR index$[rbp]
00145 48 03 85 18 01
00 00 add rax, QWORD PTR i$4[rbp]
0014c e9 29 01 00 00 jmp $LN1@index_pair
$LN14@index_pair:
; 22 : }
; 23 : if (result == 0) {
00151 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
00155 75 02 jne SHORT $LN15@index_pair
; 24 : break;
00157 eb 0b jmp SHORT $LN5@index_pair
$LN15@index_pair:
; 25 : }
; 26 : result >>= 2;
00159 8b 45 24 mov eax, DWORD PTR result$[rbp]
0015c c1 f8 02 sar eax, 2
0015f 89 45 24 mov DWORD PTR result$[rbp], eax
; 27 : }
00162 eb b7 jmp SHORT $LN4@index_pair
$LN5@index_pair:
$LN13@index_pair:
; 28 : }
; 29 : index += 1;
00164 8b 45 04 mov eax, DWORD PTR index$[rbp]
00167 ff c0 inc eax
00169 89 45 04 mov DWORD PTR index$[rbp], eax
; 30 : vec = _mm_loadu_epi32(str + index);
0016c 48 63 45 04 movsxd rax, DWORD PTR index$[rbp]
00170 48 8b 8d 30 02
00 00 mov rcx, QWORD PTR str$[rbp]
00177 48 8d 04 41 lea rax, QWORD PTR [rcx+rax*2]
0017b c5 fa 6f 00 vmovdqu xmm0, XMMWORD PTR [rax]
0017f 66 0f 7f 85 c0
00 00 00 movdqa XMMWORD PTR vec$[rbp], xmm0
; 31 : com = _mm_cmpeq_epi16(vec, s);
00187 66 0f 6f 85 c0
00 00 00 movdqa xmm0, XMMWORD PTR vec$[rbp]
0018f 66 0f 75 85 90
00 00 00 pcmpeqw xmm0, XMMWORD PTR s$[rbp]
00197 66 0f 7f 85 f0
00 00 00 movdqa XMMWORD PTR com$[rbp], xmm0
; 32 : result = _mm_movemask_epi8(com);
0019f 66 0f 6f 85 f0
00 00 00 movdqa xmm0, XMMWORD PTR com$[rbp]
001a7 66 0f d7 c0 pmovmskb eax, xmm0
001ab 89 45 24 mov DWORD PTR result$[rbp], eax
; 33 : if (result) {
001ae 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
001b2 74 56 je SHORT $LN16@index_pair
; 34 : for (size_t i = 0; i < 7; i++) {
001b4 48 c7 85 38 01
00 00 00 00 00
00 mov QWORD PTR i$5[rbp], 0
001bf eb 11 jmp SHORT $LN9@index_pair
$LN7@index_pair:
001c1 48 8b 85 38 01
00 00 mov rax, QWORD PTR i$5[rbp]
001c8 48 ff c0 inc rax
001cb 48 89 85 38 01
00 00 mov QWORD PTR i$5[rbp], rax
$LN9@index_pair:
001d2 48 83 bd 38 01
00 00 07 cmp QWORD PTR i$5[rbp], 7
001da 73 2e jae SHORT $LN8@index_pair
; 35 : if (((result & 0xF) == 0xF)) {
001dc 8b 45 24 mov eax, DWORD PTR result$[rbp]
001df 83 e0 0f and eax, 15
001e2 83 f8 0f cmp eax, 15
001e5 75 10 jne SHORT $LN17@index_pair
; 36 : return index + i;
001e7 48 63 45 04 movsxd rax, DWORD PTR index$[rbp]
001eb 48 03 85 38 01
00 00 add rax, QWORD PTR i$5[rbp]
001f2 e9 83 00 00 00 jmp $LN1@index_pair
$LN17@index_pair:
; 37 : }
; 38 : if (result == 0) {
001f7 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
001fb 75 02 jne SHORT $LN18@index_pair
; 39 : break;
001fd eb 0b jmp SHORT $LN8@index_pair
$LN18@index_pair:
; 40 : }
; 41 : result >>= 2;
001ff 8b 45 24 mov eax, DWORD PTR result$[rbp]
00202 c1 f8 02 sar eax, 2
00205 89 45 24 mov DWORD PTR result$[rbp], eax
; 42 : }
00208 eb b7 jmp SHORT $LN7@index_pair
$LN8@index_pair:
$LN16@index_pair:
; 43 : }
; 44 : index += 7;
0020a 8b 45 04 mov eax, DWORD PTR index$[rbp]
0020d 83 c0 07 add eax, 7
00210 89 45 04 mov DWORD PTR index$[rbp], eax
; 45 : }
00213 e9 a2 fe ff ff jmp $LN2@index_pair
$LN3@index_pair:
; 46 : for (; (index < size - 1) && (!result); index += 2) {
00218 eb 09 jmp SHORT $LN12@index_pair
$LN10@index_pair:
0021a 8b 45 04 mov eax, DWORD PTR index$[rbp]
0021d 83 c0 02 add eax, 2
00220 89 45 04 mov DWORD PTR index$[rbp], eax
$LN12@index_pair:
00223 8b 45 44 mov eax, DWORD PTR size$[rbp]
00226 ff c8 dec eax
00228 39 45 04 cmp DWORD PTR index$[rbp], eax
0022b 7d 3d jge SHORT $LN11@index_pair
0022d 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
00231 75 37 jne SHORT $LN11@index_pair
; 47 : result = *(int *)(str + index) == target;
00233 48 63 45 04 movsxd rax, DWORD PTR index$[rbp]
00237 48 8b 8d 30 02
00 00 mov rcx, QWORD PTR str$[rbp]
0023e 8b 95 38 02 00
00 mov edx, DWORD PTR target$[rbp]
00244 39 14 41 cmp DWORD PTR [rcx+rax*2], edx
00247 75 0c jne SHORT $LN21@index_pair
00249 c7 85 04 02 00
00 01 00 00 00 mov DWORD PTR tv152[rbp], 1
00253 eb 0a jmp SHORT $LN22@index_pair
$LN21@index_pair:
00255 c7 85 04 02 00
00 00 00 00 00 mov DWORD PTR tv152[rbp], 0
$LN22@index_pair:
0025f 8b 85 04 02 00
00 mov eax, DWORD PTR tv152[rbp]
00265 89 45 24 mov DWORD PTR result$[rbp], eax
; 48 : }
00268 eb b0 jmp SHORT $LN10@index_pair
$LN11@index_pair:
; 49 : if (result) {
0026a 83 7d 24 00 cmp DWORD PTR result$[rbp], 0
0026e 74 05 je SHORT $LN19@index_pair
; 50 : return index;
00270 8b 45 04 mov eax, DWORD PTR index$[rbp]
00273 eb 05 jmp SHORT $LN1@index_pair
$LN19@index_pair:
; 51 : }
; 52 : return -1;
00275 b8 ff ff ff ff mov eax, -1
$LN1@index_pair:
; 53 : }
0027a 48 8b f8 mov rdi, rax
0027d 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32]
00281 48 8d 15 00 00
00 00 lea rdx, OFFSET FLAT:index_pair_sse$rtcFrameData
00288 e8 00 00 00 00 call _RTC_CheckStackVars
0028d 48 8b c7 mov rax, rdi
00290 48 8b 8d 08 02
00 00 mov rcx, QWORD PTR __$ArrayPad$[rbp]
00297 48 33 cd xor rcx, rbp
0029a e8 00 00 00 00 call __security_check_cookie
0029f 48 8d a5 18 02
00 00 lea rsp, QWORD PTR [rbp+536]
002a6 5f pop rdi
002a7 5d pop rbp
002a8 c3 ret 0
index_pair_sse ENDP
_TEXT ENDS
END
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+354
View File
@@ -0,0 +1,354 @@
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.41.34120.0
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM infolog:BYTE:0200H
_DATA ENDS
msvcjmc SEGMENT
__7583A0D2_mmintrin@h DB 01H
__DDA0A690_concurrencysal@h DB 01H
__9ECC08BE_sal@h DB 01H
__E05D733A_vadefs@h DB 01H
__6A355E0E_vcruntime@h DB 01H
__1B0272D9_corecrt@h DB 01H
__45DED006_corecrt_malloc@h DB 01H
__FA77ED4C_malloc@h DB 01H
__EAE0325A_xmmintrin@h DB 01H
__0ED14FEE_winpackagefamily@h DB 01H
__F92EF742_winapifamily@h DB 01H
__22E515EB_sdkddkver@h DB 01H
__A09A3A7D_excpt@h DB 01H
__AC8FA393_stdarg@h DB 01H
__29F49F40_specstrings_undef@h DB 01H
__D0F42932_specstrings_strict@h DB 01H
__F00405FD_sdv_driverspecs@h DB 01H
__173E09CA_driverspecs@h DB 01H
__9A452361_specstrings@h DB 01H
__74484FB3_corecrt_wctype@h DB 01H
__1EC467ED_ctype@h DB 01H
__98517906_kernelspecs@h DB 01H
__D3497022_basetsd@h DB 01H
__61CC25A1_errno@h DB 01H
__890838BD_vcruntime_string@h DB 01H
__E4C945B4_corecrt_memcpy_s@h DB 01H
__8EAFF484_corecrt_memory@h DB 01H
__6490AEC5_corecrt_wstring@h DB 01H
__E8295E1E_string@h DB 01H
__7FCB5136_guiddef@h DB 01H
__FF8A9E11_pshpack4@h DB 01H
__D5438902_poppack@h DB 01H
__FB07E2A3_pshpack2@h DB 01H
__F6906775_pshpack8@h DB 01H
__F9415CFA_pshpack1@h DB 01H
__E58C6F1C_apiset@h DB 01H
__A5C52262_ktmtypes@h DB 01H
__FBBA8F9D_winnt@h DB 01H
__A32D3D2C_minwindef@h DB 01H
__7D798299_windef@h DB 01H
__9AE108E9_apisetcconv@h DB 01H
__9CE53D2C_minwinbase@h DB 01H
__5D0AA210_apiquery2@h DB 01H
__4DD4E726_processenv@h DB 01H
__3575CC96_fileapi@h DB 01H
__8EA220E6_fileapifromapp@h DB 01H
__BF9B31FE_debugapi@h DB 01H
__C3AFE134_utilapiset@h DB 01H
__76F69E51_handleapi@h DB 01H
__7E63D784_errhandlingapi@h DB 01H
__FFA7003C_fibersapi@h DB 01H
__8971CECF_namedpipeapi@h DB 01H
__46C9D8A6_profileapi@h DB 01H
__98D4F0A3_heapapi@h DB 01H
__50EF2A88_ioapiset@h DB 01H
__92EA1464_synchapi@h DB 01H
__A53D8AED_interlockedapi@h DB 01H
__B506CAAF_processthreadsapi@h DB 01H
__FF735694_sysinfoapi@h DB 01H
__29589789_memoryapi@h DB 01H
__E9C7A663_enclaveapi@h DB 01H
__D035F9F7_threadpoollegacyapiset@h DB 01H
__C899130C_threadpoolapiset@h DB 01H
__E0441EE7_jobapi@h DB 01H
__CEF86838_jobapi2@h DB 01H
__35AC6B9A_wow64apiset@h DB 01H
__C8AE41A5_libloaderapi@h DB 01H
__CC9E232D_securitybaseapi@h DB 01H
__C9D0C9B8_namespaceapi@h DB 01H
__30FF9CAD_systemtopologyapi@h DB 01H
__4D358795_processtopologyapi@h DB 01H
__40446D10_securityappcontainer@h DB 01H
__3A952EDF_realtimeapiset@h DB 01H
__F4865F4B_winerror@h DB 01H
__53C1BD93_timezoneapi@h DB 01H
__1FFBEDBF_winbase@h DB 01H
__43D3FA34_wingdi@h DB 01H
__D24A7391_tvout@h DB 01H
__7713A6C8_winuser@h DB 01H
__0B345F71_datetimeapi@h DB 01H
__9AC6960C_winnls@h DB 01H
__973A40A8_stringapiset@h DB 01H
__CC46FEE2_wincontypes@h DB 01H
__97D70BE1_consoleapi@h DB 01H
__27EC5E18_consoleapi2@h DB 01H
__262E342F_consoleapi3@h DB 01H
__641DCD70_wincon@h DB 01H
__5A96C7A7_verrsrc@h DB 01H
__B69C6FF2_winver@h DB 01H
__7AEB8C37_reason@h DB 01H
__59F1A8A9_winreg@h DB 01H
__EE0E2B7F_wnnc@h DB 01H
__DCDB7054_winnetwk@h DB 01H
__81DDEDE3_stralign@h DB 01H
__2134D1B4_winsvc@h DB 01H
__11C07376_mcx@h DB 01H
__577CE3E7_ime_cmodes@h DB 01H
__1E72C31E_imm@h DB 01H
__E15BF856_windows@h DB 01H
__8FC206A7_ssc_internal@h DB 01H
__44420885_corecrt_stdio_config@h DB 01H
__AB601D8D_corecrt_wstdio@h DB 01H
__C1EC35D3_stdio@h DB 01H
__13F5961F_stddef@h DB 01H
__FD6DBD68_corecrt_search@h DB 01H
__E2E33A61_corecrt_wstdlib@h DB 01H
__26263363_limits@h DB 01H
__6E5ACABA_stdlib@h DB 01H
__9049550C_stb_image@h DB 01H
__98501D5C_stdint@h DB 01H
__264E89B8_khrplatform@h DB 01H
__799FCA13_gl@h DB 01H
__A57296D0_wgl@h DB 01H
__417F438F_glfw3@h DB 01H
__8F82BB96_emmintrin@h DB 01H
__5023D31F_pmmintrin@h DB 01H
__E0FAA09D_tmmintrin@h DB 01H
__C9C1B51E_smmintrin@h DB 01H
__ACA33CD2_nmmintrin@h DB 01H
__7918C69C_wmmintrin@h DB 01H
__B28C8B9B_zmmintrin@h DB 01H
__85982951_immintrin@h DB 01H
__19139D6C_assert@h DB 01H
__0C16F932_StgSharpC@h DB 01H
__D947C158_vector@c DB 01H
msvcjmc ENDS
PUBLIC normalize
PUBLIC __JustMyCode_Default
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
; COMDAT pdata
pdata SEGMENT
$pdata$normalize DD imagerel $LN3
DD imagerel $LN3+379
DD imagerel $unwind$normalize
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$normalize DD 025051801H
DD 01132318H
DD 0700c0041H
DD 0500bH
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
00000 c2 00 00 ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\ÄÚºËÔ´´úÂë\StgSharp.C\vector.c
; COMDAT normalize
_TEXT SEGMENT
a_length_sq$ = 16
a_inv_length$ = 64
dot_product$ = 112
b_orthogonal$ = 160
b_length_sq$ = 208
b_inv_length$ = 256
source$ = 512
target$ = 520
normalize PROC ; COMDAT
; 5 : {
$LN3:
00000 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
00005 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
0000a 55 push rbp
0000b 57 push rdi
0000c 48 81 ec 08 02
00 00 sub rsp, 520 ; 00000208H
00013 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
00018 48 8d 0d 00 00
00 00 lea rcx, OFFSET FLAT:__D947C158_vector@c
0001f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
00024 90 npad 1
; 6 : __m128 a_length_sq = _mm_mul_ps(*source, *source);
00025 48 8b 85 00 02
00 00 mov rax, QWORD PTR source$[rbp]
0002c 48 8b 8d 00 02
00 00 mov rcx, QWORD PTR source$[rbp]
00033 0f 10 00 movups xmm0, XMMWORD PTR [rax]
00036 0f 59 01 mulps xmm0, XMMWORD PTR [rcx]
00039 0f 29 45 10 movaps XMMWORD PTR a_length_sq$[rbp], xmm0
; 7 : a_length_sq = _mm_add_ps(a_length_sq,
0003d 0f 28 45 10 movaps xmm0, XMMWORD PTR a_length_sq$[rbp]
00041 0f c6 45 10 b1 shufps xmm0, XMMWORD PTR a_length_sq$[rbp], 177 ; 000000b1H
00046 0f 28 4d 10 movaps xmm1, XMMWORD PTR a_length_sq$[rbp]
0004a 0f 58 c8 addps xmm1, xmm0
0004d 0f 28 c1 movaps xmm0, xmm1
00050 0f 29 45 10 movaps XMMWORD PTR a_length_sq$[rbp], xmm0
; 8 : _mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
; 9 : a_length_sq = _mm_add_ss(a_length_sq,
00054 0f 28 45 10 movaps xmm0, XMMWORD PTR a_length_sq$[rbp]
00058 0f c6 45 10 0e shufps xmm0, XMMWORD PTR a_length_sq$[rbp], 14
0005d 0f 28 4d 10 movaps xmm1, XMMWORD PTR a_length_sq$[rbp]
00061 f3 0f 58 c8 addss xmm1, xmm0
00065 0f 29 4d 10 movaps XMMWORD PTR a_length_sq$[rbp], xmm1
; 10 : _mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
; 11 :
; 12 : __m128 a_inv_length = _mm_rsqrt_ps(a_length_sq);
00069 0f 52 45 10 rsqrtps xmm0, XMMWORD PTR a_length_sq$[rbp]
0006d 0f 29 45 40 movaps XMMWORD PTR a_inv_length$[rbp], xmm0
; 13 : *source = _mm_mul_ps(*source, a_inv_length);
00071 48 8b 85 00 02
00 00 mov rax, QWORD PTR source$[rbp]
00078 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0007b 0f 59 45 40 mulps xmm0, XMMWORD PTR a_inv_length$[rbp]
0007f 48 8b 85 00 02
00 00 mov rax, QWORD PTR source$[rbp]
00086 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 14 :
; 15 : __m128 dot_product = _mm_mul_ps(*target, *source);
00089 48 8b 85 08 02
00 00 mov rax, QWORD PTR target$[rbp]
00090 48 8b 8d 00 02
00 00 mov rcx, QWORD PTR source$[rbp]
00097 0f 10 00 movups xmm0, XMMWORD PTR [rax]
0009a 0f 59 01 mulps xmm0, XMMWORD PTR [rcx]
0009d 0f 29 45 70 movaps XMMWORD PTR dot_product$[rbp], xmm0
; 16 : dot_product = _mm_add_ps(dot_product,
000a1 0f 28 45 70 movaps xmm0, XMMWORD PTR dot_product$[rbp]
000a5 0f c6 45 70 b1 shufps xmm0, XMMWORD PTR dot_product$[rbp], 177 ; 000000b1H
000aa 0f 28 4d 70 movaps xmm1, XMMWORD PTR dot_product$[rbp]
000ae 0f 58 c8 addps xmm1, xmm0
000b1 0f 28 c1 movaps xmm0, xmm1
000b4 0f 29 45 70 movaps XMMWORD PTR dot_product$[rbp], xmm0
; 17 : _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(2, 3, 0, 1)));
; 18 : dot_product = _mm_add_ss(dot_product,
000b8 0f 28 45 70 movaps xmm0, XMMWORD PTR dot_product$[rbp]
000bc 0f c6 45 70 0e shufps xmm0, XMMWORD PTR dot_product$[rbp], 14
000c1 0f 28 4d 70 movaps xmm1, XMMWORD PTR dot_product$[rbp]
000c5 f3 0f 58 c8 addss xmm1, xmm0
000c9 0f 29 4d 70 movaps XMMWORD PTR dot_product$[rbp], xmm1
; 19 : _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(0, 0, 3, 2)));
; 20 :
; 21 : __m128 b_orthogonal = _mm_sub_ps(*target, _mm_mul_ps(*source, dot_product));
000cd 48 8b 85 00 02
00 00 mov rax, QWORD PTR source$[rbp]
000d4 0f 10 00 movups xmm0, XMMWORD PTR [rax]
000d7 0f 59 45 70 mulps xmm0, XMMWORD PTR dot_product$[rbp]
000db 48 8b 85 08 02
00 00 mov rax, QWORD PTR target$[rbp]
000e2 0f 10 08 movups xmm1, XMMWORD PTR [rax]
000e5 0f 5c c8 subps xmm1, xmm0
000e8 0f 28 c1 movaps xmm0, xmm1
000eb 0f 29 85 a0 00
00 00 movaps XMMWORD PTR b_orthogonal$[rbp], xmm0
; 22 :
; 23 : __m128 b_length_sq = _mm_mul_ps(b_orthogonal, b_orthogonal);
000f2 0f 28 85 a0 00
00 00 movaps xmm0, XMMWORD PTR b_orthogonal$[rbp]
000f9 0f 59 85 a0 00
00 00 mulps xmm0, XMMWORD PTR b_orthogonal$[rbp]
00100 0f 29 85 d0 00
00 00 movaps XMMWORD PTR b_length_sq$[rbp], xmm0
; 24 : b_length_sq = _mm_add_ps(b_length_sq,
00107 0f 28 85 d0 00
00 00 movaps xmm0, XMMWORD PTR b_length_sq$[rbp]
0010e 0f c6 85 d0 00
00 00 b1 shufps xmm0, XMMWORD PTR b_length_sq$[rbp], 177 ; 000000b1H
00116 0f 28 8d d0 00
00 00 movaps xmm1, XMMWORD PTR b_length_sq$[rbp]
0011d 0f 58 c8 addps xmm1, xmm0
00120 0f 28 c1 movaps xmm0, xmm1
00123 0f 29 85 d0 00
00 00 movaps XMMWORD PTR b_length_sq$[rbp], xmm0
; 25 : _mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
; 26 : b_length_sq = _mm_add_ss(b_length_sq,
0012a 0f 28 85 d0 00
00 00 movaps xmm0, XMMWORD PTR b_length_sq$[rbp]
00131 0f c6 85 d0 00
00 00 0e shufps xmm0, XMMWORD PTR b_length_sq$[rbp], 14
00139 0f 28 8d d0 00
00 00 movaps xmm1, XMMWORD PTR b_length_sq$[rbp]
00140 f3 0f 58 c8 addss xmm1, xmm0
00144 0f 29 8d d0 00
00 00 movaps XMMWORD PTR b_length_sq$[rbp], xmm1
; 27 : _mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
; 28 :
; 29 : __m128 b_inv_length = _mm_rsqrt_ps(b_length_sq);
0014b 0f 52 85 d0 00
00 00 rsqrtps xmm0, XMMWORD PTR b_length_sq$[rbp]
00152 0f 29 85 00 01
00 00 movaps XMMWORD PTR b_inv_length$[rbp], xmm0
; 30 : *target = _mm_mul_ps(b_orthogonal, b_inv_length);
00159 0f 28 85 a0 00
00 00 movaps xmm0, XMMWORD PTR b_orthogonal$[rbp]
00160 0f 59 85 00 01
00 00 mulps xmm0, XMMWORD PTR b_inv_length$[rbp]
00167 48 8b 85 08 02
00 00 mov rax, QWORD PTR target$[rbp]
0016e 0f 11 00 movups XMMWORD PTR [rax], xmm0
; 31 : }
00171 48 8d a5 e8 01
00 00 lea rsp, QWORD PTR [rbp+488]
00178 5f pop rdi
00179 5d pop rbp
0017a c3 ret 0
normalize ENDP
_TEXT ENDS
END
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\Youmu\OneDrive - MSFT\大学\毕业设计\GraduationProject\build\StgSharp.C.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>
Binary file not shown.
@@ -0,0 +1,11 @@
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\dllmain.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\dllmain.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\intrinsic.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\intrinsic.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat2.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\mat2.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat3.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\mat3.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\mat4.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\mat4.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\stb_image.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\stb_image.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\StgSharpC.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\StgSharpC.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\hash.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\hash.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\string.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\string.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\vector.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\vector.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\vector_dot.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\vector_dot.obj
@@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.22621.0:
Release|x64|C:\Users\Youmu\OneDrive - MSFT\大学\毕业设计\GraduationProject\|
@@ -0,0 +1,4 @@
^D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3DLL.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\GLFW3_MT.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\DLLMAIN.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\HASH.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\INTRINSIC.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\MAT2.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\MAT3.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\MAT4.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\STB_IMAGE.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\STGSHARPC.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\STRING.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\VECTOR.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\内核源代码\STGSHARP.C\X64\RELEASE\VECTOR_DOT.OBJ
C:\Users\Youmu\OneDrive - MSFT\大学\毕业设计\GraduationProject\build\StgSharp.C.lib
C:\Users\Youmu\OneDrive - MSFT\大学\毕业设计\GraduationProject\build\StgSharp.C.EXP
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\内核源代码\StgSharp.C\x64\Release\StgSharp.C.iobj
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More