diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index bc9f2f88b..3cfdaa7f7 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -3,7 +3,7 @@ 47.9% in //Sequence::undertake_queued_tasks// 4.5% in //MajorNodes::pre_pass// 3.2% in //MajorNodes::pass_1// - 2.3% in //RTPhrasebook::compile_entries// + 2.4% in //RTPhrasebook::compile_entries// 1.8% in //ImperativeDefinitions::assess_all// 1.5% in //RTKindConstructors::compile// 1.0% in //Sequence::lint_inter// @@ -18,12 +18,12 @@ 0.1% in //Task::make_built_in_kind_constructors// 0.1% in //Understand::traverse// 0.1% in //World::stages_II_and_III// - 2.2% not specifically accounted for + 2.0% not specifically accounted for 29.0% in running Inter pipeline - 10.2% in step 14/15: generate inform6 -> auto.inf + 10.1% in step 14/15: generate inform6 -> auto.inf 7.6% in step 5/15: load-binary-kits 6.5% in step 6/15: make-synoptic-module - 1.5% in step 9/15: make-identifiers-unique + 1.6% in step 9/15: make-identifiers-unique 0.5% in step 4/15: compile-splats 0.4% in step 12/15: eliminate-redundant-operations 0.4% in step 7/15: shorten-wiring diff --git a/inform7/Tests/Test Extensions/_Results_Ideal/Approximate Metric Units Example A.txt b/inform7/Tests/Test Extensions/_Results_Ideal/Approximate Metric Units Example A.txt index 4433fe0dc..f1da3ce28 100644 --- a/inform7/Tests/Test Extensions/_Results_Ideal/Approximate Metric Units Example A.txt +++ b/inform7/Tests/Test Extensions/_Results_Ideal/Approximate Metric Units Example A.txt @@ -17,19 +17,19 @@ You can see a cannon ball and a feather here. Taken. >[2] drop it from 1m -You let go the cannon ball from a height of 1m, and, subject to a downward force of 19.614N, it falls. 45 seconds later, this mass of 2kg hits the floor at 4.42 m/s with a kinetic energy of 19.53J. +You let go the cannon ball from a height of 1m, and, subject to a downward force of 19.614N, it falls. 0.45s later, this mass of 2kg hits the floor at 4.42 m/s with a kinetic energy of 19.53J. >[3] get ball Taken. >[4] drop it from 2m -You let go the cannon ball from a height of 2m, and, subject to a downward force of 19.614N, it falls. 63 seconds later, this mass of 2kg hits the floor at 6.26 m/s with a kinetic energy of 39.18J. +You let go the cannon ball from a height of 2m, and, subject to a downward force of 19.614N, it falls. 0.63s later, this mass of 2kg hits the floor at 6.26 m/s with a kinetic energy of 39.18J. >[5] get ball Taken. >[6] drop it from 3m -You let go the cannon ball from a height of 3m, and, subject to a downward force of 19.614N, it falls. 78 seconds later, this mass of 2kg hits the floor at 7.67 m/s with a kinetic energy of 58.82J. +You let go the cannon ball from a height of 3m, and, subject to a downward force of 19.614N, it falls. 0.78s later, this mass of 2kg hits the floor at 7.67 m/s with a kinetic energy of 58.82J. This is not doing either the floor or your ears any favours. @@ -58,6 +58,6 @@ A reddish-lit room with steel walls, whose only exit is the teleport corridor to You let go the cannon ball from a height of 3m, and, subject to a downward force of 7.38N, it falls. 1.27s later, this mass of 2kg hits the floor at 4.7 m/s with a kinetic energy of 22.09J. >[14] drop feather from 3m -You let go the feather from a height of 3m, and, subject to a downward force of 36 Newtons, it falls. 1.25s later, this mass of 10g hits the floor at 4.64 m/s with a kinetic energy of 107mJ. +You let go the feather from a height of 3m, and, subject to a downward force of 0.036N, it falls. 1.25s later, this mass of 10g hits the floor at 4.64 m/s with a kinetic energy of 107mJ. >Are you sure you want to quit? \ No newline at end of file diff --git a/inform7/runtime-module/Chapter 5/Literal Patterns.w b/inform7/runtime-module/Chapter 5/Literal Patterns.w index 1c5a2f28e..6b519ac54 100644 --- a/inform7/runtime-module/Chapter 5/Literal Patterns.w +++ b/inform7/runtime-module/Chapter 5/Literal Patterns.w @@ -102,14 +102,14 @@ void RTLiteralPatterns::compilation_agent(compilation_subtask *t) { EmitCode::up(); } switch (lp->lp_tokens[tc].lpt_type) { - case WORD_LPT: @; break; - case CHARACTER_LPT: @; break; - case ELEMENT_LPT: @; break; + case WORD_LPT: @; break; + case CHARACTER_LPT: @; break; + case ELEMENT_LPT: @; break; default: internal_error("unknown literal pattern token type"); } } -@ = +@ = TEMPORARY_TEXT(T) TranscodeText::from_wide_string(T, Lexer::word_raw_text(lp->lp_tokens[tc].token_wn), CT_RAW); EmitCode::inv(PRINT_BIP); @@ -118,7 +118,7 @@ void RTLiteralPatterns::compilation_agent(compilation_subtask *t) { EmitCode::up(); DISCARD_TEXT(T) -@ = +@ = TEMPORARY_TEXT(T) TEMPORARY_TEXT(tiny_string) PUT_TO(tiny_string, (int) lp->lp_tokens[tc].token_char); @@ -130,7 +130,7 @@ void RTLiteralPatterns::compilation_agent(compilation_subtask *t) { EmitCode::up(); DISCARD_TEXT(T) -@ = +@ = literal_pattern_element *lpe = &(lp->lp_elements[ec]); if (lpe->element_optional) @; @@ -383,9 +383,9 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); switch (lp->lp_tokens[tc].lpt_type) { - case WORD_LPT: @; break; - case CHARACTER_LPT: @; break; - case ELEMENT_LPT: @; break; + case WORD_LPT: @; break; + case CHARACTER_LPT: @; break; + case ELEMENT_LPT: @; break; default: internal_error("unknown literal pattern token type"); } } @@ -480,7 +480,7 @@ sets the |parsed_number| global to the value matched. EmitCode::val_iname(K_value, Hierarchy::find(GPR_NUMBER_HL)); EmitCode::up(); -@ = +@ = EmitCode::inv(IF_BIP); EmitCode::down(); EmitCode::val_symbol(K_value, gprk.mid_word_s); @@ -517,8 +517,8 @@ sets the |parsed_number| global to the value matched. EmitCode::ref_iname(K_value, Hierarchy::find(WN_HL)); EmitCode::up(); -@ = - @; +@ = + @; wchar_t lower_form = Characters::tolower(lp->lp_tokens[tc].token_char); wchar_t upper_form = Characters::toupper(lp->lp_tokens[tc].token_char); @@ -562,10 +562,10 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); EmitCode::up(); - @; + @; -@ = - @; +@ = + @; literal_pattern_element *lpe = &(lp->lp_elements[ec++]); if (ec == 1) { EmitCode::inv(STORE_BIP); @@ -607,12 +607,12 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); if (Kinds::FloatingPoint::uses_floating_point(lp->kind_specified)) - @ + @ else - @; - @; + @; + @; -@ = +@ = EmitCode::inv(STORE_BIP); EmitCode::down(); EmitCode::ref_symbol(K_value, gprk.f_s); @@ -702,7 +702,7 @@ sets the |parsed_number| global to the value matched. EmitCode::down(); EmitCode::ref_symbol(K_value, gprk.wpos_s); EmitCode::up(); - @; + @; @; EmitCode::up(); EmitCode::up(); @@ -738,7 +738,7 @@ sets the |parsed_number| global to the value matched. EmitCode::ref_symbol(K_value, gprk.mid_word_s); EmitCode::val_false(); EmitCode::up(); - @; + @; EmitCode::up(); EmitCode::up(); @@ -804,7 +804,7 @@ sets the |parsed_number| global to the value matched. EmitCode::ref_symbol(K_value, gprk.mid_word_s); EmitCode::val_false(); EmitCode::up(); - @; + @; EmitCode::up(); EmitCode::up(); @@ -1025,7 +1025,7 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); EmitCode::up(); -@ = +@ = EmitCode::inv(STORE_BIP); EmitCode::down(); EmitCode::ref_symbol(K_value, gprk.tot_s); @@ -1181,7 +1181,7 @@ sets the |parsed_number| global to the value matched. EmitCode::ref_symbol(K_value, gprk.mid_word_s); EmitCode::val_false(); EmitCode::up(); - @; + @; EmitCode::inv(STORE_BIP); EmitCode::down(); EmitCode::ref_symbol(K_value, gprk.x_s); @@ -1271,7 +1271,7 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); } -@ = +@ = EmitCode::inv(IF_BIP); EmitCode::down(); EmitCode::inv(EQ_BIP); @@ -1310,7 +1310,7 @@ sets the |parsed_number| global to the value matched. EmitCode::up(); EmitCode::up(); -@ = +@ = EmitCode::inv(IF_BIP); EmitCode::down(); EmitCode::inv(EQ_BIP); diff --git a/inform7/values-module/Chapter 3/Literal Patterns.w b/inform7/values-module/Chapter 3/Literal Patterns.w index d944aa3ce..f5bbc7e41 100644 --- a/inform7/values-module/Chapter 3/Literal Patterns.w +++ b/inform7/values-module/Chapter 3/Literal Patterns.w @@ -227,8 +227,8 @@ equivalent to an exact value. literal_pattern *lp; scaling_transformation *benchmark_sc = NULL; for (lp = list_head; lp; lp = lp->next_for_this_kind) - if (lp->benchmark) benchmark_sc = &(lp->scaling); - + if (lp->benchmark) + benchmark_sc = &(lp->scaling); int rescale_factor = Kinds::Scalings::determine_M(&(new_lp->scaling), benchmark_sc, FALSE, new_lp->equivalent_unit, new_lp->primary_alternative); if (rescale_factor != 1) @@ -236,7 +236,6 @@ equivalent to an exact value. if ((lp != new_lp) && (lp->equivalent_unit == FALSE)) lp->scaling = Kinds::Scalings::enlarge(lp->scaling, rescale_factor); - list_head = LiteralPatterns::lp_list_add_inner(list_head, new_lp); if ((TargetVMs::is_16_bit(Task::vm())) && (PM_ZMachineOverflow2_issued == FALSE)) diff --git a/services/kinds-module/Chapter 3/Scaled Arithmetic Values.w b/services/kinds-module/Chapter 3/Scaled Arithmetic Values.w index dbabc3015..6ecdbee27 100644 --- a/services/kinds-module/Chapter 3/Scaled Arithmetic Values.w +++ b/services/kinds-module/Chapter 3/Scaled Arithmetic Values.w @@ -453,6 +453,12 @@ so this is what we set |M| to. double k = sc->real_scalar; sc->real_M = B*k; } + } else if (sc->scaling_mode == LP_SCALED_AT) { + if (sc->use_integer_scaling) { + sc->int_M = benchmark_sc->int_M; + } else { + sc->real_M = benchmark_sc->real_M; + } } @h Enlarging and contracting.