233 views
1 1 vote

Match the following statements with True (T) / False (F).

S1: replacing A + 4*3 with A + 12 is called strength reduction
S2: replacing A * 4 with A << 2 is called constant folding

Options:

  • TT

  • TF

  • FT

  • FF

 
 

1 Answer

Best answer
0 0 votes

D

Both statements are false. The correct statements are:

S1: replacing A + 4*3 with A + 12 is called constant folding.
S2: replacing A * 4 with A << 2 is called strength reduction.

“Evaluation of constant expressions at compile time is constant folding, whereas replacing expensive operations with cheaper ones is strength reduction.”

• selected by
Position:
Show:

Related questions

0 0 votes
2 2 answers
786
786 views
Ebrahim asked Jan 31, 2024
786 views
6. Generate code for the following C program using any code generation algorithm. [3 Marks] main() { int x, a, b, c, d, e; ...
0 0 votes
0 0 answers
371
371 views
Ebrahim asked Jan 11, 2024
371 views
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b
0 0 votes
0 0 answers
433
433 views
Ebrahim asked Jan 10, 2024
433 views
Please provide in detail solution step by step 5. Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC ...